diff options
Diffstat (limited to '.vimrc')
-rw-r--r-- | .vimrc | 187 |
1 files changed, 187 insertions, 0 deletions
@@ -0,0 +1,187 @@ +"""""""""" +" DEFAULTS +"""""""""" +set nocompatible +filetype plugin indent on + +"""""""""""""" +" RELOAD VIMRC +"""""""""""""" +nmap <F5> :source ~/.vimrc<cr> + +"""""""""""""""""""" +" BACKUP DIRECTORIES +"""""""""""""""""""" + +set undodir=~/.vim/.undo// +set backupdir=~/.vim/.backup// +set directory=~/.vim/.swap// + +"""""""""""""""" +" USER INTERFACE +"""""""""""""""" + +" Line numbers on by default +set number + +" Show command as it is being inserted +set showcmd + +" Provide 3 lines of context regardless of cursor position +set so=3 + +" Enhanced tab completion menu +set wildmenu + +" Show where I am in the file +set ruler + +" Ignore case for searches +set ignorecase +" unless query contains uppercase chars +set smartcase + +" Watch your searches complete in real time +set incsearch + +" Highlight search matches throughout after query is entered (plus Ctrl-q to kill) +set hlsearch +nnoremap <C-q> :noh<CR> + +" Ensure magic is on for regex +set magic + +" Open splits to the right and below +set splitright +set splitbelow + +" Never hide the status line +set laststatus=2 + +" Change the title of VIM windows +set title + +" Create a leader key because I ran out of modifiers +" Backslash is perhaps good? Modifier-like placement +let mapleader='\' + +" Instant recognition of escape key (fuck <Esc> sequences) +set noesckeys + +" Timeout length for map leader keys +"set timeoutlen=200 ttimeoutlen=200 + +""""""""" +" BUFFERS +""""""""" + +" make it easy to swap buffers at a glance +nmap <Leader>b :buffers<CR>:b + +" do not demand buffers be saved on switching +set hidden + +""""""""""""""" +" COLOR/STYLING +""""""""""""""" + +" Enable syntax highlighting +syntax enable + +" Color scheme settings +set background=dark +if &t_Co == 256 || has('gui_running') + colorscheme diokai +else + colorscheme desert +endif + +" The greatest font ever +set guifont=Inconsolata\ 13 + +" Disable many bells and whistles on the GUI +" -m(enu), -t(oolbar), +" -r and -L are scrollbars +" on right and left sides +set go-=m +set go-=T +set go-=r +set go-=L + +" Size the gvim instance sanely +if has("gui_running") + set lines=24 columns=80 +endif + +""""""""""""""""" +" TABBING OPTIONS +""""""""""""""""" +" Convert tab chars into spaces +set expandtab + +" Don't add indents when they already exist +set smarttab + +" Four spaces to an indent +set shiftwidth=4 +set tabstop=4 + +" HTML uses two spaces instead +autocmd FileType html setlocal shiftwidth=2 tabstop=2 + +" Newline every 80 chars +"set textwidth=80 + +set ai " Auto indent +set nosi " Dumb indent +set wrap " Wrap long lines to fit on screen +set linebreak " Do not break up words when wrapping + +"""""""" +" MOTION +"""""""" + +" Navigate up/down through longlines instead of passing through them +map j gj +map k gk + +" Reduce keystrokes when moving between splits +nnoremap <C-h> <C-W>h +nnoremap <C-j> <C-W>j +nnoremap <C-k> <C-W>k +nnoremap <C-l> <C-W>l + +" Reduce keystrokes when relocating splits +nnoremap <leader>H <C-W>H +nnoremap <leader>J <C-W>J +nnoremap <leader>K <C-W>K +nnoremap <leader>L <C-W>L + +" Reduce keystrokes when resizing splits +nnoremap <leader>h <C-W>< +nnoremap <leader>j <C-W>+ +nnoremap <leader>k <C-W>- +nnoremap <leader>l <C-W>> + +nnoremap <leader>= <C-W>= +nnoremap <leader><bar> <C-W><bar> +nnoremap <leader>_ <C-W>_ + +" Reduce keystrokes when moving between tabs +nnoremap <leader>a gT +nnoremap <leader>d gt +nnoremap <leader>q :-tabmove<cr> +nnoremap <leader>w :tablast<cr> +nnoremap <leader>e :+tabmove<cr> + +"""""""""""""""""""" +" THOUGHT MANAGEMENT +"""""""""""""""""""" +nnoremap <leader>f :w !diff % -<CR> +nnoremap <leader>t :w !colordiff -y % - \| less -R<CR> + +"""""""" +" BOTTOM +"""""""" + +noh |