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

a way to automatically re-enter symex mode from insert mode. #24

Closed
tommy-mor opened this issue Apr 7, 2021 · 3 comments
Closed

a way to automatically re-enter symex mode from insert mode. #24

tommy-mor opened this issue Apr 7, 2021 · 3 comments

Comments

@tommy-mor
Copy link
Collaborator

Is there a setting I can put that binds escape in insert mode to go back to symex mode? It is annoying to have to press M-; so much.

Right now
symex ---i---> insert mode ---esc---> normal mode ---M-;--> symex mode
I want
symex ---i---> insert mode ---esc---> symex mode

@tommy-mor tommy-mor reopened this Apr 7, 2021
@tommy-mor
Copy link
Collaborator Author

would this require rigpa? I guess what I want is my stack of layers to be this

normal mode
symex mode
insert mode

moving up the stack by pressing escape.

right now, I feel like symex is above normal

@tommy-mor
Copy link
Collaborator Author

tommy-mor commented Apr 7, 2021

I figured out how to do this.

(evil-define-key 'normal symex-mode-map
  (kbd "<escape>") 'symex-mode-interface)

(evil-define-key 'insert symex-mode-map
  (kbd "<escape>") 'symex-mode-interface)

Now whenever I am normal mode, I can toggle between normal mode and symex mode by pressing escape
So my tower of layers is more like

symex mode     <--esc-->      normal mode
|        ^            
i       esc                    
v        |                
insert mode

@countvajhula
Copy link
Collaborator

@tommy-mor Didn't get notified about this issue but that looks like a great way to do it!

You could also use rigpa for this, which gives you the flexibility to modify the behavior on the fly or even temporarily switch to a Vim-only tower (e.g. useful for editing comments, writing docstrings) so that you don't need to always have symex in the picture. But on the other hand, at the moment rigpa only supports towers as a way to structure the modes so you couldn't get exactly the behavior you have there. In the future the plan is to support other topologies, like rings or towers-of-rings, or directionally-variant structures like the one you've defined. And it would be recency aware so that you could alternate between the most recent modes. Can't say exactly when that will be implemented though, hopefully in the not-too-distant future.

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