aboutsummaryrefslogtreecommitdiff
path: root/inc/filetype-options.vim
diff options
context:
space:
mode:
authorMitch Riedstra <mitch@riedstra.us>2018-10-29 00:01:44 -0400
committerMitch Riedstra <mitch@riedstra.us>2018-10-29 00:01:44 -0400
commit188cc44f0d8b090caa740fa7e9b6a197df38b88f (patch)
tree44db8d4a284f82f88fc96126f79164c594d2007e /inc/filetype-options.vim
parent0dbc1ced53ab90811238ba2c25d52f0ceaadff55 (diff)
downloadvim-cfg-188cc44f0d8b090caa740fa7e9b6a197df38b88f.tar.gz
vim-cfg-188cc44f0d8b090caa740fa7e9b6a197df38b88f.tar.xz
massive refactor of my vimrc
Diffstat (limited to 'inc/filetype-options.vim')
-rw-r--r--inc/filetype-options.vim98
1 files changed, 98 insertions, 0 deletions
diff --git a/inc/filetype-options.vim b/inc/filetype-options.vim
new file mode 100644
index 0000000..97e5bdd
--- /dev/null
+++ b/inc/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=4
+ set shiftwidth=4
+ 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