aboutsummaryrefslogtreecommitdiff
path: root/vim/filetypes.vim
blob: b14b47ee4cb32a52f211075c4920a0978e9a45fc (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
96
97
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