Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
howardcochran opened this issue Jun 10, 2023 · 14 comments · Fixed by #59
Closed

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

howardcochran opened this issue Jun 10, 2023 · 14 comments · Fixed by #59

Comments

@howardcochran
Copy link

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?

@max397574
Copy link
Owner

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
Copy link
Owner

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

@max397574 max397574 closed this as not planned Won't fix, can't repro, duplicate, stale Oct 25, 2023
@levinotik
Copy link

+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.

@max397574
Copy link
Owner

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 max397574 reopened this Feb 18, 2024
@levinotik
Copy link

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.

@Sam-programs
Copy link
Contributor

Sam-programs commented Feb 25, 2024

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
Copy link
Contributor

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

@gmankab
Copy link

gmankab commented Mar 21, 2024

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?

@Sam-programs
Copy link
Contributor

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.

@gmankab
Copy link

gmankab commented Mar 21, 2024

I don't know how gio works

it moves dir to trash

@Sam-programs
Copy link
Contributor

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 ?

@gmankab
Copy link

gmankab commented Mar 22, 2024

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

@rwijtvliet
Copy link

rwijtvliet commented Jun 14, 2024

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.

@max397574
Copy link
Owner

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants