From 709accc8e4f6dc3c21fc9b55e9fcc31559c68472 Mon Sep 17 00:00:00 2001 From: Mitch Riedstra Date: Sat, 21 Sep 2019 12:44:34 -0400 Subject: Re-arrange the vim configuration --- plugin/filetype-options.vim | 98 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 plugin/filetype-options.vim (limited to 'plugin/filetype-options.vim') diff --git a/plugin/filetype-options.vim b/plugin/filetype-options.vim new file mode 100644 index 0000000..f0cbb37 --- /dev/null +++ b/plugin/filetype-options.vim @@ -0,0 +1,98 @@ +function! PhpSyntaxOverride() + hi! def link phpDocTags phpDefine + hi! def link phpDocParam phpType +endfunction + +augroup phpSyntaxOverride + autocmd! + autocmd FileType php call PhpSyntaxOverride() +augroup END + +" This is specifically for Salt's state files 'sls' +autocmd BufNewFile,BufRead *.sls set filetype=yaml + +autocmd Filetype python call SetPythonOptions() +autocmd Filetype htmldjango call SethtmldjangoOptions() +autocmd Filetype json call SetJsonOptions() +autocmd Filetype javascript call SetjavascriptOptions() +autocmd Filetype php call SetPHPOptions() +autocmd Filetype html call SetHTMLOptions() +autocmd Filetype sh call SetShellOptions() +autocmd Filetype go call SetGoOptions() +autocmd Filetype yaml call SetYamlOptions() +autocmd Filetype markdown call SetMarkdownOptions() + +function SetMarkdownOptions() + set spell + set tabstop=2 + set shiftwidth=2 + set expandtab + AcpDisable +endfunction +function SetPythonOptions() + set tabstop=4 + set shiftwidth=4 + set expandtab + filetype indent on + set smartindent +endfunction +function SetjavascriptOptions() + set tabstop=2 + set shiftwidth=2 + set expandtab + filetype indent on + set smartindent +endfunction +function SetJsonOptions() + set tabstop=3 + set shiftwidth=3 + set expandtab + filetype indent on + set smartindent +endfunction +function SethtmldjangoOptions() + set tabstop=2 + set shiftwidth=2 + set expandtab + filetype indent on + set smartindent +endfunction +function SetPHPOptions() + set colorcolumn=120 + set tabstop=4 + set shiftwidth=4 + set expandtab + filetype indent on + set smartindent +endfunction +function SetHTMLOptions() + set colorcolumn=120 + set tabstop=2 + set shiftwidth=2 + set expandtab + filetype indent on + set smartindent +endfunction +function SetShellOptions() + set tabstop=8 + set shiftwidth=8 + set noexpandtab + filetype indent on + set smartindent +endfunction +function SetGoOptions() + set tabstop=8 + set noexpandtab + " The ACP is pretty slow with my Go plugins enabled + AcpDisable + set nolist + set noic + set nolist +endfunction +function SetYamlOptions() + set tabstop=2 + set shiftwidth=2 + set expandtab + set expandtab + set noic +endfunction -- cgit v1.2.3