views:

1494

answers:

10

I am about to learn Emacs, have been through the tutorial and borrowed the O'Reilly book on Emacs. But the question still is - how do you learn good Emacs workflow? I guess, you don't use Emacs as you'd use, for example, Vim.

This question seems revelant to mine: - Where can I find a video of a professional using Emacs?

A: 

That's the power of Emacs, you use it the way you like. You just have to configure it before for your liking.

vava
+2  A: 

You don't need to learn emacs workflow. Once you complete the tutorial and master the essentials, you'll have to adopt some degree of monogamy and use nothing but Emacs. Eventually you will think of functionality that you really wished existed; most of the time somebody else will have as well and the solution is just one search away! Over time you just can't help but learn and eventually you'll pick up enough that you'll develop your own personal workflow.

If you're looking to accelerate the process, the Emacs wiki has a variety of tips but really the best way is just to do stuff with Emacs.

vinc456
A: 

To be honest, all I do is learn the keybindings I need. I don't use emacs to its full potential, because I don't need its full potential. My suggestion is to just learn what you need, and don't worry about what you don't. Learn a new key binding everyday, and in about 300 years will you know them all ;)

Rayne
+7  A: 

Once you mastered the basics (opening/closing files, navigating, basic editing) just use it. As with a lot of other tools, practise makes perfect...

I would, however, set some time aside to work on improving how you use the editor currently, but as part of your normal workflow as opposed to just going off on a tangent and learning things for the sake of it.

I find some useful resources are the EmacsWiki and the Planet Emacsen blog. I use both, mainly by using Planet Emacsen for "inspiration" and then wandering over to EmacsWiki and having a trawl on there for a specific topic. I found that unless you're having at least a vague idea what you're looking for, the available information is just going to swamp you instead of it actually being helpful.

Not to mention that there are a few very useful resources here on StackOverflow, for example this question here. Emacs is a very powerful tool that tends to be able to do a lot more than a single person needs, but in the end that allows you to pick and choose exactly those parts that you need.

Timo Geusch
+1  A: 

I am using the emacs since the old Amiga days on all platforms i am currently working on.

The best way to use emacs is curiosity. I still use often apropos (C-h a) and M-x (for a long functionname instead of key-binding) to find a functionality.

a key-concept to "proper use" Emacs is, to learn the very easy elisp (a simple derivate of lisp) and write your own little helpers (own commenting style, underlining, templates) and to know where to look to change values (tab-size, compiler, email)

And the third thing: everything is in emacs: I use the dired (directory editor) for navigating through files. I use a lot of buffers for all textual files (with proper modes for each type of file (c, ruby, list, sql, latex, ...)) which are stored when quitting emacs and recovered when invoking. I start the compiler from emacs and use the jump-to-error-functionality.

Macros are a daily routine (scimming throu code and changing it on the way).

I like the picture-mode, which allows to type downward with replacing, which makes it easy to renumber block of constants (good old c #defines))

There is a hugh mountain to climb, but if you have reached the top, you can see the whole world down your feet, and never want to miss this experience again. I know, there are many good editors around (i work myself thru Eclipse)

Peter Miehle
Although, you might prefer align-regexp and rectangle editing to picture-mode.
jrockway
+1  A: 

You could have a look at Bram Molenaar's talk about efficient textediting, http://video.google.com/videoplay?docid=2538831956647446078&ei=EqiGSau8KZ-QiQLi-Nn8Cg&q=bram+molenaar+editing

Although he's a vim guy (he wrote it), you might get some ideas about how best to go about becoming more proficient with your text editor that'll apply to emacs.

Jonas Kölker
+3  A: 

My suggestion is just stop using anything but Emacs, when you come across a problem see if you can solve it in Emacs, and then fall back (if you don't have the time or it just won't work). As for work flow, it is pretty much the same as you would normally work. i.e. for a normal ide session you would open/edit a file as normal, then commit (in C-x v v) just as normal.

Andrew Cox
+1  A: 

As previously stated, the best advice is to use nothing but Emacs for the next year. Once you develop your finger memory, things get to be much easier.

+2  A: 

I agree with the other posters here, you just have to use it! Here's how I did it:

Once I got the very basics (can get between buffers, open/save files, etc), I printed out a reference card and kept it handy. This is a good one. Review it just so you know what is on it, then whenever you find yourself doing something repeatedly that is on the card, start using the shortcut! Before you know it you'll have memorized quite an arsenal of commands. But remember, probably no one uses everything that emacs can do.

When you eventually find yourself doing something repeatedly that doesn't have a shortcut, that's a good time to learn keyboard macros. Once you get them, you'll find uses for them everywhere! From there it's a short jump to writing elist (if you're a programmer).

The great thing about emacs is that you don't need an "emacs workflow", emacs works around your workflow!

Brad
+4  A: 

I can't believe nobody has mentioned this, but reading the info pages bundled with Emacs is a great way to learn about obscure features. Whenever you need a break from coding, hit M-x info and pick a random page to read. Your emacs ability will improve incredibly quickly.

It is also important to realize how emacs' self-documenting-ness helps you work. Say, for example, you are wondering how you can scale the font size. Instead of interrupting your flow and asking here, or on IRC, or Google, you can ask emacs! Just hit C-h a (M-x command-apropos) and type a search term, in our case scale. If there are matching functions, their names, keybindings, and documentation will appear. There are, and now you've just discovered text-scale-increase and text-scale-decrease.

There are other self-documentation functions that are good to learn C-h m will tell you what keybindings and commands are available in the current major and minor modes. This is a great way to discover features you didn't know existed.

Another way to "learn by osmosis" is to M-x customize-group for the modes you use regularly. (customize is the interactive configuration editor that almost all modes support.)

The final thing to do is to learn Emacs Lisp. It is nice to use existing tools, but sometimes you will need your own. If you try to avoid learning Lisp, you will always be stuck with things not quite working right, and that's a shame.

Emacs is a great environment for customizing itself. Emacs includes two Lisp manuals that are viewable via M-x info. It is self-documenting, so you can say C-h f or M-x describe-function to get the documentation for any function. You can even press TAB ENT to jump to the source code of that function, to see how it's implemented. This is great when you think "I wish I had something that worked like foo, but just slightly different." You can read how foo is implemented, make your change in the *scratch* buffer, and then see if you like the change. There is no edit/compile/test cycle. You press a key and your emacs session immediately has the feature you just wrote.

The more effort you put into learning emacs, the more emacs will do to make your work easier.

jrockway