" Tue Dec 8 07:28:42 CST 2009
" plugins
" - NERDTree
" - bufexplorer
" - surround
" - align
" vi compatibility mode
set nocompatible
" omni-completion
filetype plugin on
set omnifunc=syntaxcomplete#Complete
" auto-load .vimrc
autocmd! BufWritePost .vimrc source %
" misc behaviors
set splitright " vertical splits appear on right
set lazyredraw " don't redraw screen during macros
set autochdir " change current directory to directory of current doc
set hidden " allows changing of buffers without saving
" appearance
colors slate
set guioptions-=T
set number
set ruler
set wildmenu
set showcmd
" tabs
set softtabstop=2 shiftwidth=2 expandtab
set smartindent
set tabstop=2
" searching
set ignorecase
set smartcase
set incsearch
" wrapping settings
set nowrap
nnoremap k gk
nnoremap j gj
" show whitespace characters
set list listchars=tab:>-
" remove trailing whitespace
nmap \s :%s;\s\+$;;g<CR>
" copy-pasting
nmap Y y$
vmap <C-c> "+y
nmap <C-c> ggVG"+y
vmap <C-p> "+P
nmap <C-p> "+P
" saving
nmap <S-s> :update<CR>
" write vs. program mode
nmap QW :set spell wrap linebreak<CR>
nmap Qw :set nospell nowrap nolinebreak<CR>
" switch buffer
nmap <C-k> :bn <CR>
nmap <C-j> :bN <CR>
nmap , :ls<CR>:b<Space>
" switch window
nmap <C-h> <C-w>h
nmap <C-l> <C-w>l
" C-style (/* and */) comment and uncomment
vmap // `>o*/`<O/*^
nmap // O/*jo*/k^
vmap \\ `>dd`<dd^
nmap \\ kddjddk^
" plugin specific shortcuts
" =========================
" align, for CSS files
nmap \: vi{:Align : ;<CR>
" system specific shortcuts
" ==========================
" allow autocomplete from dictionary
set dictionary+=/usr/share/dict/words
" shortcuts to various places
nmap \b :e ~/.bashrc<CR>
nmap \d :e ~/Desktop/<C-d>
nmap \v :e ~/.vimrc<CR>
Trackbacks & Pingbacks