News for hackers. Stuff that matters.

Learning Emacs, any tips or tricks, best tutorial?

For many many years I used my own, homebrew editor, aptly named 'e' (I don't like typing more than I need to). This worked quite well until about a decade ago when I started to work more and more on other peoples machines and it bothered me that I always had to spend time to move my environment with me. So I decided to standardize on the minimum that is always available, which turned out to be vi(m).<p>This worked really well for a long time, even though I never got to the level of being a poweruser I managed to get through the day.<p>I've used 'leo' for a while, an awesome little project, it is essentially a literate programming editor and I really liked the concepts behind it but it has some serious shortcomings as well (does not work in terminal mode), so I had to let that go.<p>I've decided now to invest serious time into learning a new editor and have chosen to leave vi(m) behind and to move to emacs.<p>Are there any tips & tricks that you think I should be aware of? I've googled a bit for guides on learning Emacs but nothing that strikes me as suitable turned up, however I can't imagine that I'm the first to try this, the key 'emacs tutorial' turns up a wild variety of material, too much to choose from really and lots of it of questionable heritage and/or dated (which may not be bad by itself).<p>What would you use as a starting point if you were to point a new emacs user to today?
( 17 comments | 15 points | on HN )
Re:Learning Emacs, any tips or tricks, best tutorial? by vtanase on Wednesday March 13, 2013 @12:16PM (#5369352)
Hello,

as someone who shied away from regular IDEs to use Emacs for programming work, I would recommend that you start setting things up for some very specific need.

As it was already pointed out, Emacs is huge and you will never stop learning it. Therefore, if your main line of work implies writing Java code, I would recommend you look for some tutorials that are particularly aimed at that, and build on those as you need more out of your editor. For example right now I am looking at learning org-mode to be able to do time tracking with it.

If you seriously consider using Emacs all the time I would recommend remapping the Ctrl key to Caps Lock for easier typing.

Since you were asking for some tutorials, these are the two tutorials that I found most useful in defining my Emacs setup:

https://sites.google.com/site/steveyegge2/effective-emacs - specific things that are very useful in your configuration

http://devblog.avdi.org/category/emacs-reboot/ - someone in the ruby community, remaking his emacs config from scratch and explaining it as he goes

I am no where near a proficient Emacs user, but maybe I can provide some insight as a fellow learner if you get stuck. I believe my e-mail should be in my profile if you have any problem starting up with Emacs.

Have a nice day, Vlad

Re:Learning Emacs, any tips or tricks, best tutorial? by jamesjporter on Wednesday March 13, 2013 @12:52PM (#5369556)
This absolutely, best way to learn is to have a specific goal in mind. I got started with emacs because I was using an IDE called RStudio (http://www.rstudio.com/) which I really liked, and I wanted something similar for python but couldn't find anything to suit my needs. I set out to recreate the functionality of RStudio in emacs and have (largely) succeeded. It took a lot of mucking around but I really learned my way around the editor.
Re:Learning Emacs, any tips or tricks, best tutorial? by S4M on Wednesday March 13, 2013 @04:33PM (#5370953)
Well done to have replicated RStudio for pyhton on Emacs. I am interested by that, do you have the ELisp code somewhere? Thanks!
Re:Learning Emacs, any tips or tricks, best tutorial? by mangamadaiyan on Wednesday March 13, 2013 @08:53PM (#5372374)
Steve Yegge's effective emacs is definitely worth a read. It helped me get used to emacs without contracting RSI :) FWIW, I'm bilingual - I use Vim to write code and emacs to write in English.
Re:Learning Emacs, any tips or tricks, best tutorial? by jgrahamc on Wednesday March 13, 2013 @11:31AM (#5369112)
The GNU Emacs Manual is pretty comprehensive (http://www.gnu.org/software/emacs/manual/html_node/emacs/ind...)

One of the things about Emacs I've discovered over the years is that you never finish learning it. It's so extensive. That's how I ended up reinventing this wheel: http://blog.jgc.org/2013/03/automatic-bookmarking-locations-...

Re:Learning Emacs, any tips or tricks, best tutorial? by samiur1204 on Wednesday March 13, 2013 @05:31PM (#5371249)
Hey there,

I used to Vim too, and started using Emacs since I started doing a lot of Clojure development. Since then, I have not looked back. The power and flexibility of Emacs is second to almost none. Just the other day, I was working on a Latex file, and I had a buffer open with a pdf viewer right next to my tex file, that would update as soon as I saved changes to my tex file. And the community has done almost everything you can think of already. If not, just write it yourself!

To get started, I would highly recommend using Emacs Prelude: https://github.com/bbatsov/prelude It's incredibly useful and user friendly, and makes your Emacs all the more powerful. This is a good intro article to it: http://batsov.com/prelude/

The other blog that I find useful even as a fairly seasoned Emacs user is http://www.masteringemacs.org/ It has some great guides and tutorials for beginners too.

Re:Learning Emacs, any tips or tricks, best tutorial? by gruseom on Wednesday March 13, 2013 @01:00PM (#5369607)
I agree with the people recommending the built-in tutorial (C-h t) and the official manual. Emacs' documentation is very good.

Also, the basics of Emacs haven't changed since forever so some of those dated resources you mention may be just fine.

Good luck! I hope you like it.

Re:Learning Emacs, any tips or tricks, best tutorial? by S4M on Wednesday March 13, 2013 @02:54PM (#5370340)
I dont have a tutorial to offer you, but here's what made semi-comfortable with emacs:

- install the emacs starter kit [0] as it's much user friendly than the raw emacs

- learn the most used shortcuts (C-w to cut, M-w to copy, C-Y to yank (paste), C-x C-s to save, C-x C-f to open a file, C-k to kill a text, C-a to go at the start of a line and C-e to go at the end, etc.)

- try to use emacs for everything and slowly get more and more comfortable at it.

[0] https://github.com/technomancy/emacs-starter-kit

Re:Learning Emacs, any tips or tricks, best tutorial? by bdunbar on Thursday March 14, 2013 @09:52PM (#5378832)
You didn't say what operating system you are using. When I 'got into' emacs it was with the OS X-ish version, Aquamacs.

Which _is_ emacs, but with Mac friendly bits. At first I used it simply as a replacement for Textmate, then later got into things like TRAMP, and org-mode.

I didn't need a guide or a how-to. Every so often I would wonder 'I wonder if Emacs can do this, or that', google it, and learn that it could.

Re:Learning Emacs, any tips or tricks, best tutorial? by sunilnimmagadda on Wednesday March 13, 2013 @02:09PM (#5370055)
If it's only about the "editor" part of Emacs then I would recommend starting with an Emacs-like editor mg[1]. It's clean, small and has nice manpage that I feel wouldn't overwhelm newcomers. It also has some of the basic commands helpful for programming.

[1] http://www.openbsd.org/cgi-bin/man.cgi?query=mg

Re:Learning Emacs, any tips or tricks, best tutorial? by mattl on Wednesday March 13, 2013 @11:23AM (#5369074)
The built in tutorial (M-x tutorial) is good.

M aka Meta is generally Alt on a PC keyboard or Alt+Esc on a Mac.

Re:Learning Emacs, any tips or tricks, best tutorial? by binarysoul on Friday March 15, 2013 @12:41PM (#5381459)
some bite sized emacs tips http://rawsyntax.com/blog/categories/learn-emacs/

and a great introduction to setting up emacs http://batsov.com/articles/2012/10/14/emacs-on-osx/

posts on various emacs topics http://www.masteringemacs.org/

Re:Learning Emacs, any tips or tricks, best tutorial? by snotrockets on Wednesday March 13, 2013 @03:12PM (#5370455)

  (menu-bar-mode nil)
  (tool-bar-mode nil)
It'll force you to climb the very steep learning curve to Emacs mastery.
Re:Learning Emacs, any tips or tricks, best tutorial? by brudgers on Wednesday March 13, 2013 @12:43PM (#5369519)
Re:Learning Emacs, any tips or tricks, best tutorial? by guojh0570 on Wednesday March 13, 2013 @11:42AM (#5369166)
Emacs tutorial itself is a nice start for you.
Re:Learning Emacs, any tips or tricks, best tutorial? by jacquesm on Wednesday March 13, 2013 @12:21PM (#5369394)
Thank you all!
Re:Learning Emacs, any tips or tricks, best tutorial? by msh on Wednesday March 13, 2013 @12:05PM (#5369293)
M-x doctor ;)