[...] an online-help (maybe as "popup") that leverages gdb, seems quite useful.
For example to get more information about br
in a script we could get the output of gdb --batch -ex "help br"
and present it to the user.
Originally posted by @GitMensch in #10649 (comment)
:help
uses vim's good online help text file.
Shift-K currently tries to open a manpage which is quite useful for C/C++; as there isn't one for gdb or vim commands using that on a .gdb file leads to an error message.
(How) Can we change that mapping per file type and would it be reasonable to execute the command above in the case of gdb files to get the very good online help into a buffer, showing it in a popup window?
How to possibly do the same for vim files (or just remapping that to :help <expr>
?
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
I don't understand it. K
is using the &keywordprg
in vims ftplugin. So you can already use this for Vim script files. For gdb we don't have this, could be a nice side-project. But let's await the updated gdb runtime files first.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
That's something I explicit need to activate, no?
I suggest to override the default shift-k, which opens a manpage in a vim file on set
and others - or raise an error "no manpage".
Of course I'd like to suggest moving from the default shift-k to internally call the :Man plugin instead (after allowing the "word under cursor" there) and auto-loading the plugin when using that the first time and it is still missing.
And yes: enabling shift+k for gdb scripts with the command noted above would also be nice.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
no, if you use filetype plugin on
in your vimrc, than it should be set. I guess opening manpages from within vim scripts is probably rare.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
I guess opening manpages from within vim scripts is probably rare.
me, too; I'd say "more than rare" - therefore my suggestion to map that per default.
if you use
filetype plugin on
in your vimrc, than it should be set
Just tested with --cmd "filetype plugin on"
and now that vim help works with shift-k.
Would you be fine with a change to:
:Man <word>
for "anything not otherwise defined" (again in the filetype plugin)?—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
should be fine to set something up in GDBs filetype plugin. K
should already work for manpages, for anything more sophisticated we would need to call a function and parse somehow the expression and use the 'keywordprg' option. Sourcing ftplugin/man.vim
for the :Man
command, seems a bit too much however. This sounds more like something for your personal after/ftplugin/man.vim
script.
Note sure what you mean with if still not defined, as long this is setup up correctly in a filetype plugin and undone once the buffer is removed. However all of this must only be enabled when a user explicitly enables filetype plugins, nothing of such things should happen without it, that would be too unexpected.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
Note sure what you mean with if still not defined
I've meant if there was not filetype plugin taking over the command.
What about changing the default (non-filetype) shift+k to open the manpage in a split buffer (using MANPAGER="col -b" man word
) instead of the current behaviour (maybe with a "legacy" setting if someone really wants his window to be hidden while watching a non-highlighted manpage)?
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
That would be a backwards incompatible change. Sounds more like something for an optional plugin, but does not neccessarily belong to Vim core.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
We're already doing this sort of thing for several filetypes. E.g.,
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.