better-escape.nvim icon indicating copy to clipboard operation
better-escape.nvim copied to clipboard

Not working in Command mode, Visual mode, Operator-pending mode

Open howardcochran opened this issue 2 years ago • 12 comments

I really love the idea of this plugin, but it only works for me in Insert mode. Is there a way to enable it for Command mode, Visual mode, and Operator-pending mode?

howardcochran avatar Jun 10 '23 15:06 howardcochran

this is because right now the plugin uses an autocommand which only works with insert mode I have an idea how I could rewrite the plugin to also make it much more powerful that would perhaps allow it to also be used in other modes I'd have to check though

Command mode might be much easier than the other ones because you can just delete the keys that were entered as the mapping the other two will be much harder so they might not be possible even with a rewrite

max397574 avatar Jul 17 '23 06:07 max397574

I'll close this for now because I won't do this in the near future

max397574 avatar Oct 25 '23 11:10 max397574

+1 for incorporating support for escaping various modes like visual. While better-escape efficiently handles the transition from insert mode, which is often used, I still find myself resorting to <C-c> to exit visual and other modes. This leaves the plugin somewhat incomplete, as I'm forced to utilize another escape method, resulting in the need for two distinct sets of key mappings.

levinotik avatar Feb 18 '24 04:02 levinotik

I actually plan to do something like this on the rewrite branch which you can find here I just did the insert mode mappings so far but also plan to create options for other modes

max397574 avatar Feb 18 '24 10:02 max397574

I actually plan to do something like this on the rewrite branch which you can find here I just did the insert mode mappings so far but also plan to create options for other modes

Awesome @max397574! Thanks for the great work. Let us know if/how we can help.

levinotik avatar Feb 18 '24 21:02 levinotik

Command mode might be much easier than the other ones because you can just delete the keys that were entered as the mapping

To make this easier you can use c_CTRL-U.

I just did the insert mode mappings so far but also plan to create options for other modes

Could vim.on_key be used as replacement for InsertCharPre instead of mappings?

Sam-programs avatar Feb 25 '24 18:02 Sam-programs

Hey could someone try https://github.com/max397574/better-escape.nvim/pull/59, and how is operator pending supposed to work?

Sam-programs avatar Mar 10 '24 22:03 Sam-programs

Hey could someone try #59, and how is operator pending supposed to work?

hello

i replaced max397574/better-escape.nvim with Sam-programs/better-escape.nvim in my lazy.nvim config

then i ran this to reinstall plugins:

gio trash ~/.local/share/nvim ~/.local/state/nvim ~/.cache/nvim

but this plugin still works only in insert mode, and still not works on visual and in command mode

am i doing something wrong?

gmankab avatar Mar 21 '24 19:03 gmankab

then i ran this to reinstall plugins:

gio trash ~/.local/share/nvim ~/.local/state/nvim ~/.cache/nvim

but this plugin still works only in insert mode, and still not works on visual and in command mode

am i doing something wrong?

I don't know how gio works, you should be fine removing just rm ~/.local/share/nvim/lazy/better-escape.nvim -rf and reopening neovim.

There was a logic error in my pr that made the plugin only work half the time but i doubt that's the issue here.

Sam-programs avatar Mar 21 '24 21:03 Sam-programs

I don't know how gio works

it moves dir to trash

gmankab avatar Mar 21 '24 21:03 gmankab

it moves dir to trash

Huh it should have worked correctly then, does it work when you remove the better-escape path with rm ~/.local/share/nvim/lazy/better-escape.nvim -rf ?

Sam-programs avatar Mar 21 '24 21:03 Sam-programs

does it work when you remove the better-escape path with rm ~/.local/share/nvim/lazy/better-escape.nvim -rf ?

no, same result, instert mode only

gmankab avatar Mar 22 '24 00:03 gmankab

Just a +1 from me for this feature as well. I just want to add the terminal as a mode where users currently have to use <Esc> instead of being able to use this plugin.

rwijtvliet avatar Jun 14 '24 13:06 rwijtvliet

@rwijtvliet there is an open pr for this which I plan to merge in the near future I have to finish some docs and make sure it doesn't break too much for current users

max397574 avatar Jun 14 '24 14:06 max397574