3
1

Which configurations are essential and are there any good sources for getting started with Emacs?

asked 22 Jan '12, 21:51

Dromi's gravatar image

Dromi
3371514
accept rate: 33%

You could also ask the question "What are some good emacs packages" and I'll run amok with all those I install :) I imagine we could keep one package per answer and then we could vote on the most useful packages :)

(22 Jan '12, 22:12) jlouis jlouis's gravatar image

I started learning Emacs and I hope to document my learning process. So I'll try to edit this answer accordingly

Learning Emacs

This answer is two-part. This part is how to get yourself acquinted with Emacs.

Mental Notes

Make mental notes on the following Emacs-lingo and oddities:

  1. C-x means press and hold Control followed press x. M-x is the same for Meta. Same goes for other keys than x.
  2. Your Meta key is either Option (⌥), Alt, Command (⌘), Esc, Menu or something entirely different.
  3. Esc as Meta is not a good idea, unless you don't have other options. (Mac Users, see below)
  4. C-x k is not the same as C-x C-k. Same goes for other keys than x and k (obviously).
  5. In a "Unix" environmont, a vanilla (i.e. your) emacs configuration is at ~/.emacs.d/init.el - .el means the file is emacs lisp.
  6. Remember C-_ or C-x u - This is Undo and will help you a lot if you fuck up something.
  7. Remember C-g. This cancels any command you might be in the process of (involuntarily) enter - Except when you do something like M-x. Then press Esc 3 times in a row.

You should now be ready to start acquiring your Emacs skills.

Your first steps in Emacs

  1. Start Emacs and press C-h t to invoke the tutorial. Remember note no. 4 above.
  2. Do as the tutorial says. You might want to follow this tutorial a number of times to start getting the muscle memory right.
  3. Read 10 Specific Ways to Improve Your Productivity With Emacs by Steve Yegge - don't get offended by his douchebaggery. His suggestions are solid even though you might not share his opinions.
  4. Apply desired suggestions in the above blog post to your habits and configuration file.
  5. Read the answer that jlouis wrote. You might want to skip some of it steps. :-)

You're now on your way to master Emacs.

Hints and tips

This part of the answer is a list of tips, hints, tricks and what not that I and others have found helpful in our learning process.

Suggestions for Mac users

I'm using Emacs.app from macports. In order to have Emacs working "seamlessly" (non-interfering) in my Mac OS X Lion environment, I've compiled a list of my settings. I hope to extend this list as I find and fix more annoyances - YMMV:

  • Have a usable working Meta key

I don't want my Command key (⌘) getting taken over by Emacs, so I've opted to use Alt/Option (⌥) as Meta. But this is potentially problematic, as Mac OS X use option as a modifier for accessing special characters when inputting text.

By issuing M-x customize-variable (use Esc for Meta if in doubt, end with return), you can change the mapping of your option key by typing in ns-option-modifier or ns-right-option-modifier. I've chosen Meta from the dropdown Value Menu for right-option, and no modifier for option, so that I can still use right option as Mac OS X option default.

On danish keyboards, you use shift+alt+7 to input \. If you map ns-option-modifier as Meta and ns-right-option-modifier as no modifier, you won't be able to input \ like this, therefore use the configuration above

  • Make Caps Lock act as Control

This is a system wide remapping, but I rarely use Caps Lock anyway

From System Preferences, chose Keyboard preference pane. Under the Keyboard tab, press Modifier Keys and select Control as the action for Caps Lock.

link

answered 28 Jan '12, 22:13

ptrf's gravatar image

ptrf
43017
accept rate: 45%

edited 07 Feb '12, 16:40

A quick starting emacs:

Introductory stuff:

  • Recognize that this is a project that will take years. You will learn all the nooks and crannies as you go along, but not in the first or second week. This goes for all powerful editors: Emacs, Vi, TextMate, etc...
  • Read Steve Yegges Effective Emacs
  • Recognize that emacs isn't an editor. It is a toolbox for creating an editor. So you must configure it to your liking in order to make it effective. This will take time and .emacs hackery.
  • Keep your .emacs configuration lean and simple. After some time you want an .emacs.d directory with a init.el file in it and then you need to split your configuration over multiple files. Don't just shove things in there, keep stuff separate.

Learn the basic help functions:

  • C-h b - stuff bound in this buffer mode
  • C-h f - describe function
  • C-h v - describe variable
  • C-h ? - help for help
  • Always run through the Emacs Wiki for anything you don't understand.

Configuration blurbs:

  • Understand what M-x customize-group and M-x customize does.
  • If you are advanced, go with package managers: look up elpa and el-get.
  • If something is wrong go dig up how to change it. Everything can be made like you want it. Don't like the default scroll settings? Fix them!
  • Steal from friends! Mine is at: github/jlouis/jlouis-emacs-conf Look up the el-get packages I install for inspiration. Also take a look at my defuns.el for function definitions and global.el for global configuration.
  • The bindings F5 through F8 and C-c <char> is never touched by any major mode. Use them to get your own quick bindings to stuff in the editor. For instance, I have C-c h bound to 'compile and have C-c r bound to 'vc-git-grep - the latter runs a git grep on the current project and throws a grep buffer back with the results.

And above all - have fun tuning your F1 race car.

link

answered 22 Jan '12, 22:11

jlouis's gravatar image

jlouis
6163
accept rate: 50%

In addition to this excellent answer, instead of doing what I tried doing at first, namely learning everything at once, learn the basics first then move on from there as you get more and more familiar with it:

  • opening, saving, closing

  • undo/redo

  • copy/paste

  • buffer navigation (to switch between open documents and produced logs)

(25 Jan '12, 17:08) bsm ♦ bsm's gravatar image
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×122
×9
×3

Asked: 22 Jan '12, 21:51

Seen: 2,909 times

Last updated: 07 Feb '12, 16:40

powered by OSQA