Dick Moores
By: a guest | Aug 23rd, 2008 | Syntax:
None | Size: 0.47 KB | Hits: 52 | Expires: Never
"From http://vim.wikia.com/wiki/Disable_F1_built-in_help_key
inoremap <F1> <Esc>
noremap <F1> :call SophHelp()<cr>
function! MapF1()
if buftype == "help"
exec 'quit'
else
exec 'help'
endif
endfunction
function! SophHelp()
if &buftype=="help" && match( strpart( getline("."), col(".")-1,1), "\\S")<0
bw
else
try
exec "help ".expand("<cWORD>")
catch /:E149:/
exec "help ".expand("<cword>")
endtry
endif
endfunc