Skip to content

Instantly share code, notes, and snippets.

@gcao
Created October 26, 2011 14:37
Show Gist options
  • Save gcao/1316537 to your computer and use it in GitHub Desktop.
Save gcao/1316537 to your computer and use it in GitHub Desktop.
.vimrc.local Used together with https://github.com/spf13/spf13-vim
color molokai
set nospell
set paste
set wrap
set hidden " Don't prompt to save buffer when changing to another buffer
set expandtab "Use :retab to replace tabs with spaces
set shiftwidth=2
set tabstop=2
set autoindent
set clipboard=unnamed " Default to copy to system clipboard
let mapleader=","
noremap / /\v
noremap // /\vxzz<CR>
" Disable arrow keys - based on recommendations on http://blog.sanctum.geek.nz/vim-anti-patterns/
noremap <Up> <nop>
noremap <Down> <nop>
noremap <Left> <nop>
noremap <Right> <nop>
" http://vimbits.com/bits/25
" Improve up/down movement on wrapped lines
nnoremap j gj
nnoremap k gk
" http://vimbits.com/bits/11
" Make Y behave like other capitals
nnoremap Y y$
"nmap ; : " This is already defined
nmap <Leader><Space> :map<Space>
nmap <Leader>f :CommandTFlush<CR>
nmap <Leader>el :e ~/.vimrc.local<CR>
" http://vimbits.com/bits/128
" automatically reload vimrc when it's saved
au BufWritePost .vimrc so ~/.vimrc
au BufWritePost .vimrc.local so ~/.vimrc.local
nmap <Leader>ee :NERDTreeToggle<CR><C-w>j
nmap <Leader>mb <Plug>MiniBufExplorer<C-w>j
" http://vim.wikia.com/wiki/Set_working_directory_to_the_current_file
"autocmd BufEnter * silent! lcd %:p:h
" Remove trailing spaces
noremap <Leader>spa :%s/\v\s+$<CR>
" Wrap word with "
nnoremap <Leader>" i"<ESC>wwi"<ESC>
" Wrap word with '
nnoremap <Leader>' i'<ESC>wwi'<ESC>
" Map ,XXX to go to buffer XXX
nnoremap <Leader>0 :10b<CR>
ruby <<EOF
1.upto 80 do |i|
VIM.command "nnoremap <Leader>#{i} :#{i}b<CR>"
end
EOF
nnoremap <Leader>, :bp<CR>
nnoremap <Leader>. :bn<CR>
nnoremap <Leader>x :bd<CR>
" Conque http://code.google.com/p/conque/wiki/Usage
let g:ConqueTerm_FastMode = 1
let g:ConqueTerm_InsertOnEnter = 1
let g:ConqueTerm_CWInsert = 1
#!/bin/sh
cd $HOME
# Install spf13 vim configurations
# Check out this repository
# Create symbolic link
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment