aboutsummaryrefslogtreecommitdiff
path: root/vim/filetypes.vim
diff options
context:
space:
mode:
Diffstat (limited to 'vim/filetypes.vim')
-rw-r--r--vim/filetypes.vim98
1 files changed, 98 insertions, 0 deletions
diff --git a/vim/filetypes.vim b/vim/filetypes.vim
new file mode 100644
index 0000000..b14b47e
--- /dev/null
+++ b/vim/filetypes.vim
@@ -0,0 +1,98 @@
+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=4
+ set shiftwidth=4
+ 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()
+ " colorscheme acme
+ " syntax off
+ " colorscheme 256_noir
+ AcpDisable
+ set nolist
+ set noic
+ set nolist
+endfunction
+function SetYamlOptions()
+ " set listchars=tab:▸\ ,eol:¬,trail:•,space:·
+ set listchars=tab:▸\ ,eol:¬,trail:•
+ set expandtab
+ set noic
+endfunction
+
+" This is specifically for Salt's state files 'sls'
+autocmd BufNewFile,BufRead *.sls set filetype=yaml
+
+
+function! PhpSyntaxOverride()
+ hi! def link phpDocTags phpDefine
+ hi! def link phpDocParam phpType
+endfunction
+
+augroup phpSyntaxOverride
+ autocmd!
+ autocmd FileType php call PhpSyntaxOverride()
+augroup END