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

Unable to get back to normal mode when using vim visual mode if I don't yank anything except with q #35

Open
moshpirit opened this issue Nov 21, 2024 · 5 comments

Comments

@moshpirit
Copy link

Sorry to open a new issue again, but this is a real one. For some reason, I can't escape to normal mode using the Escape key

Steps to reproduce:

  1. Git clone at ~/.config/kitty
  2. mv ~/.config/kitty/kitty_grab/grab.conf.example ~/.config/kitty/grab.conf
  3. echo "map f4 kitten kitty_grab/grab.py" >> ~/.config/kitty/kitty.conf
  4. Open a new kitty terminal and press F4
  5. write something down or move in the history to show previous commands
  6. press v to get into visual mode (move and/or select text if you want)
  7. press Escape to get out of visual mode.

You can't get out except if we yank some text or press q (which shouldn't because it is commented by default). [ doesn't work either.

Just to confirm, this is shown in the grab.conf file:

# map q      quit
…
map v                 set_mode visual
map Ctrl+v            set_mode block
map Ctrl+Left_Bracket set_mode normal
map Escape            set_mode normal
@yurikhan
Copy link
Owner

yurikhan commented Nov 21, 2024

Your step 2 is inconsistent with your grab.conf snippet: grab.conf.example is a config with all lines commented out, listing the default bindings. I think you meant grab-vim.conf.example.

In step 5 you mention writing something down but you cannot write while grabbing.

Step 7 works for me: it clears the selection and lets me move cursor without selecting. Pressing v or Ctrl+v lets me select again.

If you want to quit the grabber and give control to the shell or whatever application you’re running, you need to press the key bound to quit. By default, that’s q and Escape, but if you copied grab-vim.conf.example, Escape is redefined to set_mode normal. So you’re left with q.

If you want to quit the grabber with Escape, you can comment out the map Escape set_mode normal line. But then you’ll have to press Ctrl+[ to clear the selection, or define your own binding for set_mode normal.

@moshpirit
Copy link
Author

Hi! Thanks for replying!

Your step 2 is inconsistent with your grab.conf snippet: grab.conf.example is a config with all lines commented out, listing the default bindings. I think you meant grab-vim.conf.example.

Yes, that's right, I meant grab-vim.conf.example

In step 5 you mention writing something down but you cannot write while grabbing.

I meant writing something down to select later, just because, but not while grabbing, as you said.

If you want to quit the grabber and give control to the shell or whatever application you’re running, you need to press the key bound to quit. By default, that’s q and Escape, but if you copied grab-vim.conf.example, Escape is redefined to set_mode normal. So you’re left with q.

Oh! I see, thanks! Is there any way to make Escape do both: quitting and setting normal mode?

@yurikhan
Copy link
Owner

Is there any way to make Escape do both: quitting and setting normal mode?

How is that different from just quitting?

@moshpirit
Copy link
Author

How is that different from just quitting?

I don't know, I've just met this extension, but if none, then I guess I can get the behavior by just commenting the Escape mapping as you said above, right?

@yurikhan
Copy link
Owner

Try and see if it matches your expectations?

I don’t use vim bindings myself, for me Shift+arrows and Alt+arrows are more natural, so I don’t really know what vim users want.

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

No branches or pull requests

2 participants