Skip to content

Instantly share code, notes, and snippets.

@ryansch
Created June 14, 2011 16:51
Show Gist options
  • Select an option

  • Save ryansch/1025322 to your computer and use it in GitHub Desktop.

Select an option

Save ryansch/1025322 to your computer and use it in GitHub Desktop.
"let g:solarized_visibility="normal"
"let g:solarized_specialbg="off"
"color solarized
color ry-solarized
"color torte
"highlight NonText guifg=#4a4a59
"highlight SpecialKey guifg=#4a4a59
set guifont=Menlo:h12
" Use the same symbols as TextMate for tabstops and EOLs
set listchars=tab:▸\ ,eol:¬,trail:·
" Enable special characters by default
set list
if has("gui_macvim")
macmenu &File.New\ Tab key=<nop>
map <D-t> <Plug>PeepOpen
end
unlet macvim_hig_shift_movement
"let g:solarized_termcolors=16
color solarized
set autoread
set expandtab
set wrap
if has("autocmd")
autocmd User Rails set tabstop=2 softtabstop=2 shiftwidth=2 expandtab
endif
let mapleader = ","
"update the system settings from my vimrc file
map <Leader>u :source ~/.vimrc
"copy/paste
map <Leader>c :w! ~/.vim_cpy_pst<cr>
map <Leader>v :r ~/.vim_cpy_pst<cr>
map <Leader>h :nohlsearch<cr>
map <Leader># :s/^/#/<cr>:nohlsearch<cr>
map <Leader>n :NERDTreeToggle<CR>
" Spit out rspec args to file
" Thanks to Sam Goldstein (http://drasticcode.com/2009/8/27/how-to-run-rspec-specs-from-vim)
" Thanks to Ian Smith-Heisters
function! SpecArgs(args)
if exists("b:rails_root")
let fname = b:rails_root . "/.spec_args"
else
let fname = "~/.spec_args"
end
let current = expand("%")
let spec_args = [" " . current . " -cfn " . a:args]
call writefile(spec_args, fname)
endfunction
" Mappings
" run one rspec example or describe block based on cursor position
map <Leader>s :call SpecArgs("-l " . <C-r>=line('.')<CR>)<cr>
au BufRead,BufNewFile Vagrantfile set expandtab
au BufRead,BufNewFile .rvmrc set ft=sh
au BufRead,BufNewFile *.god set ft=ruby
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment