On this Valentine’s Day, give the gift people really want – complex key chords!
In other news, I’ve got fans!
Well, at least one anyway. A lot of the feedback I’ve received on this site so far has been from experienced Lispers who appreciate my enthusiasm and contributions for new users. Yesterday, I got the first (I think) comment and reply from another new Lisper who’s actually getting some use out of my stuff. Aaron Feng wrote up my SLIME movie reference, and he even caught my later reference to my upcoming “Ultimate N00b SLIME/Emacs Cheat Sheet”. Well Aaron, wait no more!
I’ve been using it for a week or so, and I’m sort of pleased with it. First the positives:
- It includes all of the SLIME commands from the SLIME manual
- It includes all of the Emacs commands from the built in tutorial
- It includes the main Emacs help keys
- The commands are sorted and grouped by functional area
- It’s all fits on one page
Here are some of the things I’m not so pleased with:
- It has very few Emacs commands, relative to what’s available
- It doesn’t include any advanced text manipulation options
- It doesn’t have the sexp-based manipulation commands. I couldn’t find standard bindings for these and I’m not up to Emacs tweaking yet. Adding a key for the slime-selector was enough for me at this point.
- It’s pretty crowded (~100 commands and descriptions on one page)
The Emacs section is weak mainly because I haven’t dived into Emacs the way I have into Lisp/SLIME. I figure for now I can use it as a standard, powerful IDE for writing, testing, and debugging Lisp, and I can add Emacs wizardry later. I think I hit the point of diminishing returns where focusing on my tools will help me learn to code in Lisp. Now I need to get my coding up to par with my tools! I need to improve to the point where it’s worth getting a copy of Learning GNU Emacs.
So without further ado, here is my unfinished yet eminently usable cheat sheet:
[NOTE: These links were broken for a while. They work now]
Ultimate N00b SLIME/Emacs Cheat Sheet (pdf)
or customize your own!
Ultimate N00b SLIME/Emacs Cheat Sheet (xls)
Enjoy! As usual, feedback is appreciated. If you’ve got an Emacs trick that you use a jillion times a day that you think a new user could use, this is a great way to share!
(PS I hope it goes without saying but there isn’t any kind of beta process. Just that I consider it a work in progress and that it will definitely change in the future, hopefully in response to useful criticism.)
Follow the discussion at: Hacker News, programming.reddit.com, comp.lang.lisp, comp.emacs
Abhijith says
Niiice! keep up the good work 🙂
Wayne says
Cool. Although you may want to pick a font in which a lower case L doesn’t look like an upper case I.
Peter says
Wayne – thanks for the observation – it’s just the Excel default. I’ll try to change this when I add all the other recommendations that come in. Any font recommendations?
blandest says
I keep changing between Monaco, Consolas and Bitstream Vera.
Greg says
Thanks Peter!
I found it on reddit, looked out of curiosity and found 5 or 6 things I didn’t already know on the sheet within 10 seconds so printed it out and it’s now on my desk.
I’m lucky in that I get to code Lisp most of the time and this will sure help my Slime/Emacs. 😉
PL Hayes says
Very useful, thanks 🙂 However, I think maybe it would be preferable to adapt/fill in one of the refcard templates in Emacs’s etc/refcards/*.tex
Andreas Fuchs says
Sweet! This is really great.
There’s one thing that I’m missing: RET in SLDB does a lot of things: invoke restarts, expand frames, inspect the condition, inspect objects (depending on where point is).
Also, I think it would bear mentioning that M-. and M-, stack (:
Thanks for doing this, I think I’ll it out and stick it everywhere I work (it’s worth it for C-c ~ alone (-:)
Andreas Fuchs says
Sweet! This is really great.
There’s one thing that I’m missing: RET in SLDB does a lot of things: invoke restarts, expand frames, inspect the condition, inspect objects (depending on where point is).
Also, I think it would bear mentioning that M-. and M-, stack (:
Thanks for doing this, I think I’ll print it out and stick it everywhere I work (it’s worth it for C-c ~ alone (-:)
novaburst says
Thank you, I think this will be very useful to me.
Brian says
That looks great. It’ll come in handy. Any chance of seeing an HTML-table or plaintext version?
noob says
Dude, you have to check out paredit next. It might be a bit quirky at first, but you’ll soon realise that’s how lisp was meant to be edited. Manipulating sexprs instead of text with a few basic operations that will always be just the ones you need.
Peter says
OK, here’s a summary of the things I’ll include in the next version. I’ll test them on my own for a couple weeks before I repost it. Why wait a couple weeks if people already recommended things? Because I still believe that an editor is valuable, and I want to make I can 1) use these new things to make sure they’re valuable, and 2) understand them enough to distill the essence into a simple 1-pager.
Font – something that distinguishes between I and l (possibly Monaco, Consolas and Bitstream Vera) and double check it.
Other formats – didn’t know the *nix format of choice so I was waiting for someone to tell me. Not sure how plaintext would work (either one column w/regular font or multiple w/fixed width font) but I’ll put that and an HTML version up next time.
Paredit – recommended twice. Will investigate.
A few more commands regarding indenting, etc.
Refcard templates – never heard of them. I’ll take a look, thanks for the reference, PL Hayes.
Responses:
RET: didn’t include it because the docs said it “mostly does what you think it does” and I agreed.
M-. and M-, are on there under “Exploring”
PL Hayes says
They’re just the TeX sources of the Emacs refcards (surely no Emacs user doesn’t have some of them pinned up somewhere?). TeX is the format of choice for technical documents – at least in the “hard” sciences – *nix or not:
http://en.wikipedia.org/wiki/TeX#Use_of_TeX
which is why the (other) Emacs refcards are made with it!
slime-user says
Just FYI, the SLIME ‘doc’ sub-directory contains .tex files that are the sources for generating PDF files for the SLIME manual and a reference card. Running ‘make’ in the directory will cause it to generate the .pdf files along with HTML files and the slime.info file. It requires a number of standard TeX tools to do this. Most GNU or Unix distributions include these toolsets.
Also, the Emacs distribution includes .tex files for generating a number of reference cards, including ones for general Emacs editing, Calc, Org, Gnus, Vip/Viper, and Dired modes.
Pedro Kroger says
Very nice! I suggest you include the navigation commands for sexps and things like transpose-sexp.
Paddy Mullen says
Here is what I don’t get. I know how to save a file. I know how to save the contents of the repl buffer. I don’t know how to save just the commands I ran through the repl buffer.
How do I execute a single line that I am writing in another buffer?
I have looked over the documentation, and I’m sure it says how to do this, but probably with words that I can’t quite understand.
Peter says
Paddy,
Here are two commands I’ve found useful.
eval-buffer: M-x eval-buffer RET
eval-last-sexp: C-x C-e
These work in Emacs Lisp (not sure about SLIME) and are crucial for tweaking Emacs behavior in the .emacs file.
I’m not sure how to save the contents of the REPL.
Anyone know?
AJ says
Nice work man, thanks a bunch.
Helps me a lot!!!
Ebot says
Thanks.
Hugh S. Myers says
Along with the other improvements, you might want to correct C-c C-t which you have as clear entire buffer. It won’t; it is bound to slime-toggle-trace-fdefinition. What you want is C-c M-o which is bound to slime-repl-clear-buffer. Other than that, lots of gold in this hoard!
Adam says
I think it should be on there that if you type a comma at the slime prompt and then type “cd”, you can change the lisp process’s current working directory, which sometimes matters for scripting-y tasks.
Some install packages have scripts that require you to start lisp in a certain directory.