diff options
author | Jesse Luehrs <doy@tozt.net> | 2009-10-28 13:59:37 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2009-10-28 13:59:37 -0500 |
commit | 5ddd29dbac631f129574b744ed9d1ca16eacdefa (patch) | |
tree | 6c1783e4d7c01aff395c554f2e974c8c480ff87d /vim/ftdetect | |
parent | de0a67c3e6fef7e95e6ede964dca16266d83c03b (diff) | |
download | conf-5ddd29dbac631f129574b744ed9d1ca16eacdefa.tar.gz conf-5ddd29dbac631f129574b744ed9d1ca16eacdefa.zip |
updates for vim's git configuration
Diffstat (limited to 'vim/ftdetect')
-rw-r--r-- | vim/ftdetect/git.vim | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/vim/ftdetect/git.vim b/vim/ftdetect/git.vim new file mode 100644 index 0000000..727bf0c --- /dev/null +++ b/vim/ftdetect/git.vim @@ -0,0 +1,18 @@ +" Git +autocmd BufNewFile,BufRead *.git/COMMIT_EDITMSG set ft=gitcommit +autocmd BufNewFile,BufRead *.git/config,.gitconfig,.gitmodules set ft=gitconfig +autocmd BufNewFile,BufRead git-rebase-todo set ft=gitrebase +autocmd BufNewFile,BufRead .msg.[0-9]* + \ if getline(1) =~ '^From.*# This line is ignored.$' | + \ set ft=gitsendemail | + \ endif +autocmd BufNewFile,BufRead *.git/** + \ if getline(1) =~ '^\x\{40\}\>\|^ref: ' | + \ set ft=git | + \ endif + +" This logic really belongs in scripts.vim +autocmd BufNewFile,BufRead,StdinReadPost * + \ if getline(1) =~ '^\(commit\|tree\|object\) \x\{40\}\>\|^tag \S\+$' | + \ set ft=git | + \ endif |