Skip to content

Instantly share code, notes, and snippets.

@ventz
Forked from thikade/vim_syntaxchecker.md
Created February 27, 2023 04:47
Show Gist options
  • Select an option

  • Save ventz/8c7f05e84a89ccdd19e73d1b766ff987 to your computer and use it in GitHub Desktop.

Select an option

Save ventz/8c7f05e84a89ccdd19e73d1b766ff987 to your computer and use it in GitHub Desktop.

Revisions

  1. @thikade thikade revised this gist Apr 6, 2021. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion vim_syntaxchecker.md
    Original file line number Diff line number Diff line change
    @@ -6,7 +6,7 @@
    cd ~/.vim/pack/$USER/start/
    git clone https://github.com/vim-syntastic/syntastic.git
    ```
    1. Install yamllint: `pip install yamllint`
    1. Install yamllint: `pip3 install yamllint`
    1. Configure yamllint:
    * see [https://yamllint.readthedocs.io/en/stable/configuration.html?highlight=disable#default-configuration]
    * use attached file "yamllint_config.yml" and copy to ~/.config/yamllint/config
  2. @thikade thikade revised this gist Apr 6, 2021. 1 changed file with 50 additions and 4 deletions.
    54 changes: 50 additions & 4 deletions vimrc
    Original file line number Diff line number Diff line change
    @@ -1,12 +1,58 @@
    # add these lines to your vimrc to configure syntastic & yamllint
    set t_Co=256
    set nocompatible

    "attempt to determine the file type
    filetype indent plugin on

    ""syntax highlighting
    if &t_Co > 2 || has("gui_running")
    syntax on
    endif

    "command-line completion
    set wildmenu

    "shows partial commands
    set showcmd

    "highlight searches
    set hlsearch
    set vi+=n

    "case insensitive search
    set ignorecase
    set smartcase

    set incsearch

    "displays cursor position
    set ruler
    set laststatus=2

    "dialogue save changed instead of failing
    set confirm

    "display relative numbers
    set number
    set relativenumber
    set numberwidth=3
    :highlight LineNr term=bold cterm=NONE ctermfg=DarkGrey ctermbg=NONE gui=NONE guifg=DarkGrey guibg=NONE

    "use spaces instead of tabs
    set shiftwidth=4
    set softtabstop=4
    set expandtab


    "add these lines to your vimrc to configure syntastic & yamllint
    set statusline+=%#warningmsg#
    set statusline+=%{SyntasticStatuslineFlag()}
    set statusline+=%*
    let g:syntastic_always_populate_loc_list = 1 # automatically load errors into the location list

    let g:syntastic_always_populate_loc_list = 1 " automatically load errors into the location list
    let g:syntastic_auto_loc_list = 1
    let g:syntastic_check_on_open = 1 # check for errors when a file is loaded
    let g:syntastic_check_on_open = 1 " check for errors when a file is loaded

    let g:syntastic_check_on_wq = 0
    let g:syntastic_yaml_checkers = [ "yamllint" ]
    let g:syntastic_quiet_messages = { "type": "style" }
  3. @thikade thikade revised this gist Apr 6, 2021. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions vim_syntaxchecker.md
    Original file line number Diff line number Diff line change
    @@ -2,8 +2,8 @@

    1. Install syntastic vim plugin (as of vim 7.4.x no plugin manager is required anymore!)
    ```
    mkdir -p ~/ .vim/pack/thikade/start/
    cd ~/.vim/pack/thikade/start/
    mkdir -p ~/.vim/pack/$USER/start/
    cd ~/.vim/pack/$USER/start/
    git clone https://github.com/vim-syntastic/syntastic.git
    ```
    1. Install yamllint: `pip install yamllint`
  4. @thikade thikade revised this gist Jul 19, 2019. 1 changed file with 1 addition and 2 deletions.
    3 changes: 1 addition & 2 deletions vimrc
    Original file line number Diff line number Diff line change
    @@ -6,8 +6,7 @@ set statusline+=%*

    let g:syntastic_always_populate_loc_list = 1 # automatically load errors into the location list
    let g:syntastic_auto_loc_list = 1
    let g:syntastic_check_on_open = 1
    let g:syntastic_check_on_open = 1 # check for errors when a file is loaded
    let g:syntastic_check_on_wq = 0
    let g:syntastic_yaml_checkers = [ "yamllint" ]
    let g:syntastic_quiet_messages = { "type": "style" }
    let g:syntastic_check_on_open = 1 # check for errors when a file is loaded
  5. @thikade thikade revised this gist Jul 19, 2019. 2 changed files with 13 additions and 11 deletions.
    19 changes: 10 additions & 9 deletions vim_syntaxchecker.md
    Original file line number Diff line number Diff line change
    @@ -1,20 +1,21 @@
    ## Getting vim yaml linter to work:

    1. Install yamllint: `pip install yamllint`
    1. Configure yamllint:
    * see [https://yamllint.readthedocs.io/en/stable/configuration.html?highlight=disable#default-configuration]
    * use attached file "yamllint_config.yml" and copy to ~/.config/yamllint/config
    `mkdir -p ~/.config/yamllint/; vim ~/.config/yamllint/config `
    1. Install syntastic:
    1. Install syntastic vim plugin (as of vim 7.4.x no plugin manager is required anymore!)
    ```
    mkdir -p ~/ .vim/pack/thikade/start/
    cd ~/.vim/pack/thikade/start/
    git clone https://github.com/vim-syntastic/syntastic.git
    ```
    4. Config and activate plugin checkers in vimrc – see attached vimrc
    1. Install yamllint: `pip install yamllint`
    1. Configure yamllint:
    * see [https://yamllint.readthedocs.io/en/stable/configuration.html?highlight=disable#default-configuration]
    * use attached file "yamllint_config.yml" and copy to ~/.config/yamllint/config
    `mkdir -p ~/.config/yamllint/; vim ~/.config/yamllint/config `
    1. Config and activate plugin checkers in vimrc – see attached vimrc
    1. Open a file x.yml and edit away, and save!
    1. To see what Syntastic knows about this file by using the command `:SyntasticInfo`
    ## Links:
    ### Links:
    https://github.com/vim-syntastic/syntastic
    https://github.com/vim-syntastic/syntastic/blob/master/doc/syntastic-checkers.txt
    https://github.com/vim-syntastic/syntastic/blob/master/doc/syntastic-checkers.txt
    5 changes: 3 additions & 2 deletions vimrc
    Original file line number Diff line number Diff line change
    @@ -4,9 +4,10 @@ set statusline+=%#warningmsg#
    set statusline+=%{SyntasticStatuslineFlag()}
    set statusline+=%*

    let g:syntastic_always_populate_loc_list = 1
    let g:syntastic_always_populate_loc_list = 1 # automatically load errors into the location list
    let g:syntastic_auto_loc_list = 1
    let g:syntastic_check_on_open = 1
    let g:syntastic_check_on_wq = 0
    let g:syntastic_yaml_checkers = [ "yamllint" ]
    let g:syntastic_quiet_messages = { "type": "style" }
    let g:syntastic_quiet_messages = { "type": "style" }
    let g:syntastic_check_on_open = 1 # check for errors when a file is loaded
  6. @thikade thikade revised this gist Jul 19, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion vim_syntaxchecker.md
    Original file line number Diff line number Diff line change
    @@ -3,7 +3,7 @@
    1. Install yamllint: `pip install yamllint`
    1. Configure yamllint:
    * see [https://yamllint.readthedocs.io/en/stable/configuration.html?highlight=disable#default-configuration]
    * use attached file "yamllint_config.yml" and copy to ~/.config/yamllint/config
    * use attached file "yamllint_config.yml" and copy to ~/.config/yamllint/config
    `mkdir -p ~/.config/yamllint/; vim ~/.config/yamllint/config `
    1. Install syntastic:
    ```
  7. @thikade thikade revised this gist Jul 19, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion vim_syntaxchecker.md
    Original file line number Diff line number Diff line change
    @@ -4,7 +4,7 @@
    1. Configure yamllint:
    * see [https://yamllint.readthedocs.io/en/stable/configuration.html?highlight=disable#default-configuration]
    * use attached file "yamllint_config.yml" and copy to ~/.config/yamllint/config
    * `mkdir -p ~/.config/yamllint/; vim ~/.config/yamllint/config `
    `mkdir -p ~/.config/yamllint/; vim ~/.config/yamllint/config `
    1. Install syntastic:
    ```
    mkdir -p ~/ .vim/pack/thikade/start/
  8. @thikade thikade revised this gist Jul 19, 2019. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions vim_syntaxchecker.md
    Original file line number Diff line number Diff line change
    @@ -2,9 +2,9 @@

    1. Install yamllint: `pip install yamllint`
    1. Configure yamllint:
    * see [https://yamllint.readthedocs.io/en/stable/configuration.html?highlight=disable#default-configuration]
    * use attached file "yamllint_config.yml" and copy to ~/.config/yamllint/config
    * `mkdir -p ~/.config/yamllint/; vim ~/.config/yamllint/config `
    * see [https://yamllint.readthedocs.io/en/stable/configuration.html?highlight=disable#default-configuration]
    * use attached file "yamllint_config.yml" and copy to ~/.config/yamllint/config
    * `mkdir -p ~/.config/yamllint/; vim ~/.config/yamllint/config `
    1. Install syntastic:
    ```
    mkdir -p ~/ .vim/pack/thikade/start/
  9. @thikade thikade revised this gist Jul 19, 2019. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions vim_syntaxchecker.md
    Original file line number Diff line number Diff line change
    @@ -2,9 +2,9 @@

    1. Install yamllint: `pip install yamllint`
    1. Configure yamllint:
    - see [https://yamllint.readthedocs.io/en/stable/configuration.html?highlight=disable#default-configuration]
    - use attached file "yamllint_config.yml" and copy to ~/.config/yamllint/config
    - `mkdir -p ~/.config/yamllint/; vim ~/.config/yamllint/config `
    * see [https://yamllint.readthedocs.io/en/stable/configuration.html?highlight=disable#default-configuration]
    * use attached file "yamllint_config.yml" and copy to ~/.config/yamllint/config
    * `mkdir -p ~/.config/yamllint/; vim ~/.config/yamllint/config `
    1. Install syntastic:
    ```
    mkdir -p ~/ .vim/pack/thikade/start/
  10. @thikade thikade revised this gist Jul 19, 2019. 1 changed file with 6 additions and 6 deletions.
    12 changes: 6 additions & 6 deletions vim_syntaxchecker.md
    Original file line number Diff line number Diff line change
    @@ -5,12 +5,12 @@
    - see [https://yamllint.readthedocs.io/en/stable/configuration.html?highlight=disable#default-configuration]
    - use attached file "yamllint_config.yml" and copy to ~/.config/yamllint/config
    - `mkdir -p ~/.config/yamllint/; vim ~/.config/yamllint/config `
    * Install syntastic:
    ```
    mkdir -p ~/ .vim/pack/thikade/start/
    cd ~/.vim/pack/thikade/start/
    git clone https://github.com/vim-syntastic/syntastic.git
    ```
    1. Install syntastic:
    ```
    mkdir -p ~/ .vim/pack/thikade/start/
    cd ~/.vim/pack/thikade/start/
    git clone https://github.com/vim-syntastic/syntastic.git
    ```
    4. Config and activate plugin checkers in vimrc – see attached vimrc
  11. @thikade thikade revised this gist Jul 19, 2019. 1 changed file with 1 addition and 7 deletions.
    8 changes: 1 addition & 7 deletions vim_syntaxchecker.md
    Original file line number Diff line number Diff line change
    @@ -5,13 +5,7 @@
    - see [https://yamllint.readthedocs.io/en/stable/configuration.html?highlight=disable#default-configuration]
    - use attached file "yamllint_config.yml" and copy to ~/.config/yamllint/config
    - `mkdir -p ~/.config/yamllint/; vim ~/.config/yamllint/config `

    ```
    mkdir -p ~/.config/yamllint/
    vim ~/.config/yamllint/config
    ```

    3. Install syntastic:
    * Install syntastic:
    ```
    mkdir -p ~/ .vim/pack/thikade/start/
    cd ~/.vim/pack/thikade/start/
  12. @thikade thikade revised this gist Jul 19, 2019. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion vim_syntaxchecker.md
    Original file line number Diff line number Diff line change
    @@ -3,7 +3,9 @@
    1. Install yamllint: `pip install yamllint`
    1. Configure yamllint:
    - see [https://yamllint.readthedocs.io/en/stable/configuration.html?highlight=disable#default-configuration]
    - use attached file. yamllint_config.yml
    - use attached file "yamllint_config.yml" and copy to ~/.config/yamllint/config
    - `mkdir -p ~/.config/yamllint/; vim ~/.config/yamllint/config `

    ```
    mkdir -p ~/.config/yamllint/
    vim ~/.config/yamllint/config
  13. @thikade thikade revised this gist Jul 19, 2019. 1 changed file with 0 additions and 39 deletions.
    39 changes: 0 additions & 39 deletions vim_syntaxchecker.md
    Original file line number Diff line number Diff line change
    @@ -22,42 +22,3 @@ git clone https://github.com/vim-syntastic/syntastic.git
    https://github.com/vim-syntastic/syntastic
    https://github.com/vim-syntastic/syntastic/blob/master/doc/syntastic-checkers.txt
    https://github.com/vim-syntastic/syntastic/blob/master/doc/syntastic-checkers.txt







    [1] .vimrc

    -------------

    set statusline+=%#warningmsg#

    set statusline+=%{SyntasticStatuslineFlag()}

    set statusline+=%*



    let g:syntastic_always_populate_loc_list = 1

    let g:syntastic_auto_loc_list = 1

    let g:syntastic_check_on_open = 1

    let g:syntastic_check_on_wq = 0

    let g:syntastic_yaml_checkers = [ "yamllint" ]

    let g:syntastic_quiet_messages = { "type": "style" }

    ------------






    ------------
  14. @thikade thikade revised this gist Jul 19, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion vim_syntaxchecker.md
    Original file line number Diff line number Diff line change
    @@ -15,7 +15,7 @@ mkdir -p ~/ .vim/pack/thikade/start/
    cd ~/.vim/pack/thikade/start/
    git clone https://github.com/vim-syntastic/syntastic.git
    ```
    1. Config and activate plugin checkers in vimrc – see attached vimrc
    4. Config and activate plugin checkers in vimrc – see attached vimrc


    ## Links:
  15. @thikade thikade revised this gist Jul 19, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion vim_syntaxchecker.md
    Original file line number Diff line number Diff line change
    @@ -9,7 +9,7 @@ mkdir -p ~/.config/yamllint/
    vim ~/.config/yamllint/config
    ```

    1. Install syntastic:
    3. Install syntastic:
    ```
    mkdir -p ~/ .vim/pack/thikade/start/
    cd ~/.vim/pack/thikade/start/
  16. @thikade thikade revised this gist Jul 19, 2019. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion vim_syntaxchecker.md
    Original file line number Diff line number Diff line change
    @@ -4,10 +4,11 @@
    1. Configure yamllint:
    - see [https://yamllint.readthedocs.io/en/stable/configuration.html?highlight=disable#default-configuration]
    - use attached file. yamllint_config.yml
    - ```
    ```
    mkdir -p ~/.config/yamllint/
    vim ~/.config/yamllint/config
    ```

    1. Install syntastic:
    ```
    mkdir -p ~/ .vim/pack/thikade/start/
  17. @thikade thikade revised this gist Jul 19, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion vim_syntaxchecker.md
    Original file line number Diff line number Diff line change
    @@ -4,7 +4,7 @@
    1. Configure yamllint:
    - see [https://yamllint.readthedocs.io/en/stable/configuration.html?highlight=disable#default-configuration]
    - use attached file. yamllint_config.yml
    ```
    - ```
    mkdir -p ~/.config/yamllint/
    vim ~/.config/yamllint/config
    ```
  18. @thikade thikade revised this gist Jul 19, 2019. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions vim_syntaxchecker.md
    Original file line number Diff line number Diff line change
    @@ -2,8 +2,8 @@

    1. Install yamllint: `pip install yamllint`
    1. Configure yamllint:
    - see [https://yamllint.readthedocs.io/en/stable/configuration.html?highlight=disable#default-configuration]
    - use attached file. yamllint_config.yml
    - see [https://yamllint.readthedocs.io/en/stable/configuration.html?highlight=disable#default-configuration]
    - use attached file. yamllint_config.yml
    ```
    mkdir -p ~/.config/yamllint/
    vim ~/.config/yamllint/config
  19. @thikade thikade revised this gist Jul 19, 2019. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion vim_syntaxchecker.md
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,9 @@
    ## Getting vim yaml linter to work:

    1. Install yamllint: `pip install yamllint`
    1. Configure yamllint: see [https://yamllint.readthedocs.io/en/stable/configuration.html?highlight=disable#default-configuration]
    1. Configure yamllint:
    - see [https://yamllint.readthedocs.io/en/stable/configuration.html?highlight=disable#default-configuration]
    - use attached file. yamllint_config.yml
    ```
    mkdir -p ~/.config/yamllint/
    vim ~/.config/yamllint/config
  20. @thikade thikade revised this gist Jul 19, 2019. 1 changed file with 8 additions and 10 deletions.
    18 changes: 8 additions & 10 deletions vim_syntaxchecker.md
    Original file line number Diff line number Diff line change
    @@ -1,25 +1,23 @@
    ## Getting vim yaml linter to work:


    1. Install yamllint: `pip install yamllint`
    2. Configure yamllint:
    1. Configure yamllint: see [https://yamllint.readthedocs.io/en/stable/configuration.html?highlight=disable#default-configuration]
    ```
    mkdir -p ~/.config/yamllint/
    vim ~/.config/yamllint/config [2] -> https://yamllint.readthedocs.io/en/stable/configuration.html?highlight=disable#default-configuration
    Install syntastic:
    vim ~/.config/yamllint/config
    ```
    1. Install syntastic:
    ```
    mkdir -p ~/ .vim/pack/thikade/start/
    cd ~/.vim/pack/thikade/start/
    git clone https://github.com/vim-syntastic/syntastic.git
    Config and activate plugin checkers in vimrc – see attached vimrc [1]
    ```
    1. Config and activate plugin checkers in vimrc – see attached vimrc


    Links:
    ## Links:
    https://github.com/vim-syntastic/syntastic
    https://github.com/vim-syntastic/syntastic/blob/master/doc/syntastic-checkers.txt
    https://github.com/vim-syntastic/syntastic/blob/master/doc/syntastic-checkers.txt


  21. @thikade thikade revised this gist Jul 19, 2019. 3 changed files with 42 additions and 61 deletions.
    63 changes: 2 additions & 61 deletions vim_syntaxchecker.md
    Original file line number Diff line number Diff line change
    @@ -2,8 +2,8 @@


    1. Install yamllint: `pip install yamllint`

    Configure yamllint:
    2. Configure yamllint:
    ```
    mkdir -p ~/.config/yamllint/
    vim ~/.config/yamllint/config [2] -> https://yamllint.readthedocs.io/en/stable/configuration.html?highlight=disable#default-configuration
    Install syntastic:
    @@ -58,64 +58,5 @@ let g:syntastic_quiet_messages = { "type": "style" }
    [2] yamllint config

    ------------

    ---



    rules:

    braces: enable

    brackets: enable

    colons: {max-spaces-before: 0, max-spaces-after: 8}

    commas: enable

    comments:

    level: warning

    comments-indentation:

    level: warning

    document-end: disable

    document-start:

    level: warning

    empty-lines: enable

    empty-values: enable

    hyphens: enable

    indentation: enable

    key-duplicates: enable

    key-ordering: disable

    line-length: disable

    new-line-at-end-of-file: enable

    new-lines: enable

    octal-values: enable

    quoted-strings: disable

    trailing-spaces: enable

    truthy:

    level: warning
    ------------
    12 changes: 12 additions & 0 deletions vimrc
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    # add these lines to your vimrc to configure syntastic & yamllint

    set statusline+=%#warningmsg#
    set statusline+=%{SyntasticStatuslineFlag()}
    set statusline+=%*

    let g:syntastic_always_populate_loc_list = 1
    let g:syntastic_auto_loc_list = 1
    let g:syntastic_check_on_open = 1
    let g:syntastic_check_on_wq = 0
    let g:syntastic_yaml_checkers = [ "yamllint" ]
    let g:syntastic_quiet_messages = { "type": "style" }
    28 changes: 28 additions & 0 deletions yamllint_config.yml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,28 @@
    ---

    rules:
    braces: enable
    brackets: enable
    colons: {max-spaces-before: 0, max-spaces-after: 8}
    commas: enable
    comments:
    level: warning
    comments-indentation:
    level: warning
    document-end: disable
    document-start:
    level: warning
    empty-lines: enable
    empty-values: enable
    hyphens: enable
    indentation: enable
    key-duplicates: enable
    key-ordering: disable
    line-length: disable
    new-line-at-end-of-file: enable
    new-lines: enable
    octal-values: enable
    quoted-strings: disable
    trailing-spaces: enable
    truthy:
    level: warning
  22. @thikade thikade created this gist Jul 19, 2019.
    121 changes: 121 additions & 0 deletions vim_syntaxchecker.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,121 @@
    ## Getting vim yaml linter to work:


    1. Install yamllint: `pip install yamllint`

    Configure yamllint:
    mkdir -p ~/.config/yamllint/
    vim ~/.config/yamllint/config [2] -> https://yamllint.readthedocs.io/en/stable/configuration.html?highlight=disable#default-configuration
    Install syntastic:
    mkdir -p ~/ .vim/pack/thikade/start/
    cd ~/.vim/pack/thikade/start/
    git clone https://github.com/vim-syntastic/syntastic.git
    Config and activate plugin checkers in vimrc – see attached vimrc [1]




    Links:
    https://github.com/vim-syntastic/syntastic

    https://github.com/vim-syntastic/syntastic/blob/master/doc/syntastic-checkers.txt

    https://github.com/vim-syntastic/syntastic/blob/master/doc/syntastic-checkers.txt







    [1] .vimrc

    -------------

    set statusline+=%#warningmsg#

    set statusline+=%{SyntasticStatuslineFlag()}

    set statusline+=%*



    let g:syntastic_always_populate_loc_list = 1

    let g:syntastic_auto_loc_list = 1

    let g:syntastic_check_on_open = 1

    let g:syntastic_check_on_wq = 0

    let g:syntastic_yaml_checkers = [ "yamllint" ]

    let g:syntastic_quiet_messages = { "type": "style" }

    ------------





    [2] yamllint config

    ------------

    ---



    rules:

    braces: enable

    brackets: enable

    colons: {max-spaces-before: 0, max-spaces-after: 8}

    commas: enable

    comments:

    level: warning

    comments-indentation:

    level: warning

    document-end: disable

    document-start:

    level: warning

    empty-lines: enable

    empty-values: enable

    hyphens: enable

    indentation: enable

    key-duplicates: enable

    key-ordering: disable

    line-length: disable

    new-line-at-end-of-file: enable

    new-lines: enable

    octal-values: enable

    quoted-strings: disable

    trailing-spaces: enable

    truthy:

    level: warning

    ------------