Skip to content

Instantly share code, notes, and snippets.

@anyakichi
Created May 7, 2011 08:51
Show Gist options
  • Save anyakichi/960334 to your computer and use it in GitHub Desktop.
Save anyakichi/960334 to your computer and use it in GitHub Desktop.
Search vim help with K.
let g:ref_no_default_key_mappings = 1
nnoremap <silent> K :<C-u>call Ref('normal')<CR>
vnoremap <silent> K :<C-u>call Ref('visual')<CR>
function! Ref(mode)
if &filetype ==# 'vim'
execute 'silent! help ' . expand("<cword>")
"execute 'help index| tj /' . expand("<cword>")
if &filetype !=# 'help'
echo 'No entry'
endif
else
call ref#K(a:mode)
endif
endfunction
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment