syntax on colorscheme elflord set background=dark set incsearch set title set showcmd " Show (partial) command in status line. set showmatch " Show matching brackets. set smartcase " Do smart case matching set autowrite " Automatically save before stuff like :next and :make set scrolloff=3 " Scrolling with shift-arrow map map imap imap " Delete word "map d/\s " Tip #80: Restore cursor to file position in previous editing session set viminfo='10,\"100,:20,%,n~/.viminfo if has("autocmd") au BufReadPost * if line("'\"") > 0|if line("'\"") <= line("$") \| exe("norm '\"")|else|exe "norm $" | endif endif " indenting if has("autocmd") filetype indent on endif " don't mess my XTerm title (useless) let &titleold="uxterm" " Show and trim spaces function ShowSpaces( ...) let @/="\\v(\\s+$)|( +\\ze\\t)" let oldhlsearch=&hlsearch if !a:0 let &hlsearch=!&hlsearch else let &hlsearch=a:1 end return oldhlsearch endfunction "function TrimSpaces() range " let oldhlsearch=ShowSpaces( 1) " execute a:firstline.",".a:lastline."substitute ///gec" " let &hlsearch=oldhlsearch "endfunction command -bar -nargs=? ShowSpaces call ShowSpaces() command -bar -nargs=0 -range=% TrimSpaces ,call TrimSpaces() nnoremap :ShowSpaces 0 nnoremap :ShowSpaces 1 "nnoremap m`:TrimSpaces`` "vnoremap :TrimSpaces map :w:make:cw