Skip to content

Instantly share code, notes, and snippets.

@dahu
Created June 1, 2012 14:15
Show Gist options
  • Save dahu/2852448 to your computer and use it in GitHub Desktop.
Save dahu/2852448 to your computer and use it in GitHub Desktop.
ExpandHelpWord()
" Help terms can include characters typically not considered within keywords.
function! ExpandHelpWord()
let iskeyword = &iskeyword
set iskeyword=!-~,^),^*,^\|,^",192-255
let word = expand('<cword>')
let &iskeyword = iskeyword
return word
endfunction
" F1 to show context sensitive help for keyword under cursor
" Deliberately left off the terminating <cr> to allow modification.
" Moves the cursor to the beginning of the term for contextual markup.
" (:help help-context)
nnoremap <F1> :help <c-r>=ExpandHelpWord()<cr><c-left>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment