Move vim autocommands into ftdetect or ftplugin

This commit is contained in:
Kenneth Benzie 2016-03-12 20:35:11 +00:00
parent 3b1d816705
commit 277de97a36
14 changed files with 50 additions and 0 deletions

View File

@ -0,0 +1,2 @@
" Force *.md to markdown filetype
au BufNewFile,BufReadPost *.md set filetype=markdown

View File

@ -0,0 +1,2 @@
" Force *.cl to OpenCL C filetype
au BufNewFile,BufReadPost *.cl set filetype=opencl

View File

@ -0,0 +1,2 @@
" Python convention is to use 4 space tabs.
setlocal tabstop=4 shiftwidth=4 softtabstop=4

View File

@ -0,0 +1,2 @@
" Force *.td to tablegen filetype
au BufNewFile,BufReadPost *.td set filetype=tablegen

View File

@ -1,2 +1,4 @@
" Set 'comments' to format dashed lists in comments. " Set 'comments' to format dashed lists in comments.
setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,:///,:// setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,:///,://
" Stop automatic new lines which typing long single liners
setlocal textwidth=0

14
after/ftplugin/cmake.vim Normal file
View File

@ -0,0 +1,14 @@
" TODO Create fold markers based on cmake syntax, eg.
"
" if() <- open
" endif() <- close
"
" foreach() <- open
" endforeach() <- close
"
" and so on for all other begin end style command pairs.
"
" Then change the setting.
"
" setlocal foldmethod=syntax
setlocal foldmethod=indent

View File

@ -0,0 +1,3 @@
if !has("win32") || has("gui_running")
setlocal spell
endif

4
after/ftplugin/help.vim Normal file
View File

@ -0,0 +1,4 @@
" Disable spell checking which is enabled for text files
setlocal nospell
" Show help in the rightmost vertical split
wincmd L

2
after/ftplugin/html.vim Normal file
View File

@ -0,0 +1,2 @@
" Set text and tab width for certain file types
setlocal textwidth=80

View File

@ -0,0 +1,6 @@
if !has("win32") || has("gui_running")
setlocal spell
endif
setlocal textwidth=80
" Use tabwidth of 4 to be markdown complient
setlocal tabstop=4 shiftwidth=4 softtabstop=4

View File

@ -0,0 +1,5 @@
" Disable expansion of tabs in snippet files as snippets must correctly insert
" the current filetypes tab settings.
setlocal noexpandtab
" Set tab width to 4 spaces as UltiSnips supports inline python.
setlocal tabstop=4 shiftwidth=4 softtabstop=4

4
after/ftplugin/text.vim Normal file
View File

@ -0,0 +1,4 @@
if !has("win32") || has("gui_running")
setlocal spell
endif
setlocal textwidth=80

1
after/ftplugin/vim.vim Normal file
View File

@ -0,0 +1 @@
setlocal foldmethod=marker

1
after/ftplugin/zsh.vim Normal file
View File

@ -0,0 +1 @@
setlocal foldmethod=marker