" Alexander Brevig set nocompatible " Must come first because it changes other options. source $VIMRUNTIME/vimrc_example.vim source $VIMRUNTIME/mswin.vim behave mswin au GUIEnter * simalt ~x set diffexpr=MyDiff() function MyDiff() let opt = '-a --binary ' if &diffopt =~ 'icase' | let opt = opt . '-i ' | endif if &diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif let arg1 = v:fname_in if arg1 =~ ' ' | let arg1 = '"' . arg1 . '"' | endif let arg2 = v:fname_new if arg2 =~ ' ' | let arg2 = '"' . arg2 . '"' | endif let arg3 = v:fname_out if arg3 =~ ' ' | let arg3 = '"' . arg3 . '"' | endif let eq = '' if $VIMRUNTIME =~ ' ' if &sh =~ '\ ' . arg3 . eq endfunction " Use pathogen to load all bundles/plugins " Comment out if not using pathogen silent! call pathogen#runtime_append_all_bundles() syntax enable " Turn on syntax highlighting. filetype plugin indent on " Turn on file type detection. runtime macros/matchit.vim " Load the matchit plugin. set showcmd " Display incomplete commands. set showmode " Display the mode you're in. set backspace=indent,eol,start " Intuitive backspacing. set hidden " Handle multiple buffers better. set wildmenu " Enhanced command line completion. set wildmode=list:longest " Complete files like a shell. set ignorecase " Case-insensitive searching. set smartcase " But case-sensitive if expression contains a capital letter. set number " Show line numbers. set ruler " Show cursor position. set incsearch " Highlight matches as you type. set hlsearch " Highlight matches. set nowrap " Explicitly turn off line wrapping. set scrolloff=3 " Show 3 lines of context around the cursor. set title " Set the window title set visualbell " No beeping set nobackup " Don't make a backup before overwriting a file. set nowritebackup " Annoying backup files avoided "set directory=TODO/,. " Keep swap files in one location " setting set softtabstop=2 set tabstop=2 " Global tab width. set shiftwidth=2 " And again, related. set expandtab " Use spaces instead of tabs set smarttab set laststatus=2 " Show the status line all the time set foldenable " Folding set foldmarker={,} " Folding "set foldmethod=syntax set foldlevel=100 " Folding set shiftround " Indent/outdent to nearest tabstops set t_Co=256 " Tell VIM to use 256 colors set autoread " Enable file auto read on external changes set confirm " Prevent quitting without saving set mouse=a " Enable use of mouse in all modes set sm " Automatic matching braces set showmatch " Highlight matching braces set autochdir " Change directory to current file set clipboard+=unnamed " Clipboard management set cursorline " Highlight current line set novisualbell " Disable visual bell set shortmess=atI " Shorten error messages set completeopt=menu,menuone,longest " Complete options (disable preview scratch window) set pumheight=15 " Limit popup menu height " Text manipulation set noeol " No empty line on EOF set autoindent " Copy indentation from the previous line set infercase " Keep current case on autocompletion let c_space_errors=1 " Highlight unwanted spaces " Useful status information at bottom of screen set statusline=[%n]\ %<%.99f\ %h%w%m%r%y\ %=%-16(\ %l,%c-%v\ %)%P colorscheme stamina " Default color scheme " Keyboard mapping map tt :tabnew map te :tabedit map tc :tabclose map to :tabonly map tn :tabnext map tp :tabprevious map tf :tabfirst map tl :tablast map tm :tabmove map t :FuzzyFinderTextMate map :NERDTreeToggle map ,asa :! astyle -s2 -a -C -S -K -N -L -w -f -p -H -x -j -J -O -c -k3 -Z -z2 % " get from insert to normal using ii instead of the far Esc inoremap ii " create blank newlines and stay in normal mode nnoremap nj o nnoremap nk O " move vertically through wrapped lines nnoremap j gj nnoremap k gk " DocBook mappings imap ,pp hhhhhhika imap ,cc bba imap ,em bba imap ,xr hhi imap ,s1 0whhxxkkkk$hi imap ,s2 0whhxxkkkk$hi imap ,s3 0whhxxkkkk$hi imap ,s4 0whhxxkkkk$hi imap ,pl 0iO " note that ',l2' was created solely to fit into ,il and ,ol imap ,li 0xxkk$a imap ,localListHelperMacro 0xxA imap ,il ,localListHelperMacro0xxkkk$a imap ,ol ,localListHelperMacro0xxkkk$a imap ,ve ,localListHelperMacro0xxAkkkA imap ,vl ,vejjjA0xxkkkkkkkwwwa