If I was always right, I'd never have comments.

Today For Show-n-Tell, I Brought My Dot-Emacs File

Date/Time Permalink: 01/17/08 09:35:50 am
Category: HOWTOs and Guides

Somewhere along the way, I guess every Emacs fan gets around to posting their .emacs file. This is the customization file stored in your home directory if you use Emacs. They're interesting because over the years each user finds a half-dozen tricks and accumulates them in this dot-file which you can move with you from one PC to another.

I've excluded the top part, which is the standard XEmacs custom-set variables, leaving only the parts I've added:

;; Custom tweakin's...
;; -------------------
;; The font only affects X-windows, due to the line below:
 (if (eq window-system 'x)
     (set-face-font 'default 
;; The color scheme is a dark cyan-on-black, with a red cursor.
;; Combined with a simple fixed font, this is easy on the eyes
;; in both console and desktop, and reminds me a little bit
;; of old consoles, for the retro-coolness of it.
(add-to-list 'default-frame-alist 
  '(foreground-color . "medium turquoise"))
(add-to-list 'default-frame-alist 
  '(cursor-color . "red"))
(add-to-list 'default-frame-alist 
  '(background-color . "black"))
;; Do you find the beep annoying? This shuts it off.
(setq visible-bell t)
;; This stops it from making those files 
;; ending in tilde (~) everywhere.
(setq make-backup-files nil)
;; This stops the opening splash screen, making the window
;; come up blank.
(setq inhibit-startup-message t)
;; Time+Date insert hack. 
;; M-x insert-time puts a time/date stamp.
;; Like this: 2008-01-17-08:58 Explained here
(defun insert-time ()
  (insert (format-time-string "%Y-%m-%d-%R")))
;; A menu-bar is just a crutch placed there for 
;; disoriented newbies, said the grouchy geek.
(if (fboundp 'scroll-bar-mode) (scroll-bar-mode -1))
(if (fboundp 'tool-bar-mode) (tool-bar-mode -1))
(if (fboundp 'menu-bar-mode) (menu-bar-mode -1))
;; Not sure if I even need to do this any more, 
;; but this is how you load a language mode. 
;; In this case, Python.
(setq auto-mode-alist 
  (cons '("\\.py$" . python-mode) auto-mode-alist))
(setq interpreter-mode-alist 
  (cons '("python" . python-mode) interpreter-mode-alist))
(autoload 'python-mode "python-mode" 
  "Python editing mode." t)

;; My custom Elisp programs, from Emacs_Lisp folder
;; ------------------------------------------------
;; Word-wrap instead of fill-mode!
;; Get it here.
(autoload 'longlines-mode "~/Emacs_Lisp/longlines.el"
  "Minor mode for editing long lines." t)
;; Use the mouse scrollwheel in XEmacs!
;; I no longer know where to get this. 
;; Maybe it's part of standard base now.
;; If anybody wants it, I'll post it.
;; Note - it always says "failed to define function..."
;; but it gives me the mouse wheel anyway!
(autoload 'mouse-wheel-mode "~/Emacs_Lisp/mousewheel.el"
  "Enables scrool-wheel" t)
;; Sokoban. Get it here.
(autoload 'sokoban "~/Emacs_Lisp/Sokoban/sokoban.el"
  "Start a new game of Sokoban." t)
(autoload 'sokoban-mode "~/Emacs_Lisp/Sokoban/sokoban.el"
  "Play Sokoban in current buffer." t)
(setq sokoban-levels-dir 
;; MazeMax. It generates a quick maze, 
;; for whatever purpose.
;; Get it here.
(autoload 'mazemax "~/Emacs_Lisp/mazemax.el"
  "Generate mazes." t)

Well, commenters, it's your turn! What cool new tricks have you taught Emacs lately?

Side-note: Yes, it has been ten days since my last post. A record! What can I say, it's been a crazy month...

Follow me on Twitter for an update every time this blog gets a post.
Stumble it Reddit this share on Facebook

blog comments powered by Disqus
suddenly the moon