views:

214

answers:

3

I have tried emacs on and off for a while now and every time I start emacs, I go through the same routine. Customizing. The first one is binding return to newline-and-indent. (g)Vim does this by default. Showing matching parenthesis is also done by default on (g)Vim. It is grea that I can customize emacs to my heart's content but why doesn't emacs have nice and easy defaults? For reference, I am now using Emacs 23 on a RHEL5 box.

+1  A: 

Probably because RMS didn't want it, that and because changing long-standing defaults is just an issue of politics. Like vi, Emacs has a hard-core following and basic changes like these are minefields.

Note: if you saved your customizations, then you wouldn't have to re-do them every time...

Trey Jackson
I did save those settings in my .emacs file. Just that I kept losing it whenever I switched machines. Of course, now it is online in a source control repository, so it should be easy to retrieve.
Bala
+2  A: 

To have those nice and easy defaults, install Emacs Starter Kit. It enables by default a bunch of useful and convenient features make even the advanced Emacs users more productive.

Otherwise, as TJ pointed out, Emacs Customization Mode (type M-x customize) allows you to save permanently any of the settings. You can even store them in a separate file from your dotemacs―(setq custom-file "~/.emacs-custom.el")―so you can use it in every computer you work on.

Török Gábor
Thanks for the pointer to Emacs Starter Kit. I'll try it out.
Bala
+2  A: 

The title of your question doesn't really reflect what your question is (and has been answered by Trey and Torok), but I'll tell you why I like it being bound to just newline: useless whitespace. Say you are nested inside a conditional in a function etc. and hit return a couple times to leave a blank line. The blank line now has a bunch of space chars on it. Yes, you can (and I do) remove trailing whitespace before saving, but I also have visual whitespace mode on and I can see it there taunting me.

scottfrazer
That's a great reason.
Trey Jackson
That's kind of annoying. In that case, Vim would remove the unneeded indent spaces when you press Enter the second time if you haven't typed anything else on the line.
Greg Hewgill
Sure, you could write some simple elisp to do that in Emacs, but what about when you add a blank line then navigate away, or save the file, or etc.
scottfrazer
Vim also removes the unneeded indent spaces when leaving insert mode. I don't intend this to degenerate into an emacs-vim war, so I'll just leave it at that.
Greg Hewgill