Created
June 21, 2013 19:07
-
-
Save JSkally/5833549 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
execute pathogen#infect() | |
:set expandtab | |
:set tabstop=2 | |
:set shiftwidth=2 | |
:set autoindent | |
:set smartindent | |
:set ruler | |
:set mouse=a | |
:set number | |
:set numberwidth=3 | |
filetype plugin indent on | |
highlight ExtraWhitespace ctermbg=darkred guibg=#382424 | |
autocmd ColorScheme * highlight ExtraWhitespace ctermbg=red guibg=red | |
autocmd BufWinEnter * match ExtraWhitespace /\s\+$/ | |
" the above flashes annoyingly while typing, be calmer in insert mode | |
autocmd InsertLeave * match ExtraWhitespace /\s\+$/ | |
autocmd InsertEnter * match ExtraWhitespace /\s\+\%#\@<!$/ | |
function! s:FixWhitespace(line1,line2) | |
let l:save_cursor = getpos(".") | |
silent! execute ':' . a:line1 . ',' . a:line2 . 's/\s\+$//' | |
call setpos('.', l:save_cursor) | |
endfunction | |
" Run :FixWhitespace to remove end of line white space. | |
command! -range=% FixWhitespace call <SID>FixWhitespace(<line1>,<line2>) | |
set modeline | |
set ls=2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment