diff options
author | Dan McGee <dpmcgee@gmail.com> | 2011-04-20 14:14:20 -0500 |
---|---|---|
committer | Dan McGee <dpmcgee@gmail.com> | 2011-04-20 14:14:20 -0500 |
commit | 4fe832eb70101b0cf9d60aa32b3ddcc733be6f85 (patch) | |
tree | e512fa10c06d089d3e57b8d60b5afaf73b43243a | |
parent | b29163ecb75a672d55900f931165a241e5d5a645 (diff) | |
download | configfiles-4fe832eb70101b0cf9d60aa32b3ddcc733be6f85.tar.gz configfiles-4fe832eb70101b0cf9d60aa32b3ddcc733be6f85.zip |
Add vimrc
Signed-off-by: Dan McGee <dpmcgee@gmail.com>
-rw-r--r-- | vimrc | 131 |
1 files changed, 131 insertions, 0 deletions
@@ -0,0 +1,131 @@ +" ~/.vimrc + +"Use Vim mode +set nocompatible +"Basic startup settings +set encoding=utf-8 +set termencoding=utf-8 + +" CUSTOM KEYBINDINGS " +"basic key remappings +"noremap <Space> <PageDown> "make vim act like pager in normal mode + +"easy buffer flip shortcuts +nmap <F3> :bprev<CR> +nmap <F4> :bnext<CR> +"toggle highlight search off and on +nmap <silent> <F5> :let &hls=!&hls<CR> +imap <silent> <F5> <Esc>:let &hls=!&hls<CR>a +"toggle view of taglist +nmap <silent> <F8> :TlistToggle<CR> +imap <silent> <F8> <Esc>:TlistToggle<CR> +"show BufExplorer +nmap <silent> <F6> :BufExplorer<CR> +imap <silent> <F6> <Esc>:BufExplorer<CR> +"toggle spell checking +nmap <silent> <F10> :let &spell=!&spell<CR> +imap <silent> <F10> <Esc>:let &spell=!&spell<CR>a +"VCS commands +nmap <Leader>vcsa <Plug>VCSAdd +nmap <Leader>vcsn <Plug>VCSAnnotate +nmap <Leader>vcsG <Plug>VCSClearAndGotoOriginal +nmap <Leader>vcsc <Plug>VCSCommit +nmap <Leader>vcsd <Plug>VCSDiff +nmap <Leader>vcsg <Plug>VCSGotoOriginal +nmap <Leader>vcsL <Plug>VCSLock +nmap <Leader>vcsl <Plug>VCSLog +nmap <Leader>vcsq <Plug>VCSRevert +nmap <Leader>vcsr <Plug>VCSReview +nmap <Leader>vcss <Plug>VCSStatus +nmap <Leader>vcsU <Plug>VCSUnlock +nmap <Leader>vcsu <Plug>VCSUpdate +nmap <Leader>vcsv <Plug>VCSVimDiff + +" FILETYPE SETTINGS " +filetype on "enable file detection +filetype indent on "enable filetype indenting +filetype plugin on "enable filetype plugins +set fileencodings=ucs-bom,utf-8,default,latin1 "encodings to try +let g:load_doxygen_syntax=1 "use doxygen syntax on c/cpp/idl files + +" SYNTAX HIGHLIGHTING " +if (&t_Co > 2) || has("gui_running") + syntax enable +endif + +" GUI/NONGUI SETTINGS " +if has("gui_running") + if has("gui_gtk2") + set guifont=DejaVu\ Sans\ Mono\ 12 + endif + colorscheme desert + "colorscheme inkpot + set columns=80 lines=40 +else + if (&t_Co >= 256) + colorscheme inkpot + else + colorscheme desert + endif + "set background=dark +endif + +" BACKUP FILES " +set backup + +" SWAP FILES " +set dir=~/.vim/tmp//,.,~/tmp,/var/tmp,/tmp + +" SEARCHING SETTINGS " +set ignorecase "ignore case in searches +set smartcase "unless search contains uppercase +"set hlsearch "highlight previous search term +set incsearch "search-as-you-type + +" FORMATTING SETTINGS " +set autoindent "autoindent from previous line +set noexpandtab "keep tabs as tabs +set tabstop=4 "set tabstop equiv for display +set shiftwidth=4 "set space equiv for each (auto)indent + +" DISPLAY SETTINGS " +set ruler "show cursor position +set rulerformat=%19([%5l,%-6(%c%V%)]\ %P%) +set showcmd "display incomplete command +set cmdheight=1 "restrict command height (and no more 'press enter') +set showmode "show current mode +set showmatch "show matching []{}() +set shortmess+=r "use short message to indicate read only +"set number "show line numbers + +" MISC SETTINGS " +set whichwrap=h,l,~,[,] "allow cursor keys to wrap lines +set backspace=indent,eol,start "allow backspacing of these chars +set ttyfast "smoother on fast terminals +set history=50 "number of commands/searches to store +set wildchar=<tab> +set wildmenu +set wildmode=longest:full,full "list possibilities when wildcard completing +set shell=bash "shell for vim to use +set ttymouse=xterm "use xterm mouse codes +if has('mouse') + set mouse=a "enable mouse in all modes +endif + +" AUTOCOMMMANDS " +if has("autocmd") + autocmd BufReadPost * + \ if line("'\"") > 1 && line("'\"") <= line("$") | + \ exe "normal! g`\"" | + \ endif +endif + +if !exists(":DiffOrig") + command DiffOrig vert new | set bt=nofile | r # | 0d_ | diffthis + \ | wincmd p | diffthis +endif + +" ABBREVIATIONS " +iab MAINTTAG # Maintainer: Dan McGee <dan@archlinux.org> +iab CONTRIBTAG # Contributor: Dan McGee <dpmcgee@gmail.com> + |