Browse Source

YAML support in vimrc

Fred Damstra (Macbook 2015) 1 year ago
parent
commit
180fb9a7ad
1 changed files with 11 additions and 0 deletions
  1. 11 0
      .vimrc

+ 11 - 0
.vimrc

@@ -90,6 +90,8 @@ Plugin 'vim-syntastic/syntastic'
 Plugin 'saltstack/salt-vim'
 Plugin 'psf/black'
 Plugin 'vim-autoformat/vim-autoformat'
+"Plugin 'pearofducks/ansible-vim'
+"Plugin 'mrk21/yaml-vim'
 
 au BufWrite * :Autoformat
 
@@ -113,6 +115,13 @@ set tabstop=2
 set shiftwidth=2
 set expandtab
 
+" Fix auto-indentation for YAML files
+"augroup yaml_fix
+"  autocmd!
+"  autocmd FileType yaml setlocal ts=2 sts=2 sw=2 expandtab indentkeys-=0# indentkeys-=<:>
+"augroup END
+"autocmd FileType yaml setlocal ts=2 sts=2 sw=2 expandtab indentkeys-=0# indentkeys-=<:> foldmethod
+
 " Python PEP-8
 au BufNewFile,BufRead *.py
       \ set tabstop=4 |
@@ -139,6 +148,8 @@ au BufNewFile,BufRead *.sls
 au FileType gitcommit setlocal nowrap
 au FileType go set expandtab!
 
+"au BufRead,BufNewFile *.yml, *.yaml set filetype=yaml.ansible
+
 "au BufNewFile,BufRead *.hcl, *.tf
 "    \ set filetype=terraform