Permalink
Browse files

add navigation mappings for vim help files

  • Loading branch information...
1 parent 826bc43 commit ffc37564fc2ad364f8f5b0a3b8b7a7b38d19242c @gray committed Sep 15, 2012
Showing with 20 additions and 1 deletion.
  1. +20 −0 .vim/after/ftplugin/help.vim
  2. +0 −1 .vimrc
@@ -0,0 +1,20 @@
+setlocal wrap
+setlocal nonumber
+setlocal keywordprg=:help
+
+" Follow link
+nmap <buffer> <cr> <c-]>
+" Return from link
+nmap <buffer> <bs> <c-t>
+
+" Option links
+nmap <silent> <buffer> o /'\zs[a-z]\{2,\}\ze'<cr>zz
+nmap <silent> <buffer> O ?'\zs[a-z]\{2,\}\ze'<cr>zz
+
+" Subject links
+nmap <silent> <buffer> s /\|\zs\S\+\ze\|<cr>zz
+nmap <silent> <buffer> S ?\|\zs\S\+\ze\|<cr>zz
+
+" Keyword anchors
+nmap <silent> <buffer> a /\*\zs\S\+\*\ze$<cr>zz
+nmap <silent> <buffer> A ?\*\zs\S\+\*\ze$<cr>zz
View
1 .vimrc
@@ -563,7 +563,6 @@ if has('autocmd')
autocmd FileType bzr,cvs,gitcommit,hgcommit,svn
\ setlocal nowritebackup nolist spell spellcapcheck= wrap textwidth=74 |
\ if has('persistent_undo') | setlocal noundofile | endif |
- autocmd FileType help setlocal wrap nonumber keywordprg=:help
autocmd FileType html
\ setlocal equalprg=tidy\ -q\ -i\ --wrap\ 78\ --indent-spaces\ 4
autocmd FileType javascript setlocal equalprg=js_beautify.pl\ -

0 comments on commit ffc3756

Please sign in to comment.