-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfiletype.vim
More file actions
109 lines (101 loc) · 3.69 KB
/
filetype.vim
File metadata and controls
109 lines (101 loc) · 3.69 KB
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
"
" manual filetype assignment
"
" Template syntax selector from Armin Ronacher (mitsuhiko). {{{1
fun! s:SelectHTML()
let n = 1
while n < 50 && n < line("$")
" check for jinja
if getline(n) =~ '{%\s*\(extends\|block\|macro\|set\|if\|for\|include\|trans\)\>'
set ft=htmljinja
return
endif
" check for django
if getline(n) =~ '{%\s*\(extends\|block\|comment\|ssi\|if\|for\|blocktrans\)\>'
set ft=htmldjango
return
endif
" check for mako
if getline(n) =~ '<%\(def\|inherit\)'
set ft=mako
return
endif
" check for genshi
if getline(n) =~ 'xmlns:py\|py:\(match\|for\|if\|def\|strip\|xmlns\)'
set ft=genshi
return
endif
let n = n + 1
endwhile
" go with html
set ft=html
endfun
" }}}
augroup filetypedetect
au BufNewFile,BufRead *.as setlocal ft=actionscript nolist ts=4 sw=4 noet
au BufNewFile,BufRead *.bb setf xdefaults
au BufNewFile,BufRead *.csv setf csv
au BufNewFile,BufRead *.flr setf actionscript
au BufNewFile,BufRead *.glsl setf glsl
au BufNewFile,BufRead *.html,*.htm call s:SelectHTML()
au BufNewFile,BufRead *.html setlocal nocindent smartindent
au BufNewFile,BufRead *.ini setf conf
au BufNewFile,BufRead *.input setf gnuplot
au BufNewFile,BufRead *.json setf javascript tw=0
au BufNewFile,BufRead *.less setf less
au BufNewFile,BufRead *.less setlocal nocindent smartindent
au BufNewFile,BufRead *.md setlocal ft=markdown nolist spell
au BufNewFile,BufRead *.plist setf xml
au BufNewFile,BufRead *.rb setlocal noai
au BufNewFile,BufRead *.rhtm setf eruby
au BufNewFile,BufRead *.rhtml setf eruby
au BufNewFile,BufRead *.rxml setf ruby
au BufNewFile,BufRead *.sass setf sass
au BufNewFile,BufRead *.sch setf scheme
au BufNewFile,BufRead *.scm setf scheme
au BufNewFile,BufRead *.scss setf scss
au BufNewFile,BufRead *.ss setf scheme
au BufNewFile,BufRead *.t setf perl
au BufNewFile,BufRead *.ts set foldlevel=999
au BufNewFile,BufRead *.ttml setf xml
au BufNewFile,BufRead *.xhtml setf xml
au BufNewFile,BufRead *.xml setlocal ft=xml ts=2 sw=2 et
au BufNewFile,BufRead *.xps setf perl
au BufNewFile,BufRead *.xsl setlocal ft=xslt ts=2 sw=2 et
au BufNewFile,BufRead *.yaml setlocal ft=yaml
au BufNewFile,BufRead *.yml setlocal ft=yaml
au BufNewFile,BufRead *.zone setlocal nolist ts=4 sw=4 noet
au BufNewFile,BufRead *.zsh setf zsh
au BufNewFile,BufRead *conkyrc setf conkyrc
au BufNewFile,BufRead *templates/*.html setf htmldjango
au BufNewFile,BufRead .vimlocal,.gvimlocal setf vim
au BufNewFile,BufRead .zshlocal setf zsh
au BufNewFile,BufRead .git/config setlocal ft=gitconfig nolist ts=4 sw=4 noet
au BufNewFile,BufRead .gitconfig* setlocal ft=gitconfig nolist ts=4 sw=4 noet
au BufNewFile,BufRead /etc/apache*/* setf apache
au BufNewFile,BufRead /tmp/crontab* setf crontab
au BufNewFile,BufRead /tmp/mutt-* setlocal spell nolist nohlsearch
au BufNewFile,BufRead /tmp/sql* setf sql
au BufNewFile,BufRead /usr/share/zsh/*/functions/* setf zsh
au BufNewFile,BufRead COMMIT_EDITMSG setlocal nolist nonumber
au BufNewFile,BufRead Makefile setlocal nolist
au BufNewFile,BufRead pf.conf setf pf
au BufNewFile,BufRead pf.conf.* setf pf
au FileType gitcommit setlocal nolist ts=4 sts=4 sw=4 noet
au FileType make setlocal nolist ts=4 sts=4 sw=4 noet
au BufNewFile,BufRead *.tt2
\ if ( getline(1) . getline(2) . getline(3) =~ '<\chtml'
\ && getline(1) . getline(2) . getline(3) !~ '<[%?]' )
\ || getline(1) =~ '<!DOCTYPE HTML' |
\ setf tt2html |
\ else |
\ setf tt2 |
\ endif
"au BufNewFile,BufRead *
" \ if &expandtab == 1 |
" \ setlocal list |
" \ else |
" \ setlocal nolist |
" \ endif
augroup END
runtime! ftdetect/*.vim