(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)
This gives Lem a Ctrl-Shift-Z that's similar to Emacs evil's Ctrl-Z which switches you back and forth between Emacs and Vi modes quickly. I didn't put it on C-z in Lem, because there's already something there. It's mostly bindings for frame management.