mirror of
https://github.com/neovim/neovim.git
synced 2026-04-20 14:25:32 +00:00
feat(help): super K (":help!") guesses tag at cursor #36205
Problem:
`K` in help files may fail in some noisy text. Example:
(`fun(config: vim.lsp.ClientConfig): boolean`)
^cursor
Solution:
- `:help!` (bang, no args) activates DWIM behavior: tries `<cWORD>`,
then trims punctuation until a valid tag is found.
- Set `keywordprg=:help!` by default.
- Does not affect `CTRL-]`, that is still fully "tags" based.
This commit is contained in:
21
runtime/lua/vim/_meta/options.lua
generated
21
runtime/lua/vim/_meta/options.lua
generated
@@ -3834,20 +3834,27 @@ vim.go.keymodel = vim.o.keymodel
|
||||
vim.go.km = vim.go.keymodel
|
||||
|
||||
--- Program to use for the `K` command. Environment variables are
|
||||
--- expanded `:set_env`. ":help" may be used to access the Vim internal
|
||||
--- help. (Note that previously setting the global option to the empty
|
||||
--- value did this, which is now deprecated.)
|
||||
--- When the first character is ":", the command is invoked as a Vim
|
||||
--- Ex command prefixed with [count].
|
||||
--- When "man" or "man -s" is used, Vim will automatically translate
|
||||
--- a [count] for the "K" command to a section number.
|
||||
--- expanded `:set_env`.
|
||||
---
|
||||
--- Special cases:
|
||||
--- - ":help" opens the `word` at cursor using `:help`. (Note that
|
||||
--- previously setting the global option to the empty value did this,
|
||||
--- which is now deprecated.)
|
||||
--- - ":help!" performs `:help!` (DWIM) on the `WORD` at cursor.
|
||||
--- - If the value starts with ":", it is invoked as an Ex command
|
||||
--- prefixed with [count].
|
||||
--- - If "man" or "man -s", [count] is the manpage section number.
|
||||
---
|
||||
--- See `option-backslash` about including spaces and backslashes.
|
||||
---
|
||||
--- Example:
|
||||
---
|
||||
--- ```vim
|
||||
--- set keywordprg=:help!
|
||||
--- set keywordprg=man\ -s
|
||||
--- set keywordprg=:Man
|
||||
--- ```
|
||||
---
|
||||
--- This option cannot be set from a `modeline` or in the `sandbox`, for
|
||||
--- security reasons.
|
||||
---
|
||||
|
||||
Reference in New Issue
Block a user