Public Beta Open For “Ultimate N00b SLIME/Emacs Cheat Sheet”

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

 

Comments

  1. 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.

  2. 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?

  3. 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. ;)

  4. 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

  5. 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 (-:)

  6. 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 (-:)

  7. 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.

  8. 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”

  9. 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!

  10. 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.

  11. Pedro Kroger says

    Very nice! I suggest you include the navigation commands for sexps and things like transpose-sexp.

  12. 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.

  13. 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?

  14. 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!

  15. 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.

Trackbacks

  1. [...] Emacs NOTE #2: Emacs has lots (and lots and lots) of keyboard shortcuts, many more than there are letters in the alphabet. Many of them require multiple keys or a sequence of keys called a “chord”. The two modifier keys used are Control and Alt (also called Meta). The common way to write chords is to use C- and M- for Control and Meta, so to run the command to close Emacs, you hold down Control and X, then let go, then hold down Control and C. This is written as C-x C-c. Sometimes a chord is followed by another letter or the name of a command. For instance, to undo, you hold Control and x, then let go and hit u. This is written as C-x u. Dashes mean press at the same time, space means let go. Easy! I made a cheat sheet for common commands in Emacs and SLIME. [...]

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>