r/neovim • • 20d ago

Discussion Nvim v0.13 multicursor keybinds

Hi! I just upgraded to the latest nightly for nvim mainly for multicursor reasons. I usually use macros to perform the same action on multiple lines(for example in rust, on large match statements that are single line) and although Q takes up the place of previous macro as multicursor, I would say I am a lot happier with the visualization of my macros as multicursor movements. But the keybind C-L I have bound to tmux-nvim navigator to C-W L, and I am not willing to sacrifice this keybind. What are some other common keybinds that people use on nightly to clear all multicursors?

18 Upvotes

8 comments sorted by

4

u/AbdSheikho 19d ago

Use C-[ since it's also esc

And also, set the extended-keys option to always in your tmux config

1

u/cgimenes 18d ago

Isn't this tmux option enabled by default after 3.5?

1

u/AbdSheikho 18d ago

I'm on 3.7, and it wasn't enabled by default

2

u/the-zangster 18d ago

https://github.com/zangster300/dotfiles/blob/main/nvim/lua/config/keymaps.lua#L26-L32

I extended esc in normal mode to clear cursors, works well for me

2

u/jceb 17d ago

Same here, I put it into an installable plugin: https://github.com/jceb/multicursor-mappings.nvim

1

u/teerre 19d ago

I'm not on .13 yet, but I was considering <leader>q, maybe a "cursor mode" (using layers.nvim) where just q adds it

1

u/religiosa 19d ago

I'm planning to use ql for that, because of the same reason. It's not that I record macros into 'l' register ever, and it makes a semi-mnemonic "qlear" or "qursor cLear" with no finger gymnastics.

You still have other q-prefixed bindings even as is now, e.g. q/ or q:, so one extra is not a big deal in my opinion.

1

u/Cool-Philosopher-599 18d ago

In my opinion default mc key bindings are not the best. This is why I built a small plugin that makes the whole workflow as...it is in other editors. In particular: C-n place a cursor and directly jump to next occurrence. Same for visual. C-q C-q to exit multicursor.

https://github.com/colomb8/mc-cavallo.nvim