set nocp bs=2 is ruler showcmd mouse=a dy+=lastline set nofsync noswapfile mps+=<:> set title " Install more-gconf-modules and set " GCONF_PATH=/usr/lib/more-gconv/ to get windows-1252 support on " Maemo "set fileencodings=ucs-bom,utf-8,windows-1252 " hey, diablo's iconv claims to know cp1252, but refuses to " convert *from* it set fileencodings=ucs-bom,utf-8,windows-1252 let &sbr = nr2char(8618) . ' ' " sadly the font doesn't have '↪' " how about ↳ ""let &sbr = "» " " useful commands map ,e :e ~/.vimrc map ,s :source ~/.vimrc map ,b :call BookMode() map ,B :call FBEditCurrentBook() map ,bb :set number showbreak= map ,, :w map ,. map ' ` " nokia n900 imap jj imap ,, cmap £ < cmap € > " make it so that if I accidentally press ^W or ^U in insert mode, " then u will undo just the ^W/^U, and not the whole insert inoremap u inoremap u function! FBEditCurrentBook() if filereadable('/home/user/.FBReader/config.changes') e ~/.FBReader/config.changes $ ?name="Book"\| /name="Book" endif normal 0f=;ll normal vi"y let @" = substitute(@", ''', "'", 'g') let @" = substitute(@", '&', "\\&", 'g') let @" = escape(@", ' \[]''') echo 'e ' . @" exec 'e ' . @" endfunction function! BookMode() syn clear PoorMansHtml PoorMansRtf source ~/.vim/book.vim endfunction " sometimes I ssh in map :w imap :w map :noh set pastetoggle= map imap vmap vmap " despite these, dblclick enters visual mode :( map <2-LeftMouse> map <3-LeftMouse> map <2-LeftDrag> map <3-LeftDrag> map [1;5D map! [1;5D map [1;5C map! [1;5C map [3;5~ map! [3;5~ map [1;5D h map [1;5C l " spelling errors map ,) ]s map ,n ]s map ,( [s map ,p [s map ,S :set invspell " nicer spelling highlight SpellBad cterm=underline ctermfg=red ctermbg=NONE highlight SpellCap cterm=underline ctermfg=blue ctermbg=NONE " fix colors hi htmlItalic cterm=NONE ctermfg=2 hi MatchParen ctermbg=NONE ctermfg=magenta hi SpecialKey ctermbg=NONE ctermfg=yellow hi NonText ctermbg=NONE ctermfg=brown " Remember last position in a file " see :help last-position-jump au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$") | exe "normal g'\"" | endif " html autocmd BufRead *.html,*.htm map -- s— autocmd BufRead *.html,*.htm map ,- s— autocmd BufRead *.html,*.htm map ," s" autocmd BufRead *.html,*.htm map ,2 s" " rtf autocmd BufRead *.rtf map -- s\emdash autocmd BufRead *.rtf map ,- s\emdash autocmd BufRead *.rtf map ,'( s\lquote autocmd BufRead *.rtf map ,') s\rquote autocmd BufRead *.rtf map ,"( s\ldblquote autocmd BufRead *.rtf map ,") s\rdblquote " txt autocmd BufRead *.txt map -- s— autocmd BufRead *.txt map ,- s— " help navigation autocmd FileType help map " syntax function! PoorMansHtml() syn match Tag /<[^>]\+>/ contains=@NoSpell hi Tag ctermfg=gray syn match Entity /&.\{-};/ contains=@NoSpell hi Entity ctermfg=darkgreen syn region Comment start=// hi Comment ctermfg=darkblue endf command! -bar PoorMansHtml :call PoorMansHtml() function! PoorMansRtf() syn match Directive /\\[a-zA-Z0-9]\+/ contains=@NoSpell syn match Directive /\\[^a-z]/ contains=@NoSpell hi Directive ctermfg=magenta endf command! -bar PoorMansRtf :call PoorMansRtf() if globpath(&rtp, "**/syntax.vim") != "" syn enable else " rtf syntax autocmd BufRead *.rtf PoorMansRtf " html syntax autocmd BufRead *.html,*.htm PoorMansHtml endif " Highlight group debugging {{{2 command! ShowHighlightGroup echo "hi<" . synIDattr(synID(line("."),col("."),1),"name") . '> trans<' . synIDattr(synID(line("."),col("."),0),"name") . "> lo<" . synIDattr(synIDtrans(synID(line("."),col("."),1)),"name") . ">" map :ShowHighlightGroup