submodule: Use cat instead of echo to avoid DOS line-endings
[git/dscho.git] / contrib / vim / README
blobfca1e17251f1f414a1d97bf6e6240bdf20daa648
1 Syntax highlighting for git commit messages, config files, etc. is
2 included with the vim distribution as of vim 7.2, and should work
3 automatically.
5 If you have an older version of vim, you can get the latest syntax
6 files from the vim project:
8   http://ftp.vim.org/pub/vim/runtime/syntax/git.vim
9   http://ftp.vim.org/pub/vim/runtime/syntax/gitcommit.vim
10   http://ftp.vim.org/pub/vim/runtime/syntax/gitconfig.vim
11   http://ftp.vim.org/pub/vim/runtime/syntax/gitrebase.vim
12   http://ftp.vim.org/pub/vim/runtime/syntax/gitsendemail.vim
14 These files are also available via FTP at the same location.
16 To install:
18   1. Copy these files to vim's syntax directory $HOME/.vim/syntax
19   2. To auto-detect the editing of various git-related filetypes:
20         $ cat >>$HOME/.vim/filetype.vim <<'EOF'
21         autocmd BufNewFile,BufRead *.git/COMMIT_EDITMSG    setf gitcommit
22         autocmd BufNewFile,BufRead *.git/config,.gitconfig setf gitconfig
23         autocmd BufNewFile,BufRead git-rebase-todo         setf gitrebase
24         autocmd BufNewFile,BufRead .msg.[0-9]*
25                 \ if getline(1) =~ '^From.*# This line is ignored.$' |
26                 \   setf gitsendemail |
27                 \ endif
28         autocmd BufNewFile,BufRead *.git/**
29                 \ if getline(1) =~ '^\x\{40\}\>\|^ref: ' |
30                 \   setf git |
31                 \ endif
32         EOF