-
In code, how can I query Lem to see if it's in vi-mode or not? |
Beta Was this translation helpful? Give feedback.
Answered by
cxxxr
Sep 16, 2024
Replies: 2 comments
-
You can use |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
g-gundam
-
Switch Between Emacs and Vi Modes QuicklyHere's something similar in the spirit to evil's C-z which toggles evil's emacs state. I put it on Ctrl-Shift-Z in Lem, because Ctrl-z was already taken by a bunch of frame commands. It's useful in situations where something doesn't work well in vi-mode, and you need to quickly switch to emacs-mode. (in-package :lem-user)
(import 'lem:define-command)
(define-command toggle-between-emacs-and-vi () ()
(let ((mode (lem:current-global-mode)))
(if (typep mode 'lem-vi-mode/core:vi-mode)
(lem-core::emacs-mode)
(lem-vi-mode/core:vi-mode))))
(define-key *global-keymap* "C-Z" 'toggle-between-emacs-and-vi) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can use
(lem:current-global-mode)