vimpylintflake8vim-ale

How to remove warnings as comments in vim?


I am using vim9.1 with ale for syntastic checking, and "pylint" and "flake8" are used for Python. In my vim editor, the warnings are displayed as comments after my code, which makes the file hard to read sometimes. I wonder if I can modify the vim configurations to remove these in-line warning comments but keep the warning symbols on the left and warning messages at the bottom.

enter image description here


Solution

  • By default, the ALE plugin uses virtual text to show warnings. See :help virtual-text for more information on this Vim feature.

    You can switch it off in ALE by adding the following line to your configuration

    :let g:ale_virtualtext_cursor=0
    

    This is also described in ALE's documentation, section How can I disable virtual text appearing at ends of lines?