Suggested initial Emacs config?

13,059

Solution 1

That is a hard question. My theory about Emacs is that you have to give it a real honest try. That means working with it for a few months, not days. It is not for the faint of heart! Ideally emacs would become your one and only text editor, and you do things the emacs way.

Really, to give yourself and emacs the best chance possible, you should learn enough elisp to do your own basic customizations.

In fact, I think your .emacs is probably a read herring with regards to giving emacs the best possible chance. Instead, try out some of the groovier features like flymake with pylint, the inferior python process, python debugging with emacs are all worthwhile. In particular inferior processes are the bomb.

EmacsWiki has some good info on python and emacs.

Solution 2

I'd suggest starting with a blank .emacs file. Then go through the tutorials and related blog posts, and grow it as you learn. Using a .emacs file that's borrowed from someone else seems a little like missing the point.

Solution 3

The most important configuration change that I have found is not one for your .emacs, but for your OS. In the "Keyboard & Mouse" system preferences, in the "Keyboard" tab, click "Modifier Keys..." at the bottom and then change "Caps Lock" to behave like "Control." Then train yourself to use the caps lock key (to the left of the "A") instead of the control key down in the corner. This will make the whole experience both far more productive and far more comfortable.

see: Emacs on Mac OS X Leopard key bindings

Solution 4

See these related questions:

Solution 5

You can try following extensions:

(require 'smooth-scrolling)
(require 'multiple-cursors)
(require 'ace-jump-mode)
(require 'expand-region)
(require 'inline-string-rectangle)
(require 'mark-more-like-this)
(require 'key-chord)
(require 'browse-kill-ring)
(require 'idle-highlight-mode)
(require 'htmlize)
(require 'icicles)
(require 'highlight-parentheses)
(require 'golden-ratio)
(require 'projectile)
(require 'helm-projectile)
(require 'rainbow-mode)
(require 'anything-config)
(require 'highlight-symbol)
(require 'markerpen)
(require 'flyspell)

also you can distinguish TAB and C-i, then you'll have one more simple short-key.

(define-key input-decode-map (kbd "C-i") (kbd "H-i"))
(define-key input-decode-map (kbd "C-M-i") (kbd "H-M-i"))
(global-set-key (kbd "H-i") 'kill-ring-save)
(global-set-key (kbd "M-i") 'kill-ring-save)
(global-set-key (kbd "H-M-i") 'ace-jump-line-mode)
(global-set-key (kbd "C-c H-i") 'ido-switch-buffer)

find more: https://github.com/whunmr/dotemacs/blob/master/init.el

Share:
13,059
dbr
Author by

dbr

I could be contacted via http://twitter.com/_dbr

Updated on July 08, 2022

Comments

  • dbr
    dbr almost 2 years

    I would like to to try Emacs, and want to give it the best chance possible.

    To do this, it seems like having a good .emacs file is important.

    I primarily use Mac OS X (so I have looked at Aquamacs), and I mainly do Python programming, so anything specifically for that would be great.

  • dbr
    dbr over 13 years
    I've now been using emacs for a year or so - this is pretty much how I finally became familiar with it. Started with a completely default setup, went through built-in tutorial, then started playing with interesting features/libraries (e.g flymake with pyflakes, emacs-jabber), or changing things that annoy me (e.g replacing the C-x o shortcut with wind-move, or setting up color-theme)
  • Noufal Ibrahim
    Noufal Ibrahim over 11 years
    +1 to this. I have two screencasts on customisation part 1 and part 2 which talk about writing a simple .emacs file from scratch.
  • dolzenko
    dolzenko over 10 years
    Steve Yegge puts it the best with this quote "Occasionally people ask to see my .emacs file. This always throws me for a sec. It feels like they've asked if they can take a peek at my Linux file, or my Windows file." :)