-
Notifications
You must be signed in to change notification settings - Fork 3
/
filetypes
43 lines (34 loc) · 1.54 KB
/
filetypes
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
"FILETYPE OPTIONS
" use filetype plugins to determine indent settings
filetype plugin indent on
" ruby and yaml indentation
autocmd FileType ruby,rdoc,cucumber,yaml,html,eruby set softtabstop=2 shiftwidth=2 tabstop=2
autocmd BufNewFile,BufRead Gemfile setfiletype ruby
autocmd BufNewFile,BufRead config.ru setfiletype ruby
autocmd BufNewFile,BufRead *_spec.rb compiler rspec
let ruby_space_errors = 1
" markdown files
autocmd BufRead,BufNewFile *.mkd,*.markdown,*.md,*.mdown,*.mkdn set softtabstop=4 shiftwidth=4 tabstop=4
autocmd BufRead,BufNewFile *.mkd,*.markdown,*.md,*.mdown,*.mkdn set noexpandtab
" set filetype on config files
autocmd BufNewFile,BufRead ~/.vim/* setfiletype vim
" set folding automatically to indent, fuck you, except for diffs
autocmd BufNewFile,BufRead * set foldmethod=indent
autocmd BufNewFile,BufRead *.diff set foldmethod=diff
" use cursorcolumn in whitespace-sensitive file formats
au Filetype coffee,python,haml,sass,slim set cursorcolumn
" sqf
au BufRead,BufNewFile *.ext setfiletype cpp
au BufRead,BufNewFile *.sqf,*.sqs setfiletype sqf
" rubyisms
autocmd FileType ruby
\ let b:AutoClosePairs = AutoClose#DefaultPairsModified("|", "")
autocmd FileType html
\ let b:AutoClosePairs = AutoClose#DefaultPairsModified("<>", "")
" set the snippets for rails/ruby projects
autocmd vimenter * call s:SetupSnippets()
function! s:SetupSnippets()
call ExtractSnips("~/.vim/snippets/html", "eruby")
call ExtractSnips("~/.vim/snippets/html", "xhtml")
call ExtractSnips("~/.vim/snippets/html", "php")
endfunction