multicursor.nvim icon indicating copy to clipboard operation
multicursor.nvim copied to clipboard

insert mode action

Open jake-stewart opened this issue 1 year ago • 4 comments

mentioned in #46

a way to perform complicated action in insert mode & update the cursors

jake-stewart avatar Oct 01 '24 14:10 jake-stewart

I feel the missing part is left/right movement in insert mode, which is not recorded in dot register (imo a flaw in nvim itself).

xzbdmw avatar Feb 05 '25 13:02 xzbdmw

I feel the missing part is left/right movement in insert mode, which is not recorded in dot register (imo a flaw in nvim itself).

You can fix this by remapping left/right movement keys to avoid making a new undo sequence (this is what <C-g>U does):

inoremap <Left>  <C-g>U<Left>
inoremap <Right> <C-g>U<Right>

https://github.com/bew/dotfiles/blob/42c33af7bc8ac31e64704549b59475aac37598b0/nvim-wip/lua/mycfg/mappings.lua#L410-L415

bew avatar Feb 05 '25 13:02 bew

Wow, this works, thanks! (vertical movement still not work, but that's very uncommon)

xzbdmw avatar Feb 05 '25 13:02 xzbdmw

I feel the missing part is left/right movement in insert mode, which is not recorded in dot register (imo a flaw in nvim itself).

You can fix this by remapping left/right movement keys to avoid making a new undo sequence (this is what <C-g>U does):

inoremap <Left> <C-g>U<Left> inoremap <Right> <C-g>U<Right> https://github.com/bew/dotfiles/blob/42c33af7bc8ac31e64704549b59475aac37598b0/nvim-wip/lua/mycfg/mappings.lua#L410-L415

@xzbdmw @bew

Thanks for this bew.

I've made this a default mapping. It is only mapped if nothing is already mapped to <left>... or <right>... in insert mode.

jake-stewart avatar Feb 09 '25 02:02 jake-stewart

im busy or lazy

jake-stewart avatar Dec 09 '25 13:12 jake-stewart