-
Notifications
You must be signed in to change notification settings - Fork 10
/
filetype.vim
59 lines (48 loc) · 2.25 KB
/
filetype.vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
" Customized filetypes by extension
if exists("did_load_filetypes")
finish
endif
" By default, shell scripts are "kornshell" (same as "posix").
let g:is_kornshell = 1
augroup filetypedetect
au!
" This needs to be before *.txt, otherwise CMakeLists.txt doesn't get the
" correct filetype.
au BufNewFile,BufRead CMakeLists.txt,*.cmake,*.cmake.in setfiletype cmake
au BufNewFile,BufRead *.cxx setfiletype cpp
au BufNewFile,BufRead *.dxy setfiletype c
au BufNewFile,BufRead *.ll setfiletype llvm
au BufNewFile,BufRead *.txt setfiletype text
au BufNewFile,BufRead *.wiki setfiletype Wikipedia
au BufNewFile,BufRead *.rest setfiletype rst
au BufNewFile,BufRead *.td setfiletype tablegen
au BufNewFile,BufRead bash-fc[-.]*
\ if exists('*SetupBashFixcommand') | SetupBashFixcommand | endif
au BufNewFile,BufRead leinrc setfiletype sh
au BufNewFile,BufRead .pypirc setfiletype cfg
au BufNewFile,BufRead .coveragerc setfiletype cfg
au BufNewFile,BufRead Jenkinsfile setfiletype groovy
" Setup Git-related filetypes.
au BufNewFile,BufRead *.git/MERGE_MSG setfiletype gitcommit
au BufNewFile,BufRead *.git/modules/**/MERGE_MSG setfiletype gitcommit
au BufNewFile,BufRead *.git/TAG_EDITMSG setfiletype gitrelated
au BufNewFile,BufRead *.git/modules/**/TAG_EDITMSG setfiletype gitrelated
au BufNewFile,BufRead *.git/NOTES_EDITMSG setfiletype gitrelated
au BufNewFile,BufRead *.git/modules/**/NOTES_EDITMSG setfiletype gitrelated
" Use the copy and overwrite mechanism on crontab files, otherwise crontab
" may not see the changes we make.
au FileType crontab setlocal backupcopy=yes
" Setup tmux conf files.
au BufNewFile,BufRead .tmux.conf*,tmux.conf* setf tmux
" Treat .syntastic_c_config as vim.
autocmd BufNewFile,BufRead .syntastic_c_config setfiletype vim
" Salt server support. Treat .sls files as yaml, unless #!py is at the top.
autocmd BufNewFile,BufRead *.sls
\ if getline(1) =~ "^#!py" |
\ setfiletype python |
\ else |
\ setfiletype yaml |
\ endif
" ssh-related configuration:
autocmd BufNewFile,BufRead */.ssh/config.d/*.conf setfiletype sshconfig
augroup END