Skip to content

Instantly share code, notes, and snippets.

@reu
Created May 23, 2011 16:42
Show Gist options
  • Save reu/987020 to your computer and use it in GitHub Desktop.
Save reu/987020 to your computer and use it in GitHub Desktop.
source ~/.vim/vimrc
set wrap nowrap
if has("gui_running")
set columns=180
colorscheme railscasts2
if has("gui_mac") || has("gui_macvim")
set guifont=Menlo:h12
try
set transparency=0
catch
endtry
endif
else
colorscheme solarized
endif
" Tokamak support
autocmd BufNewFile,BufRead *.tokamak setf ruby
" Strip trailing whitespace
function! <SID>StripTrailingWhitespaces()
" Preparation: save last search, and cursor position.
let _s=@/
let l = line(".")
let c = col(".")
" Do the business:
%s/\s\+$//e
" Clean up: restore previous search history, and cursor position
let @/=_s
call cursor(l, c)
endfunction
autocmd BufWritePre * :call <SID>StripTrailingWhitespaces()
nmap <silent> <Leader>q <Plug>PeepOpen
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment