Ken Takata wrote:
> There are many hyper text viewers that can jump to a link with Enter key.
> E.g.: GNU info, lynx, w3m and many Web browser, etc.
> However, the Vim help cannot jump with Enter key.
> The following patch enables tag jump with Enter key on Vim help:
>
> --- a/runtime/ftplugin/help.vim
> +++ b/runtime/ftplugin/help.vim
> @@ -12,11 +12,18 @@ let s:cpo_save = &cpo
> set cpo&vim
>
> let b:undo_ftplugin = "setl fo< tw< cole< cocu< keywordprg<"
> + \ . "| silent! nunmap <buffer> <Enter>"
>
> setlocal formatoptions+=tcroql textwidth=78 keywordprg=:help
> if has("conceal")
> setlocal cole=2 cocu=nc
> endif
>
> +if !exists("no_plugin_maps") && !exists("no_help_maps")
> + if &buftype ==# 'help'
> + nnoremap <silent><buffer> <Enter> <C-]>
> + endif
> +endif
> +
> let &cpo = s:cpo_save
> unlet s:cpo_save
>
>
> I think this is mostly useful for newbies, but this might deprive them of a
> chance of knowing Ctrl-].
> What do you think, is this useful or doing too much and just meddling?
Hmm, I'm not sure.
Obviously, typing Enter is a lot simpler than CTRL-]. Not even sure how
that works on various keyboards. But it is the standard "jump to a tag"
key, also when editing code.
On the other hand, I do see some users press enter to go down a line.
Yes, you should use "j" for that, but once using Enter is a habit, it's
hard to unlearn.
Using "K" is also easy to type, but it's not obvious.
--
I have a watch cat! Just break in and she'll watch.
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.