178 lines of crap accumulated over about 20 years. I think I only use an indent variable setting, one key binding, and a handful of language autoloads. delete-delete-delete save-buffer Much better.
Ask HN: What's in your .emacs file?
11–20 of 60 posts
Re: Ask HN: What's in your .emacs file?
#12most useful parts: replacing fundamental mode with text-mode as the default mode when a new buffer is open.
(setq default-major-mode 'text-mode)
turn auto fill (automatic line wraping) and flyspell (spellchecking) on by default
(add-hook 'text-mode-hook 'turn-on-auto-fill)
(add-hook 'text-mode-hook 'turn-on-flyspell)
also I find yasnippet http://code.google.com/p/yasnippet/ wonderful for coding html mockups and django templates.
my github repo if anyone cares to take a peek: http://github.com/bmac/emacs
Re: Ask HN: What's in your .emacs file?
#13Lots of cruft (roughly 10 years worth), although I did recently start to refactor.
Most notable: it's fairly portable and relocatable, thanks to a snippet I cooked up (probably not original, but I haven't seen it else-where): http://everythingtastesbetterwithchilli.com/initialisation-f... (check it out anywhere and just symlink init.el to ~/.emacs, it figures out all paths from there. It'll also load platform-specific code, if you need that).
I try and make it lazier by combining autoload and eval-after-load, which helps with startup time.
On an organisational point (still work to be done here!), init.el mostly just loads a bunch of other files, which are roughly grouped by task or mode. Github has been a huge boon, combined with submodules to track a lot of third-party extensions.
I don't change many key bindings (most notable is the Yegge-suggested C-w for backward-kill-word), but I do have a /lot/ of extensions installed. I'm a fairly heavy user, although almost exclusively as an editor (+ lisp or python interaction, etc) -- I don't use it as a mail client, browser, or anything along those lines. The furthest away I get is the occasional twitter or IRC usage.
While I'm rambling: I'd like to make all my key-binding specifications consistent. Currently I have a mix of string specifications, vectors, kbd macros, etc. Does anyone know what the canonical approach is these days? Extra reference: http://www.nongnu.org/emacs-tiny-tools/keybindings/ and http://www.emacswiki.org/emacs/KeyBindingNotation
Re: Ask HN: What's in your .emacs file?
#14Re: Ask HN: What's in your .emacs file?
#15Re: Ask HN: What's in your .emacs file?
#16Re: Ask HN: What's in your .emacs file?
#17 ;; how emacs behaves generally
(setq scroll-step 1)
(setq next-line-add-newlines nil)
(setq search-highlight t)
(setq-default indent-tabs-mode nil)
;; some niceties on the status bar
(display-time)
(setq column-number-mode t)
(setq line-number-mode t)
;; other shortcuts
(global-set-key "\C-^" 'enlarge-window)
(global-set-key "\C-c\C-w" 'compare-windows)
;; fix broken backspace
(global-set-key "\b" 'backward-delete-char)
(global-set-key "\C-xt" 'term)
;; UTF-8 goodness
(set-terminal-coding-system 'utf-8)
(set-keyboard-coding-system 'utf-8)
(prefer-coding-system 'utf-8)
;; I'm into Perl, but prefer cperl-mode over the default
(defun modify-alist (alist-symbol key value &optional search-cdr)
(let ((alist (symbol-value alist-symbol)))
(while alist
(if (eq (if search-cdr
(cdr (car alist))
(car (car alist))) key)
(setcdr (car alist) value)
(setq alist (cdr alist))))))
(modify-alist 'interpreter-mode-alist 'perl-mode 'cperl-mode t)
(modify-alist 'auto-mode-alist 'perl-mode 'cperl-mode t)
;; the one true indentation level
(setq cperl-indent-level 4)Re: Ask HN: What's in your .emacs file?
#18I only periodically experiment with Emacs as my day-to-day editor, but my configuration isn't too shabby: http://github.com/al3x/emacs
Re: Ask HN: What's in your .emacs file?
#19my emacs.d still needs a few tweaks but I'm convinced it always will. most useful parts: replacing fundamental mode with text-mode as the default mode when a new buffer is open. (setq default-major-mode 'text-mode) turn auto fill (automatic line wraping) and flyspell (spellchecking) on by default (add-hook 'text-mode-hook 'turn-on-auto-fill) (add-hook 'text-mode-hook 'turn-on-flyspell) also I find yasnippet http://co…
Re: Ask HN: What's in your .emacs file?
#20For uninitiated, C-w is "yank text", i.e. cut it, and Firefox it is "close current tab without warning".