Monday, December 22, 2008

.emacs file

;; .emacs

;;; uncomment this line to disable loading of "default.el" at startup
;; (setq inhibit-default-init t)

;; turn on font-lock mode
(when (fboundp 'global-font-lock-mode)
(global-font-lock-mode t))

;; enable visual feedback on selections
(setq transient-mark-mode nil)

;; default to better frame titles
(setq frame-title-format
(concat "%b - emacs@" (system-name)))

;; default to unified diffs
(setq diff-switches "-u")

;; always end a file with a newline
;(setq require-final-newline 'query)

;; this line makes the window render the font much
;; quicker on startup
(modify-frame-parameters nil '((wait-for-wm . nil)))

;; set the font
;;(set-default-font "-adobe-courier-medium-r-normal--18-180-75-75-m-110-iso8859-1")

;; don't sound the system bell on errors
(setq visible-bell t)

;; setting the compilation window height
(setq compilation-window-height 8)

;; setting tab/spacing settings
(setq indent-tabs-mode nil)
(setq c-basic-offset 4)
(setq tab-width 4)

;; change all the yes/no questions to y/n
(fset 'yes-or-no-p 'y-or-n-p)

;; key bindings
(global-set-key [f3] 'isearch-forward-regexp)
(global-set-key [f4] 'next-error)
(global-set-key [f5] 'tempo-complete-tag)
(global-set-key [f6] 'compile)
(global-set-key [f8] 'shell)
(global-set-key [f11] 'list-buffers)
(global-set-key [f12] 'shell)

;; navigation key bindings similar to VI
(global-set-key "\M-j" 'next-line)
(global-set-key "\M-k" 'previous-line)
(global-set-key "\M-l" 'forward-char)
(global-set-key "\M-h" 'backward-char)

;; use C++ mode for .h files instead of plain old C mode
(setq auto-mode-alist (cons '("\\.h$" . c++-mode) auto-mode-alist))

;; "M-x reload-buffer" will revert-buffer without requiring confirmation
(defun reload-buffer ()
"revert-buffer without confirmation"
(interactive)
(revert-buffer t t))

;; do not make a backup file
(setq make-backup-files nil)

;; add my custom dir to the load path
(add-to-list 'load-path (expand-file-name "~/emacs"))
(add-to-list 'load-path "~/emacs/plugins/yasnippet")

(require 'yasnippet)

(yas/initialize)
(yas/load-directory (expand-file-name "~/emacs/plugins/yasnippet/snippets/"))
(yas/minor-mode-on)

(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(inhibit-startup-screen t)
'(text-mode-hook (quote (turn-on-auto-fill text-mode-hook-identify))))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
)

;;(set-default-font "Bitstream Vera Sans Mono-12")
;;(set-default-font “Monospace-11”)

0 comments: