Skip to content

Instantly share code, notes, and snippets.

@davidtingsu
Last active December 20, 2015 18:29
Show Gist options
  • Save davidtingsu/6176554 to your computer and use it in GitHub Desktop.
Save davidtingsu/6176554 to your computer and use it in GitHub Desktop.
.vimrc.local for ruby development using spf13-vim distribution
Bundle 'brookhong/cscope.vim'
Bundle 'chazy/cscope_maps'
" local configuration for spf13-vim distribution
" https://github.com/spf13/spf13-vim
set wrap
set nospell
function! NumberToggle()
if(&relativenumber == 1)
set number
else
set relativenumber
endif
endfunc
nnoremap <C-n> :call NumberToggle()<cr>
let g:spf13_keep_trailing_whitespace = 1
autocmd BufNewFile,BufRead *.thor,*.rake set syntax=ruby
autocmd BufNewFile,BufRead Gemfile,Thorfile,Guardfile set filetype=ruby
autocmd BufNewFile,BufRead .zshrc set filetype=zsh
set clipboard=unnamed "yank to system clipboard. http://stackoverflow.com/questions/11489428/how-to-make-vim-paste-from-and-copy-to-systems-clipboard
" copy paste in mac
" http://stackoverflow.com/q/3961859/1123985
vnoremap <C-c> :w !pbcopy<CR><CR>
noremap <C-v> :r !pbpaste<CR><CR>
" http://vim.wikia.com/wiki/Converting_tabs_to_spaces
" That awful mixed mode with the half-tabs-are-spaces:
map \M <Esc>:set noexpandtab tabstop=8 softtabstop=4 shiftwidth=4<CR>
" Mini tabs, small "m":
map \m <Esc>:set expandtab softtabstop=2 tabstop=2 shiftwidth=2<CR>
" Think "little tabs" and "big tabs":
map \t <Esc>:set expandtab tabstop=4 shiftwidth=4<CR>
map \T <Esc>:set expandtab tabstop=8 shiftwidth=8<CR>"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment