A Space Menu for Lem
SPC
This can be added to your ~/.lem/init.lisp
to add a space menu to lem. It's similar in spirit to the space menu from Spacemacs. It is much smaller, but it can be used as a starting point for your own space menu.
Keybindings
Key | Menu |
---|---|
b | buffer |
f | file |
g | git |
h | help |
j | jump |
p | project |
t | toggle |
w | window |
Key | Binding |
---|---|
SPC b b |
select-buffer |
SPC b d |
kill-buffer |
SPC b n |
next-buffer |
SPC b p |
previous-buffer |
SPC b r |
revert-buffer |
SPC f f |
find-file |
SPC f F |
find-file-recursively |
SPC f t |
filer |
SPC g s |
legit-status |
SPC h a |
apropos-all |
SPC h b |
describe-bindings |
SPC h f |
describe-symbol |
SPC h k |
describe-key |
SPC h m |
describe-mode |
SPC j i |
detective-all |
SPC p f |
project-find-file |
SPC p p |
project-switch |
SPC p g |
project-grep |
SPC p s |
project-save |
SPC p t |
filer |
SPC p u |
project-unsave |
SPC t f |
toggle-frame-fullscreen |
SPC t n |
toggle-line-numbers |
SPC t p |
toggle-show-parens |
SPC t s |
list-color-themes |
SPC t w |
toggle-line-wrap |
SPC w 0 |
delete-active-window |
SPC w 1 |
delete-other-windows |
SPC w h |
window-move-left |
SPC w j |
window-move-down |
SPC w k |
window-move-up |
SPC w l |
window-move-right |
SPC w n |
next-window |
SPC w p |
previous-window |
SPC w - |
split-active-window-vertically |
SPC w / |
split-active-window-horizontally |
SPC ' |
terminal |
SPC SPC |
M-x |
Other Keybindings
Frames Are Like Browser Tabs
It's a bit unfortunate that Emacs uses the word "window" to mean "pane", and "frame" to mean "window" in contemporary parlance. Lem seemed to use the words "window" and "frame" the same way Emacs did at first. However, upon closer inspection, frames in Lem are more like tabs than independent windows.
In light of this, here are some bindings that make use of your pre-existing muscle memory from tab management in web browsers. Ctrl-Shift-N
will create a new frame which is kind of like a tab in Lem, and Ctrl-PgUp
and Ctrl-PgDn
will move between frames. This should feel familiar. (I sometimes think I should put it on Ctrl-Shift-T
, but N
feels better to my hands.)
Note that this is only useful for the sdl2 version of Lem. If you're running the ncurses Lem in a terminal, these keybindings are probably already taken by the terminal itself.
Pasting
I often Shift-Insert to paste particularly while using Emacs. This lets me continue to lean on that muscle memory while using Lem. Although I use vi-paste-after
, it works as expected in emacs-mode too.
Outside of Emacs, I often use Ctrl-Shift-V
to paste too. I'm going to make them both available to me in Lem.
Again, these bindings are only useful in sdl2. In the terminal, these keys are probably already bound to the terminal itself, and Lem will never see them.
C-h Bindings Like Emacs
Coming from Emacs, I expected to find some bindings off of C-h
that would help me introspect Lem. By scanning through M-x
's completions, I saw that similar functions existed, but they weren't bound to anything as far as I could tell. If you were looking for some familiar keybindings off of C-h
like I was, try putting this in your ~/.lem/init.lisp
.
It's not exactly the same as Emacs, but it's close enough in spirit. I think this will help people coming from Emacs learn how to use Lem.
Common Lisp REPL History
In the REPL, it took me a while before I discovered that the keys for navigating the REPL history were on M-p
and M-n
. I prefer using arrow keys instead.
Links
- Lem :: https://github.com/lem-project/lem
- Lem GitHub Discussions :: https://github.com/lem-project/lem/discussions
- Documentation