aboutsummaryrefslogtreecommitdiff
path: root/plugin/filetype-options.vim
blob: 4e58918bfb25b809da75fce5eb917c6da8e2c9bc (plain) (blame)
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
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
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=4
	set noexpandtab
	set nolist
	set noic
	set nolist
endfunction
function SetYamlOptions()
	set tabstop=2
	set shiftwidth=2
	set expandtab
	set expandtab
	set noic
endfunction