top | item 7107893

Emacs, naked

294 points| bzg | 12 years ago |bzg.fr

Configure GNU Emacs (24.3 or above) to avoid distraction.

194 comments

order
[+] terhechte|12 years ago|reply
Coming from Vim, when I switched to Emacs, I found the starting aesthetic experience more than lacking (or, ugly). It took me some time (and a helpful HN discussion) until I found good themes and good plugins to make it look aesthetically pleasing (to my eyes, at least, after all people's tastes differ).

If somebody is looking for a nice Emacs theme and feels that the OP is a bit too minimal, have a look at my Emacs conf (I know, shameless plug) here [1]

There's also a screenshot [2]

This configuration is kinda optimized for Emacs+Evil to be more like Vim, so you may just want to have a look at the theme / plugins.

[1] https://github.com/terhechte/emacs.d [2] https://raw2.github.com/terhechte/emacs.d/master/screenshot....

[+] mercurial|12 years ago|reply
I try out emacs every few years. Every time, I get discouraged whenever I attempt to do something simple (change the theme, etc) by the amount of configuration necessary. I may try your repo, since it seems to have a lot of stuff already configured.

The other thing is that Emacs is really slow to start as soon as you have a few plugins, compared to vim.

[+] dilap|12 years ago|reply
Very interesting thing you've got going there, and I love the visual aesthetic. Two quick tips that you probably already know, but just in case it's useful to you or someone else:

* Emacs can wrap lines at word boundaries, while intelligently preserving/extending indentation (something like this: https://gist.github.com/anonymous/8581161)

* If you're using emacs on the mac, it's worth taking a look at the railwaycat fork ("brew install emacs-mac"). Some improvements over vanilla emacs: Emoji (and other fun unicode) display works, fullscreen and maximize work better, scrolling with the trackpad works in a reasonable way.

[+] blueblob|12 years ago|reply
Not trying to be a douche, but trying to get an honest answer: if you are coming from Vim, using Evil-Vim to get Vim-like commands why use Emacs in the first place? What features do you use/did you want that made you switch?
[+] anuragramdasan|12 years ago|reply
What line numbering plugin is this? Looks very similar to vim numbers. I've been trying to find something like that for emacs for a while now. All I found wasLinum mode, which clutters the UI and doesnt give relative line numbering.
[+] bzg|12 years ago|reply
Oh, nice mode-line! I can't figure out how to get the theme from your repo, any hint?
[+] jasonm23|12 years ago|reply
I am super glad to see Soothe being used / well loved. Thanks for using it.
[+] antonios|12 years ago|reply
Very nice. Which font is this?
[+] sdegutis|12 years ago|reply
I switched to Emacs a year and a half ago when I started using Clojure, and customized it heavily for the first few months. But I avoid customizing it any more. I'm never truly satisfied with what I end up with, and I hit too many frustrating walls trying to make it just right.

One major problem for me is the plugin ecosystem. There's Melpa which is easy to use and has the most up-to-date packages, but they're built off of HEAD which makes them extremely brittle. Many plugin authors decry Melpa and say that if you installed their package from it, then you're on your own. There's also Marmalade but I haven't found it to have nearly the same scope of packages.

[+] NigelTufnel|12 years ago|reply
I walked almost the same path.

For the first couple of months I was customizing the hell out of Emacs. Then the things started falling apart and I've switched to the 20-line long .emacs and empty .emacs.d (well, almost empty if you don't count key-chord/ace-jump-mode combo which makes file navigation a mindreading experience)

[+] dotemacs|12 years ago|reply
Are you sure that MELPA has issues? I've been running with it since it started and one thing that I can say about it is that its been a joy to use. Hats off to milkypostman & sanityinc for maintaining it.

If you do have an issue, I suggest you open it on MELPA's GitHub issue page and I'm pretty confident that you'll get a quick response.

As for tweaking Emacs' config, yea, I have to admit, I've spent time on it too and things can always improve.

[+] bzg|12 years ago|reply
Actually, I'm also on the "less configuration, less trouble" side. That's why I like some minor mode to let me get rid of what I don't want to see, sometimes.
[+] swah|12 years ago|reply
Ì wonder if some Emacs people intend to migrate to LightTable in a few years?
[+] vsbuffalo|12 years ago|reply
As a long time emacs user (and lover) I wish RMS and other emacs developers would take his quote to heart more in emacs development. Emacs is shipped with too many things.

Emacs finally has a really nice package manager, so I'd love to see a version with minimal default packages. Do I really need java-mode if I never, ever will use Java? Calc when I have R? SMTP support? No, I need absolutely none of this.

[+] klibertp|12 years ago|reply
Obligatory link: http://nullprogram.com/blog/2009/06/23/

I don't get why this is a problem - almost everything that comes with default Emacs installation is not loaded by default and so you don't even need to know it's there. Or you can just remove these modes altogether from your installation, no problem. On the other hand, if something made it to the Emacs core, it's probably more stable and easier integrated with other plugins. There are many plugins in the wild which do a great job by themselves, but fail miserably in the presence of other plugins enabled, and such plugins are not in Emacs (or I didn't see them yet).

[+] bza|12 years ago|reply
The current policy (as enunciated by Stefan Monnier, who took over as maintainer from RMS a few years ago) is for new packages to be added to the package archive unless there's a very strong argument for their providing core functionality. (Packages that already ship with Emacs are unlikely to be removed from the core, though.)
[+] fafner|12 years ago|reply
So why does it bother you that there are modes which you don't use? They aren't loaded as default anyway.
[+] kabdib|12 years ago|reply
I've found the latest revisions of Emacs to be incredibly ugly, and I have to turn off most of the crap (menus, etc.) to be comfortable.

Stock Emacs also seems to want to open up a minibuffer when I've told it "please just edit this set of files". It's also got some idea that I want to to suspend the shell I launched it from (er, no, not ever).

The argument I see on forums is: "Well, the right way to use Emacs is to just start it and then never leave, so you only have to get that stuff out of the way once."

So I spend 30 minutes figuring out the right elisp stuff to disable so I can get rid of the crapware.

Crapware in Emacs. What's next, AOL sponsorship splash screens?

[+] Karunamon|12 years ago|reply
This is the same problem I've run into. I want to try living in Emacs, because there's pretty much a mode or package for everything, but a few of the basics don't work quite right to a point where that is usable yet. For instance, terminal emulation. There's terminal mode and eshell, but if you have even a mildly complicated PS1, all you get are control codes everywhere. Just strange, off-kilter behavior.

At this point, I'd be happy if I could just embed iTerm2 in a buffer and be done with it.

[+] alexhutcheson|12 years ago|reply
If you prefer a more vim-like workflow (i.e. jumping in and out of your editor from your shell), a good solution is to fire up emacs in daemon mode to run in the background, and then connect to it using emacsclient.

I automatically run

  emacsclient --daemon
when my OS boots up.

In my .zshrc and .bashrc files, I use the aliases

  alias e='emacsclient -t'
  alias vi='emacsclient -t'
to give me quick access to emacs from the shell.

I'm not sure if this addresses your problems entirely, but it does keep you from having to deal with all of the crap that loads on startup.

[+] SimHacker|12 years ago|reply
UniPress Emacs (aka Gosling Emacs aka Soft Hoarder Emacs) had a VI emulation mode, that when you went :q, switched you back into a shell buffer that had its mode lines hidden, with all the keyboard bindings set so you couldn't tell you were in Emacs.

The only vi command I know is :q!

[+] drdaeman|12 years ago|reply
I hoped the article would be not about look-and-feel, but about building a stripped-down version of Emacs without obsolete parts like TRAMP or LEIM (because there are system-global subsystems for those nowadays), or maybe even trying to tear chunks from MULE.

In a perfectionist "must be a pure gem, no imperfections allowed" sense, ton of seemingly unnecessary libraries is the only thing that actually bothers me about The Editor.

[+] npsimons|12 years ago|reply
Many of these suggestions seem similar to Steve Yegge's "Effective Emacs" which I can recommend if you are a new Emacs user (or even if you've just not seen it before):

https://sites.google.com/site/steveyegge2/effective-emacs

I like getting rid of toolbars and such, but still like to keep the modeline and gutters.

[+] throwaway_yy2Di|12 years ago|reply
If you reflect for a moment, obviously a minority of HN will be made alienated and uncomfortable by this sexualized humor. Do you really want this?
[+] phkn1|12 years ago|reply
Why go to all that trouble? There's always "emacs -nw" to get pretty minimal in an xterm...
[+] __david__|12 years ago|reply
You don't get as many color choices and you don't get as many key bindings.

"C-M-%" is pretty much impossible in the terminal. You have to do "M-x query-replace-regexp", or make some other custom binding.

[+] lispm|12 years ago|reply
Like Zmacs of the Lisp Machine. Mostly full screen, with a mini buffer and the status line at the bottom.

A lot of interaction then happens with a type-out buffer which comes down from the top and disappears when not needed.

[+] yamaneko|12 years ago|reply
Rule 34, what have you done?
[+] kinleyd|12 years ago|reply
-1, 1 and t have worked for me in setting most modes except that blasted scroll-bar-mode, which it turns out calls for a 0 - what the heck! Thanks for a super post.
[+] fafner|12 years ago|reply
(scroll-bar-mode -1) and M-- 1 M-x scroll-bar-mode RET both work for me.
[+] ams6110|12 years ago|reply
nice stuff. My .emacs keeps the mode line, which I like, but turns off the scrollbars and menu bars, and sets a wide fringe (though not quite as wide as shown). I don't like text jammed right up to the edge of the window.

Anyone know how to achieve a "fringe" on the top and bottom? And also how to do it in xterm windows?

[+] ams6110|12 years ago|reply
Just discovered, you can create a "fringe" in xterm by the -b option:

  -b number
      This option specifies the size of the inner border (the
      distance between the outer edge of the characters and the
      window border) in pixels.  That is the vt100 internalBorder
      resource.  The default is ``2''.
[+] nayefc|12 years ago|reply
If you use Emacs in the terminal, almost none of this applies as they are there by standard.
[+] adorton|12 years ago|reply
That fringe is neat. Anybody know if Vim supports something like that? I've never been able to make complete sense of vim's line length options. They never seem to work quite "right".
[+] girvo|12 years ago|reply
There are a number of hacks to do it as plugins, but I can never get them to play nice with other plugins :(
[+] skywhopper|12 years ago|reply
It's very unfortunate that Emacs' default appearance is so terrible. I slogged through figuring most of this stuff out myself a few years ago.
[+] bitwize|12 years ago|reply
emacs -nw

:)

It looks great when it combine it with amber-on-black Glass Tty in my xterm.