]> git.r.bdr.sh - rbdr/dotfiles/blame - vim/ftdetect/git.vim
Update the stuff
[rbdr/dotfiles] / vim / ftdetect / git.vim
CommitLineData
0d23b6e5
BB
1" Git
2autocmd BufNewFile,BufRead *.git/COMMIT_EDITMSG set ft=gitcommit
3autocmd BufNewFile,BufRead *.git/config,.gitconfig,.gitmodules set ft=gitconfig
4autocmd BufNewFile,BufRead git-rebase-todo set ft=gitrebase
5autocmd BufNewFile,BufRead .msg.[0-9]*
6 \ if getline(1) =~ '^From.*# This line is ignored.$' |
7 \ set ft=gitsendemail |
8 \ endif
9autocmd BufNewFile,BufRead *.git/**
10 \ if getline(1) =~ '^\x\{40\}\>\|^ref: ' |
11 \ set ft=git |
12 \ endif
13
14" This logic really belongs in scripts.vim
15autocmd BufNewFile,BufRead,StdinReadPost *
16 \ if getline(1) =~ '^\(commit\|tree\|object\) \x\{40\}\>\|^tag \S\+$' |
17 \ set ft=git |
18 \ endif