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.
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"
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" |
33 autocmd BufNewFile,BufRead *.patch set filetype=diff
34 autocmd BufNewFile,BufRead *.diff set filetype=diff
37 \ highlight WhiteSpaceEOL ctermbg=red |
38 \ match WhiteSpaceEOL /\(^+.*\)\@<=\s\+$/
40 autocmd Syntax gitcommit setlocal textwidth=74
41 endif " has("autocmd")