" Configuration file for vim " Prevent modelines in files from being evaluated (avoids a potential " security problem wherein a malicious user could write a hazardous " modeline into a file) (override default value of 5) set modelines=0 " Normally we use vim-extensions. If you want true vi-compatibility " remove change the following statements set nocompatible " Use Vim defaults instead of 100% vi compatibility set backspace=indent,eol,start " more powerful backspacing " Now we set some defaults for the editor set autoindent " always set autoindenting on set textwidth=0 " Don't wrap words by default set nobackup " Don't keep a backup file set viminfo='20,\"50 " read/write a .viminfo file, don't store more than " 50 lines of registers set history=50 " keep 50 lines of command line history set ruler " show the cursor position all the time " Suffixes that get lower priority when doing tab completion for filenames. " These are files we are not likely to want to edit or read. set suffixes=.bak,~,.swp,.o,.info,.aux,.log,.dvi,.bbl,.blg,.brf,.cb,.ind,.idx,.ilg,.inx,.out,.toc " We know xterm-debian is a color terminal if &term =~ "xterm-debian" || &term =~ "xterm-xfree86" set t_Co=16 set t_Sf=[3%dm set t_Sb=[4%dm endif " Make p in Visual mode replace the selected text with the "" register. vnoremap p :let current_reg = @"gvdi=current_reg " Vim5 and later versions support syntax highlighting. Uncommenting the next " line enables syntax highlighting by default. " syntax on if has("autocmd") " Enabled file type detection " Use the default filetype settings. If you also want to load indent files " to automatically do language-dependent indenting add 'indent' as well. filetype plugin on endif " has ("autocmd") " Some Debian-specific things augroup filetype au BufRead reportbug.* set ft=mail au BufRead reportbug-* set ft=mail augroup END " Set paper size from /etc/papersize if available (Debian-specific) if filereadable('/etc/papersize') let s:papersize = matchstr(system('/bin/cat /etc/papersize'), '\p*') if strlen(s:papersize) let &printoptions = "paper:" . s:papersize endif unlet! s:papersize endif " The following are commented out as they cause vim to behave a lot " different from regular vi. They are highly recommended though. "set showcmd " Show (partial) command in status line. "set showmatch " Show matching brackets. "set ignorecase " Do case insensitive matching "set incsearch " Incremental search "set autowrite " Automatically save before commands like :next and :make """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " General """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" set nocompatible " get out of horrible vi-compatible mode filetype on " detect the type of file set history=100 " How many lines of history to remember set cf " enable error files and error jumping """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Theme/Colors """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" set background=dark " we are using a dark background syntax on " syntax highlighting on colorscheme oceandeep " my theme """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Vim UI """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" set wildmenu " turn on wild menu set ruler " Always show current positions along the bottom set cmdheight=2 " the command bar is 2 high set number " turn on line numbers set nolz " do not redraw while running macros (much faster) set hid " you can change buffer without saving set backspace=2 whichwrap+=<,>,h,l " backspace and cursor keys wrap to set mouse=a " use mouse everywhere """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Visual Cues """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" set showmatch " show matching brackets set mat=5 " how many tenths of a second to blink matching brackets for set nohlsearch " do not highlight searched for phrases set incsearch " BUT do highlight as you type you search phrase "set list " show chars on end of line, whitespace, etc "set listchars= " Show end of line as $... (see help) set so=10 " Show 10 lines above and below the cursor (give scope) """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Text Formatting/Layout """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" set fo=tcrq " See Help (complex) set ai " autoindent set si " smartindent set nocindent " don't do c-style indenting (screws up other langauges [perl]) set tabstop=4 " tab spacing (settings below are just to unify it) set softtabstop=4 " unify set shiftwidth=4 " unify set nowrap " do not wrap lines " set smarttab " use tabs at the start of a line, spaces elsewhere set expandtab set textwidth=80 " taglist let Tlist_Ctags_Cmd="/usr/bin/exuberant-ctags" " MiniBufExplorer let g:miniBufExplMapCTabSwitchBufs = 1 " Map to move to end of line in insert mode. imap $ " Map to move to the beginning of the line in insert mode. imap 0 " Map to move to the first non-blank character of the line in insert " mode. imap ^ " Let's remap our insert mode bindings map a imap map :call 16_CycleBuffer(1) " right arrow (normal mode) switches buffers (excluding minibuf) map :call 16_CycleBuffer(0) " left arrow (normal mode) switches buffers (excluding minibuf) map i r " alt-i (normal mode) inserts a single char, and then switches back to normal imap imap imap imap imap imap imap map i map j map k map l " This shows spaces and tabs characters. Visual Whitespace. " set list set listchars=tab:»·,trail:· set list! " Tlist nnoremap :Tlist au FileType haskell,vhdl,ada let b:comment_leader = '-- ' au FileType vim let b:comment_leader = '" ' au FileType c,cpp,java let b:comment_leader = '// ' au FileType sh,make,tcl let b:comment_leader = '# ' au FileType tex let b:comment_leader = '% ' noremap ,c :sil s/^/=escape(b:comment_leader,'\/')/:noh noremap ,u :sil s/^\V=escape(b:comment_leader,'\/')//e:noh