/ˌpriːkɒɡˈnɪʃn/ 名词
- 对事件的预知,尤其是作为一种超感知觉的形式。
precognition.nvim 帮助发现在当前缓冲区中导航的动作(包括垂直和水平方向)
可以使用任何包管理器安装,以下是 Lazy 的示例:
return { "tris203/precognition.nvim", --event = "VeryLazy", opts = { -- startVisible = true, -- showBlankVirtLine = true, -- highlightColor = { link = "Comment" }, -- hints = { -- Caret = { text = "^", prio = 2 }, -- Dollar = { text = "$", prio = 1 }, -- MatchingPair = { text = "%", prio = 5 }, -- Zero = { text = "0", prio = 1 }, -- w = { text = "w", prio = 10 }, -- b = { text = "b", prio = 9 }, -- e = { text = "e", prio = 8 }, -- W = { text = "W", prio = 7 }, -- B = { text = "B", prio = 6 }, -- E = { text = "E", prio = 5 }, -- }, -- gutterHints = { -- G = { text = "G", prio = 10 }, -- gg = { text = "gg", prio = 9 }, -- PrevParagraph = { text = "{", prio = 8 }, -- NextParagraph = { text = "}", prio = 8 }, -- }, -- disabled_fts = { -- "startify", -- }, }, }
可以通过将 hints
的优先级设置为 0 来隐藏它们。如果你想隐藏整个虚拟行,请将所有元素设置为 prio = 0
,并 结合以下设置。
showBlankVirtLine = false
设置此选项意味着如果虚拟行为空白,则不会渲染。
可以通过将 gutterHints
的优先级设置为 0 来隐藏它们。
highlightColor
可以通过两种方式设置:
:highlight
以获取有效选项)。disabled_fts
可用于在特定文件类型上禁用 precognition
。
任何可能出现在相同位置的提示应该有唯一的优先级,以避免冲突。
precognition
可以通过 Precognition
用户命令以及 Lua API 以编程方式控制。
可以通过以下方式切换提示的显示和隐藏:
:Precognition toggle
或
require("precognition").toggle()
返回值指示可见状态,可用于生成通知。
if require("precognition").toggle() then vim.notify("precognition 已开启") else vim.notify("precognition 已关闭") end
子命令和函数 show
和 hide
也可用。
可以预览提示,这意味着提示将显示直到下一次光标移动。
:Precognition peek
或
require("precognition").peek()
此插件支持稳定版和每日构建版。撰写时支持 >0.9 版本。
贡献是让开源社区成为学习、激励和创造的绝佳场所的原因。我们非常感谢您做出的任何贡献。
如果您有改进插件的建议,请先开一个 issue,然后 fork 仓库并创建一个拉取请求。
如果您发现了 bug,请开一个 issue,如果可能的话,提交一个包含失败测试的拉取请求。
有关如何贡献的更多详细信息,请参阅 CONTRIBUTING.md。在创建拉取请求之前,请先阅读此文档。
别忘了给项目点个星!再次感谢!