this post was submitted on 07 Apr 2024
10 points (81.2% liked)

Emacs

2190 readers
1 users here now

Our infinitely powerful editor.

founded 4 years ago
MODERATORS
 

As a long time Vimmer, I have recently started using Emacs out of sheer curiosity. I chose Doom Emacs as it has evil-mode enabled by default, and do not want to dive down the rabbit hole of configuring the editor from scratch (at least, not yet!).

After installing and enabling libvterm in Emacs, I am having a frustrating experience. I configured ZSH shell to use vi-mode keybindings which interferes with evil-mode whenever I press Esc or C-[.

After having searched a little, I came across a workaround to disable evil-mode when in vterm. But it is still not a smooth experience. For instance, when switching between buffers (C-w C-w).

I would like to know how others in the community tackled this problem. Is there a better solution to this problem? Or have you made peace with the aforementioned workaround? Or have you stopped using vterm entirely?

you are viewing a single comment's thread
view the rest of the comments
[โ€“] cabhan@discuss.tchncs.de 1 points 7 months ago* (last edited 7 months ago) (1 children)

My basic approach is: Esc works like in normal evil-mode, and takes me into vterm-copy-mode as well. Without doing that, I have C-w C-w remapped to move to another window, so I can switch to another window for all the rest of my keybindings. And I have C-Esc mapped to send Esc into the terminal itself.

I'm using evil-collection for the basic bindings, and I have my own custom stuff here: https://github.com/bricka/emacs.d/blob/main/init.el#L1054-L1073

Edit: Forgot C-Esc

Thanks for the tip as well as your configuration.