Created
May 23, 2011 16:42
-
-
Save reu/987020 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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