Skip to content

Instantly share code, notes, and snippets.

@brian-lc
Created May 9, 2011 17:02
Show Gist options
  • Save brian-lc/962886 to your computer and use it in GitHub Desktop.
Save brian-lc/962886 to your computer and use it in GitHub Desktop.
my .vimrc
set nocompatible
set backspace=indent,eol,start
set directory^=$HOME/.vim_swap// "put all swap files together in one place
" Switch syntax highlighting on, when the terminal has colors
" Also switch on highlighting the last used search pattern.
if &t_Co > 2 || has("gui_running")
syntax on
set hlsearch
endif
set ts=2
set sw=2
set ai
set si
set et
set number
set nowrap
filetype plugin indent on
syntax enable
colorscheme solarized
if has("gui_running")
if has("gui_gtk2")
set guifont=Inconsolata\ 12
elseif has("gui_macvim")
set guifont=Inconsolata:h14
elseif has("gui_win32")
set guifont=Inconsolata:h14
end
"set guifont=Menlo:h13
set anti
let do_syntax_sel_menu = 1|runtime!synmenu.vim
set background=light
aunmenu &Syntax.&Show\ filetypes\ in\ menu
else
let g:solarized_contrast = "high"
set background=light
endif
set incsearch
set foldmethod=syntax
set foldlevel=6
set cursorline
command! GR !git reset HEAD %
command! GA !git add %
command! GC !git checkout %
command! GS !git status
au BufNewFile,BufRead *.j setf objj
au BufNewFile,BufRead *.as setf actionscript
let g:mxml_syntax_folding = 1
"" Execute open rspec buffer
"" Thanks to Ian Smith-Heisters
"function! RunSpec(args)
" if exists("b:rails_root") && filereadable(b:rails_root . "/script/spec")
" let spec = b:rails_root . "/script/spec"
" else
" let spec = "spec"
" end
" let cmd = ":! " . spec . " % -cfn " . a:args
" execute cmd
"endfunction
"
"" Mappings
"" run one rspec example or describe block based on cursor
"" position
"map !s :call RunSpec("-l " . <C-r>=line('.')<CR>)
"" run full rspec file
"map !S :call RunSpec("")
"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment