瀏覽代碼

YAML support in vimrc

Fred Damstra (Macbook 2015) 1 年之前
父節點
當前提交
180fb9a7ad
共有 1 個文件被更改,包括 11 次插入0 次删除
  1. 11 0
      .vimrc

+ 11 - 0
.vimrc

@@ -90,6 +90,8 @@ Plugin 'vim-syntastic/syntastic'
 Plugin 'saltstack/salt-vim'
 Plugin 'saltstack/salt-vim'
 Plugin 'psf/black'
 Plugin 'psf/black'
 Plugin 'vim-autoformat/vim-autoformat'
 Plugin 'vim-autoformat/vim-autoformat'
+"Plugin 'pearofducks/ansible-vim'
+"Plugin 'mrk21/yaml-vim'
 
 
 au BufWrite * :Autoformat
 au BufWrite * :Autoformat
 
 
@@ -113,6 +115,13 @@ set tabstop=2
 set shiftwidth=2
 set shiftwidth=2
 set expandtab
 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
 " Python PEP-8
 au BufNewFile,BufRead *.py
 au BufNewFile,BufRead *.py
       \ set tabstop=4 |
       \ set tabstop=4 |
@@ -139,6 +148,8 @@ au BufNewFile,BufRead *.sls
 au FileType gitcommit setlocal nowrap
 au FileType gitcommit setlocal nowrap
 au FileType go set expandtab!
 au FileType go set expandtab!
 
 
+"au BufRead,BufNewFile *.yml, *.yaml set filetype=yaml.ansible
+
 "au BufNewFile,BufRead *.hcl, *.tf
 "au BufNewFile,BufRead *.hcl, *.tf
 "    \ set filetype=terraform
 "    \ set filetype=terraform