Try the EmacsTutorial, or read one of the BooksAboutEmacs. Learn Emacs using its SelfDocumentation. Asking Emacs directly is the best way to get to know it.
So, that's emacs. It should be clear by now that it isn't a straightforward text editor, You might call it an operating system that thinks it's a text editor. Or a text editor that thinks it's an operating system. It's complex, difficult to learn, hard to configure, deliberately unsexy, and insanely powerful.
The resulting system was called EMACS, which stood for Editing MACroS or, alternatively, E with MACroS.
Just like the Ctrl key, emacs uses multi-key functions with the meta key. So if you see a notation like M-x, it means “press Alt/Esc/Option/Edit key and x together”. The Enter key is shown as RET (short for “Return”) and The Esc key is often shown as E.
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.
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.
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.
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 elisp (if you're a programmer).
The great thing about emacs is that you don't need an "emacs workflow", emacs works around your workflow!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With