Skip to content

Instantly share code, notes, and snippets.

@balinterdi
Created August 17, 2011 14:29
Show Gist options
  • Save balinterdi/1151623 to your computer and use it in GitHub Desktop.
Save balinterdi/1151623 to your computer and use it in GitHub Desktop.
.vimrc.local
let mapleader=","
"RVM
set statusline+=%{exists('g:loaded_rvm')?rvm#statusline():''}
set statusline+=%r "read only flag
set statusline+=%m "modified flag
set statusline+=%t "filename
set statusline+=%= "left/right separator
set statusline+=%c, "cursor column
set statusline+=%l/%L "cursor line/total lines
set statusline+=\ %P "percent through file
set laststatus=2
set linespace=2
"turn off needless toolbar on gvim/mvim
set guioptions-=T
"recalculate the trailing whitespace warning when idle, and after saving
autocmd cursorhold,bufwritepost * unlet! b:statusline_trailing_space_warning
"recalculate the tab warning flag when idle and after writing
autocmd cursorhold,bufwritepost * unlet! b:statusline_tab_warning
"indent settings
set autoindent
"folding settings
set foldmethod=indent "fold based on indent
set foldnestmax=5 "deepest fold is 5 levels
set nofoldenable "dont fold by default
"vertical/horizontal scroll off settings
set scrolloff=3
set sidescrolloff=7
set sidescroll=1
"some stuff to get the mouse going in term
set mouse=a
set ttymouse=xterm2
"hide buffers when not displayed
set hidden
let NERDTreeChDirMode = 2
let NERDTreeIgnore = ['\.git$', '\~$', '^tmp$', '^log$', '\.bundle$', '\.sass-cache', '\.swp$', '\.test-app-root$']
let NERDTreeQuitOnOpen = 0
let NERDTreeShowHidden = 1
nnoremap <silent> <leader>n :NERDTreeToggle<cr>
nnoremap <silent> <C-f> :call :FindInNERDTree()<cr>
nnoremap <silent> <leader>N :NERDTreeFind<cr>
"make <c-l> clear the highlight as well as redraw
nnoremap <C-L> :nohls<CR><C-L>
inoremap <C-L> <C-O>:nohls<CR>
"map to bufexplorer
nnoremap <leader>b :BufExplorer<cr>
"map Q to something useful
noremap Q gq
"make Y consistent with C and D
nnoremap Y y$
"mark syntax errors with :signs
let g:syntastic_enable_signs=1
"jump to last cursor position when opening a file
"dont do it when writing a commit log entry
autocmd BufReadPost * call SetCursorPosition()
function! SetCursorPosition()
if &filetype !~ 'commit\c'
if line("'\"") > 0 && line("'\"") <= line("$")
exe "normal! g`\""
normal! zz
endif
end
endfunction
"key mapping for window navigation
map <C-h> <C-w>h
map <C-j> <C-w>j
map <C-k> <C-w>k
map <C-l> <C-w>l
"disable movement with arrow keys
map <up> <nop>
map <down> <nop>
map <left> <nop>
map <right> <nop>
imap <up> <nop>
imap <down> <nop>
imap <left> <nop>
imap <right> <nop>
" easier escape
inoremap kj <Esc>
"key mapping for tab navigation
nmap <Tab> gt
nmap <S-Tab> gT
let ScreenShot = {'Icon':0, 'Credits':0, 'force_background':'#FFFFFF'}
"remove trailing whitespace when document is saved
autocmd BufWritePre * :%s/\s\+$//e
" Ack
noremap <leader>a :Ack!
noremap <leader>A :AckFromSearch<cr>
" YankRing
nnoremap <silent> <F3> :YRShow<cr>
inoremap <silent> <F3> <ESC>:YRShow<cr>
" VimClojure
let vimclojure#HighlightBuiltins=1
let vimclojure#ParenRainbow=1
" CoffeeScript
vnoremap <leader>j "cy:vsplit<cr>:Scratch<CR>gg"cgP`[v`]<ESC>a<CR><CR><ESC>gv!coffee -bsp<CR>`]jVG"xdgg:se ft=javascript<CR>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment