" Motion nnoremap h nnoremap j nnoremap k nnoremap l "nnoremap G nnoremap OF G "nnoremap :0w nnoremap OH :0w " Vertical scrolling, cursor on same line, same column in one screen. nnoremap nnoremap " Horizontal scrolling, cursor in the same column. " A character scroll. nnoremap 9 z nnoremap 0 z " A half-screen scroll. nnoremap z nnoremap z " End point scroll. nnoremap 9 zs nnoremap 0 ze " Strip end white space nnoremap S :%s/\s\+$// nnoremap s :s/\s\+$// " Join w/o spaces to end of paragraph. nnoremap ;j }mp:'','pj! " Textwidths nnoremap 0 :set tw=0 nnoremap 7 :set tw=70 nnoremap 8 :set tw=80 " Remove the help key/F1 map  map!  "nmap :bp "nmap :bn nnoremap :bp nnoremap :bn " File/Buffer Edit/Save/Quit nnoremap Q :q! nnoremap Z :w! nnoremap  :redo " From http://greenokapi.net/svn/.vim/_vimrc which itself was picked from " http://pdx.pm.org/kwiki/index.cgi?VimRCFile map q: :q " Listchars & breaks "nnoremap l :set list sbr=\ \ \ \ \ \ \ \ "nnoremap n :set nolist sbr= nnoremap l :set list! list? " Line Wrap nnoremap :set list sbr=\ \ \ \ \ \ \ \ ai nnoremap :set nolist sbr= noai nnoremap :set wrap! wrap? imap a imap a imap a " Search - Clear nnoremap \ :let @/="" " Search - (Un)Highlight nnoremap h :set hlsearch! hls? " Search - Yank string matched nnoremap m :call YankMatched() " Search for match & move line in the middle. nmap n nzz "nmap ? ?zz " Add line breaks in after given strings/regex com! -nargs=+ -range -bar NewLine ,call SuffixNewLine() " Intentionally left incomplete to be completed as needed nnoremap ;nl :NewLine " Insert line breaks in before given strings/regex com! -nargs=+ -range -bar PreNewLine ,call PrefixNewLine() " Intentionally left incomplete to be completed as needed nnoremap ;pnl :PreNewLine " Completion - tag inoremap  nnoremap  a " Text - Wrap "nnoremap \ gwj "nnoremap = gwap nnoremap \ gqj nnoremap = gqap nnoremap E !}/usr/bin/fmt -c -68 " Paragraph - Delete/Yank nnoremap d dap nnoremap y yap " Clipboard - Paste/Yank to register 'p' nnoremap  "*p nnoremap  "*y'p " Miscellaneous Toggle nnoremap  :set number! nu? nnoremap e :set expandtab! et? " Create cloumn ruler "nnoremap R80 :1new Ruler 8i123456789.I:winc j " Show directory & filename. nnoremap ;f :echo expand( "%:p:~" ) nnoremap ;d :echo expand( "%:p:~:h" ) " Upcase first character after a comment nnoremap #U :%s!^\(#\+\s\+\)\([a-z]\)!\1\u\2! nnoremap #u :'p,.s!^\(#\+\s\+\)\([a-z]\)!\1\u\2! " MODIFIED: nnoremap ;mod aMODIFIED: :r!date +'\%b \%d \%Y'J " Tell time nnoremap tm :!date nnoremap tim :!date nnoremap dat :!date nnoremap cal :!cal " Calculator nnoremap grpn :!grpn& nnoremap dc :!dc " Spell check nnoremap ;sp :!echo \| aspell --sug-mode=normal --ignore-case -a -- nnoremap  :w!:!aspell --sug-mode=normal --dont-backup --ignore-case check %:e! % " Sort nnoremap p :'p,.!sort -bf -k1