I give up. During the past 6 years of my emacs career, my .emacs initialization file grew to embarrassing levels. As of this morning, it is well over 1000 lines and is a looming burden of disorganization. Startup time is poor, customizations exist for modes that I don’t use anymore (ahem, csharp-mode), and it has been this way for too long.
Today, I am declaring .emacs bankruptcy.
Akin to email bankruptcy, I’m blowing everything away and starting over. Only as I realize a need for something is it going back in. I’m also starting with a better organization scheme. My intent is to have a .emacs file with nothing but load-path additions and requires.
Here is an early view of my
.emacs as I start this process:
;;;; Ryan McGeary's emacs initialization (2001-2007) ;; Enable a backtrace when problems occur ;; (setq debug-on-error t) ;; Load paths (add-to-list 'load-path (expand-file-name "~/.emacs.d")) (add-to-list 'load-path (expand-file-name "~/.emacs.d/lisp")) (add-to-list 'load-path (expand-file-name "~/.emacs.d/lisp-personal")) ;; Personal customizations (require 'my-generic) (require 'my-iswitchb) (require 'my-carbon-emacs) (require 'my-colors) ;; Many more to come
And here is an example of a personal customization (
;;; Generic emacs settings I cannot live without ;; "y or n" instead of "yes or no" (fset 'yes-or-no-p 'y-or-n-p) ;; Highlight regions and add special behaviors to regions. ;; "C-h d transient" for more info (setq transient-mark-mode t) ;; Display line and column numbers (setq line-number-mode t) (setq column-number-mode t) ;; Emacs gurus don't need no stinking scroll bars (toggle-scroll-bar -1) ;; Line-wrapping (set-default 'fill-column 80) ;; Prevent the annoying beep on errors (setq visible-bell t) (provide 'my-generic)
This particular component is very likely to grow, but with the added organization elsewhere, I am more likely to refactor early and often.
- Third party packages go in
- My own packages go in
- Personal customizations are broken into manageable components, and each is prefixed with “my” to avoid naming conflicts. These are placed in my
- Customization components can be compiled for speed, or commented out when not needed.
- My stress levels are reduced knowing everything has it’s own cubbyhole.
I anticipate this being a good bit of work, but I think it’s going to be well worth it. If nothing else, it makes me happier.
Your feedback, please
Who else wants to declare bankruptcy with me? What other techniques, tools, or conventions am I missing?