Vim FileStyle Update

    About the past


    In December last year, I wrote about a plugin that allows you to see non-compliance with some aspects of the coding standard when opening a file.

    image

    Time passed and the plugin received new functionality.

    Turn plugin on / off in session


    It is carried out by commands:
    :FileStyleEnable
    :FileStyleDisable
    

    Works for all open buffers.

    Automatically fix formatting issues


    It is carried out by the team:
    :FileStyleFix
    

    It works as follows:
    • Deletes escape sequences
    • Removes spaces at the end of a line
    • If this option is expandtabenabled, replaces tabs with spaces; otherwise, replaces spaces at the beginning of a line with tabs


    Plugin highlight overrides


    The backlight used by the plugin may not be suitable for everyone, therefore it is possible to redefine it through an explicit definition in vimrcone or more groups in the color scheme file:
    FileStyleTabsError
    FileStyleTrailingSpacesError
    FileStyleSpacesError
    FileStyleControlCharacter
    FileStyleTooLongLine
    

    For example, like this:
    highlight FileStyleTabsError ctermbg=3 guibg=Yellow
    

    Ignored patterns


    If you want to remove the highlight from the plugin of any specific pattern, you can vimrcadd the following line containing the pattern:
    let g:filestyle_ignore_patterns = ['^\(> \?\)\+$']
    

    In the console, to work in the color scheme, a group Normalwith a parameter must be explicitly defined ctermbg.
    hi Normal ctermbg=15
    

    Ignored File Types


    By default, the plugin checks all file types, but you can define a list of types ignored by the plugin:
    let g:filestyle_ignore = ['text']
    


    You can download the links: vim.org | Github

    Also popular now: