diff options
author | Evgeni Chasnovski <evgeni.chasnovski@gmail.com> | 2025-01-15 12:36:00 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-01-15 02:36:00 -0800 |
commit | 09bcb310681e3b87d5b8c5eb547b182554cff7b4 (patch) | |
tree | fc239f2d658f5d2620e0b99c37fa90ad371959e2 /runtime/ftplugin/help.lua | |
parent | 9552fe7ef907c5c8164abb50699e97d03de1285a (diff) | |
download | rneovim-09bcb310681e3b87d5b8c5eb547b182554cff7b4.tar.gz rneovim-09bcb310681e3b87d5b8c5eb547b182554cff7b4.tar.bz2 rneovim-09bcb310681e3b87d5b8c5eb547b182554cff7b4.zip |
fix(docs): replace `yxx` mappings with `g==` #31947
Problem:
`yx` uses "y" prefix, which shadows a builtin operator.
Solution:
Use `g=` (in the form of `g==` currently), drawing from precedent of
CTRL-= and 'tpope/vim-scriptease'.
Diffstat (limited to 'runtime/ftplugin/help.lua')
-rw-r--r-- | runtime/ftplugin/help.lua | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/runtime/ftplugin/help.lua b/runtime/ftplugin/help.lua index ed8f93c71c..479e4d8b9f 100644 --- a/runtime/ftplugin/help.lua +++ b/runtime/ftplugin/help.lua @@ -57,7 +57,7 @@ for _, match, metadata in query:iter_matches(tree:root(), 0, 0, -1) do if name == 'code' then vim.api.nvim_buf_set_extmark(0, run_message_ns, start, 0, { - virt_text = { { 'Run with `yxx`', 'LspCodeLens' } }, + virt_text = { { 'Run with `g==`', 'LspCodeLens' } }, }) local code = vim.treesitter.get_node_text(node, 0) local lang_node = match[metadata[id].lang][1] --[[@as TSNode]] @@ -69,7 +69,7 @@ for _, match, metadata in query:iter_matches(tree:root(), 0, 0, -1) do end end -vim.keymap.set('n', 'yxx', function() +vim.keymap.set('n', 'g==', function() local pos = vim.api.nvim_win_get_cursor(0)[1] local code_block = code_blocks[pos] if not code_block then @@ -82,5 +82,5 @@ vim.keymap.set('n', 'yxx', function() end, { buffer = true }) vim.b.undo_ftplugin = (vim.b.undo_ftplugin or '') - .. '\n exe "nunmap <buffer> gO" | exe "nunmap <buffer> yxx"' + .. '\n exe "nunmap <buffer> gO" | exe "nunmap <buffer> g=="' vim.b.undo_ftplugin = vim.b.undo_ftplugin .. ' | call v:lua.vim.treesitter.stop()' |