diff options
| author | Justin M. Keyes <justinkz@gmail.com> | 2026-09-24 13:59:23 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-09-24 13:59:23 -0400 |
| commit | db4ce62fccaf59de6ceb0268e638244d7e2f9821 (patch) | |
| tree | 3488e82e0f7c9f1d720552deee8ece0a20186220 /runtime/lua/vim/provider/python.lua | |
| parent | 7c194c9ef986ef4a3e4ab52aadba507f2c3d0126 (diff) | |
| download | rneovim-db4ce62fccaf59de6ceb0268e638244d7e2f9821.tar.gz rneovim-db4ce62fccaf59de6ceb0268e638244d7e2f9821.tar.bz2 rneovim-db4ce62fccaf59de6ceb0268e638244d7e2f9821.zip | |
feat(multicursor): gQ restores primary-cursor position #42071
Problem:
Unlike "gv", "gQ" does not restore the primary-cursor position. This is
inconvenient for workflows where you temporarily clear the cursors,
navigate somewhere, then want to return to the multicursor session.
Solution:
Store the primary-cursor position at extmark-id 1 of the
`'nvim.multicursor.last'` namespace.
Note: users that *don't* want to restore the primary-cursor position can
delete extmark-id 1 from the `'nvim.multicursor.last'` namespace just
before `gQ`. (Intentionally undocumented because this interface is not
final, and should not block Nvim 0.13 release.)
vim.keymap.set('n', 'gQ', function()
local ns = vim.api.nvim_create_namespace('nvim.multicursor.last')
pcall(vim.api.nvim_buf_del_extmark, 0, ns, 1)
return 'gQ'
end, { expr = true })
Diffstat (limited to 'runtime/lua/vim/provider/python.lua')
0 files changed, 0 insertions, 0 deletions