Skip to content

Commit

Permalink
add new EOL WS fix per voyeg3r fixes #1
Browse files Browse the repository at this point in the history
  • Loading branch information
mitechie committed Nov 17, 2010
1 parent e58e26a commit 45e96b8
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions .vimrc
Expand Up @@ -98,7 +98,7 @@ filetype plugin indent on " enable loading indent file for filetype

" In GVIM
if has("gui_running")
set guifont=Liberation\ Mono\ 8" use this font
set guifont=Cousine\ 8" use this font
set lines=75 " height = 50 lines
set columns=180 " width = 100 columns
set background=dark " adapt colors for background
Expand Down Expand Up @@ -304,8 +304,17 @@ set smartcase " if searching and search contains upper case, make case
nmap <silent> <C-N> :silent noh<CR>
" Clean all end of line extra whitespace with ,S
:nnoremap <silent><leader>S :let _s=@/<Bar>:%s/\s\+$//e<Bar>:let @/=_s<Bar>:nohl<CR>
" Credit: voyeg3r https://github.com/mitechie/pyvim/issues/#issue/1
" deletes excess space but maintains the list of jumps unchanged
" for more details see: h keepjumps
fun! CleanExtraSpaces()
let save_cursor = getpos(".")
let old_query = getreg('/')
:%s/\s\+$//e
call setpos('.', save_cursor)
call setreg('/', old_query)
endfun
map <silent><leader>S <esc>:keepjumps call CleanExtraSpaces()<cr>
" ==================================================
" Completion
Expand Down

0 comments on commit 45e96b8

Please sign in to comment.