Hacker News new | past | comments | ask | show | jobs | submit login

SLIME + Emacs user here. I always wondered if there is something similar to SLIME for Clojure, because soon I'll try Clojure as well, despite knowing the tortures of having to deal with the Java platform. Slime is awesome, however...

I can feel your pain, because that's what i thought when I first tried to use Emacs. My feelings ranged from "hideous horrible monstrosity" to "looks interesting but can't use it."

Really, after one or two days of using Emacs to write Common Lisp, Emacs became second-nature to me. And you start to appreciate how easy is to have a separate concept of "buffers" versus "windows". In short, arranging your screen to work quickly, is very easy and quick.

At the end, the shortcut keys for Emacs do have some sort of logic. Thus i present a

    *EMACS/SLIME KEYS PRIMER in 5 MINUTES, FOR SANE PEOPLE*
    in the insane world of Emacs
    -----------------------------------------------

    This assumes that you're running Emacs on a windowing system like X or
    Windows. Thus you have a nice menu bar that you can use with the
    mouse.

    The first you need to know is that "Meta" is the "alt" key. So "M-a"
    means "press Alt+a".

    The first key combination you need to know is "Control-H b" (_H_elp me
    with the _B_indings). This will make Emacs open a window which will
    tell you ALL the key mappings. That is, which key combination does
    which thing. Since this window is HUGE, press Control-S (_S_earch) and
    write the string you want to search, if you are looking for a
    particular command. Press Control-S several times until you locate
    it. To search in _R_everse, Control-R.

    The next key combination you need to know is "Control-G" (_G_o to
    hell). This cancels any command that is prompting you for input on the
    status bar.

    Now, the other thing you will need is to do COPY and PASTE. Easy to do
    this is with the "Insert" (Ins) key.  Control+Insert == COPY
    Shift+Insert == PASTE

    Now, the EMACS keys do have some logic, and this can help you remember
    them.

    Control-X for commands that have to do with Emacs itself, like editing
    commands. For example "Control-X U" is _U_ndo.

    "Control-X S" is _S_ave.

    Alt-X (called "Meta-X") executes a command, for which you write the
    name of the command. This can execute any of the thousand commands
    available on Emacs. Each command is basically a LISP function that you
    will invoke.  It is very simple to invoke a command, and if you don't
    know the full name of the command, you just write the beginning of the
    command, press TAB, and Emacs will list you all the available
    commands.

    So, if you want to start SLIME, the command is "slime". Alt-X "slime"
    ENTER.

    Once you're in SLIME mode, you have SLIME commands at your
    fingertips. Most of the SLIME commands start with "Control-C".

    So, for example to load and compile the current file into Common Lisp,
    you do: Control-C-K , which "K"ompiles the file.

    Or for example you want to compile just a small part of the code, for
    example a DEFUN you have wrote. Just select (using the mouse or
    keyboard) the complete definition (or part of the code) and press
    Control-C-C to "C"ompile that section. Now it is available so you can
    use that function/macro/etc on the REPL, which is the "buffer" called
    *slime-repl*.

    When you are writing code, SLIME auto-completes as much things as it
    can, you just need to press TAB to invoke the autocomplete. Also,
    SLIME will tell you what are the arguments of each function you call,
    as you are writing the code.  If you want, SLIME can also _S_upply all
    the required function/macro parameters, just press Control-C-S.

    There is also an ALTernate _I_ntelligent auto-complete, that you can
    invoke using Control-C ALT-I. See?

    Want to know which functions are in a package and describe a simple
    _D_ocumentation for each function in the _P_ackage? So, Control-C,
    Control-D, P.  Or want to look the Common Lisp _D_ocumentation for
    _H_elp? Control-C, Control-D, H. Etcetera.

    -------------------------------
    
SLIME is really an mind-opening experience for me, after having used MS Visual Studio, Visual Studio Code, Netbeans, Eclipse, and PyCharm. SLIME enables to work interactively, very quickly.

As for Emacs, final words are some wisdom words of HN user "Karunamon" which wrote:

"The editor itself is written in Lisp. It's the most hackable thing out there. Yes, fine. It is a masterpiece of technical achievement. "




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: