Mark msysGit as obsolete
[msysgit.git] / share / vim / vimrc
blob941ebbaa4f307c310f896d8fc449d6263662852a
1 " Setting some decent VIM settings for programming
3 set ai                          " set auto-indenting on for programming
4 set showmatch                   " automatically show matching brackets. works like it does in bbedit.
5 set vb                          " turn on the "visual bell" - which is much quieter than the "audio blink"
6 set ruler                       " show the cursor position all the time
7 set laststatus=2                " make the last line where the status is two lines deep so you can see status always
8 set backspace=indent,eol,start  " make that backspace key work the way it should
9 set nocompatible                " vi compatible is LAME
10 set background=dark             " Use colours that work well on a dark background (Console is usually black)
11 set showmode                    " show the current mode
12 syntax on                       " turn syntax highlighting on by default
14 " Show EOL type and last modified timestamp, right after the filename
15 set statusline=%<%F%h%m%r\ [%{&ff}]\ (%{strftime(\"%H:%M\ %d/%m/%Y\",getftime(expand(\"%:p\")))})%=%l,%c%V\ %P
17 "------------------------------------------------------------------------------
18 " Only do this part when compiled with support for autocommands.
19 if has("autocmd")
20     "Set UTF-8 as the default encoding for commit messages
21     autocmd BufReadPre COMMIT_EDITMSG,git-rebase-todo setlocal fileencodings=utf-8
23     "Remember the positions in files with some git-specific exceptions"
24     autocmd BufReadPost *
25       \ if line("'\"") > 0 && line("'\"") <= line("$")
26       \           && expand("%") !~ "COMMIT_EDITMSG"
27       \           && expand("%") !~ "ADD_EDIT.patch"
28       \           && expand("%") !~ "addp-hunk-edit.diff"
29       \           && expand("%") !~ "git-rebase-todo" |
30       \   exe "normal g`\"" |
31       \ endif
33       autocmd BufNewFile,BufRead *.patch set filetype=diff
34       autocmd BufNewFile,BufRead *.diff set filetype=diff
36       autocmd Syntax diff
37       \ highlight WhiteSpaceEOL ctermbg=red |
38       \ match WhiteSpaceEOL /\(^+.*\)\@<=\s\+$/
40       autocmd Syntax gitcommit setlocal textwidth=74
41 endif " has("autocmd")