Skip to content

Instantly share code, notes, and snippets.

@wecing
Created March 25, 2013 09:49
Show Gist options
  • Save wecing/5236053 to your computer and use it in GitHub Desktop.
Save wecing/5236053 to your computer and use it in GitHub Desktop.
My Emacs configure file (Mar. 25, 2013)
(add-to-list 'load-path "~/.emacs.d/")
;;; ; command=>meta
; (setq mac-command-modifier 'meta)
; for aquamacs: fullscreen
(global-set-key (kbd "<M-f12>") 'ns-toggle-fullscreen)
;;; scratch mode
(setq initial-major-mode 'text-mode)
(setq initial-scratch-message "")
;;; column number
(setq column-number-mode t)
(setq inhibit-startup-message t)
;;; tabs
(setq-default indent-tabs-mode nil)
(setq-default tab-width 4)
(setq indent-line-function 'insert-tab)
;;; bars
; (menu-bar-mode nil)
; (scroll-bar-mode nil)
; (tool-bar-mode nil)
; (tool-bar-mode)
;;; parentheses
(show-paren-mode t)
(setq show-paren-style 'parentheses)
;;; mouse
(mouse-avoidance-mode 'animate)
;;; title
(setq frame-title-format "%b @ emacs")
;;; time
(display-time-mode 1)
;;; ibuffer
(require 'ibuffer)
(global-set-key (kbd "C-x C-b") 'ibuffer)
;;; previous window
(global-set-key (kbd "C-x p") 'previous-multiframe-window)
;;; ido
(require 'ido)
(add-hook 'term-setup-hook 'ido-mode)
;;; c & style
(setq c-default-style "k&r")
(add-hook 'java-mode-hook (lambda () (c-set-style "java")))
;;; long line auto wrap
; (add-hook 'text-mode-hook (lambda () (longlines-mode)))
;;; frame size?
(setq initial-frame-alist
(append '((width . 75) (height . 43)) initial-frame-alist))
; ;;; $PATH in eshell
; (add-hook 'eshell-mode-hook
; '(lambda nil
; (let ((path (getenv "PATH")))
; (setq path (concat path ":/opt/local/bin"))
; (setenv "PATH" path))))
;;; color theme
; (require 'color-theme)
; (color-theme-initialize)
; (color-theme-jsc-dark)
;;; font - consolas in mac is good enough for coding
; (add-to-list 'default-frame-alist '(font . "-outline-Bitstream Vera Sans Mono-normal-r-normal-normal-12-90-96-96-c-*-iso8859-1"))
; (add-to-list 'default-frame-alist '(width . 77))
; (add-to-list 'default-frame-alist '(height . 49))
;;; slime
;; (add-to-list 'load-path "~/.emacs.d/slime")
;; ;(add-to-list 'load-path "~/.emacs.d/slime/contrib")
;; (setq inferior-lisp-program "clisp")
;; (require 'slime) ;(require 'slime-autoloads)
;; (slime-setup '(slime-fancy slime-banner slime-repl)) ;; slime-asdf?
;;; clojure-mode
; (add-to-list 'load-path "~/.emacs.d/clojure-mode")
; (require 'clojure-mode)
;;; swank-clojure: removed
;(add-to-list 'load-path "~/.emacs.d/swank-clojure/src/emacs")
;(setq swank-clojure-jar-path "/usr/share/clojure-1.2/lib/clojure.jar"
; swank-clojure-extra-classpaths
; (list "~/.emacs.d/swank-clojure/src/main/clojure"))
;(require 'swank-clojure-autoload)
;(eval-after-load "slime"
; '(progn (slime-setup '(slime-repl))))
;;; tabbar
;(require 'tabbar)
;;(tabbar-mode)
;(global-set-key (kbd "C-M-;") 'tabbar-backward-group)
;(global-set-key (kbd "C-M-'") 'tabbar-forward-group)
;(global-set-key (kbd "C-;") 'tabbar-backward)
;(global-set-key (kbd "C-'") 'tabbar-forward)
;;; in case of recursive load
;;; (maybe not needed anymore from emacs 24.0.50?)
;(tramp-unload-tramp)
; (setq tramp-mode nil)
; (add-to-list 'load-path "/usr/share/emacs/site-lisp/tex-utils")
; (require 'xdvi-search)
;;; what is this?
(put 'upcase-region 'disabled nil)
;; 80 column rule
;(require 'column-marker)
;(add-hook 'c-mode-hook
; (lambda ()
; (interactive)
; (column-marker-1 80)))
;;; vala mode
; (autoload 'vala-mode "vala-mode" "Major mode for editing Vala code." t)
; (add-to-list 'auto-mode-alist '("\\.vala$" . vala-mode))
; (add-to-list 'auto-mode-alist '("\\.vapi$" . vala-mode))
; (add-to-list 'file-coding-system-alist '("\\.vala$" . utf-8))
; (add-to-list 'file-coding-system-alist '("\\.vapi$" . utf-8))
;;; eshell ignore case
(setq eshell-cmpl-ignore-case t)
;;; make output of ls RET-able
; (eval-after-load "em-ls"
; '(progn
; (defun ted-eshell-ls-find-file-at-point (point)
; "RET on Eshell's `ls' output to open files."
; (interactive "d")
; (find-file (buffer-substring-no-properties
; (previous-single-property-change point 'help-echo)
; (next-single-property-change point 'help-echo))))
;
; (defun pat-eshell-ls-find-file-at-mouse-click (event)
; "Middle click on Eshell's `ls' output to open files.
; From Patrick Anderson via the wiki."
; (interactive "e")
; (ted-eshell-ls-find-file-at-point (posn-point (event-end event))))
;
; (let ((map (make-sparse-keymap)))
; (define-key map (kbd "RET") 'ted-eshell-ls-find-file-at-point)
; (define-key map (kbd "<return>") 'ted-eshell-ls-find-file-at-point)
; (define-key map (kbd "<mouse-2>") 'pat-eshell-ls-find-file-at-mouse-click)
; (defvar ted-eshell-ls-keymap map))
;
; (defadvice eshell-ls-decorated-name (after ted-electrify-ls activate)
; "Eshell's `ls' now lets you click or RET on file names to open them."
; (add-text-properties 0 (length ad-return-value)
; (list 'help-echo "RET, mouse-2: visit this file"
; 'mouse-face 'highlight
; 'keymap ted-eshell-ls-keymap)
; ad-return-value)
; ad-return-value)))
; Die, die!
;
; ;;; nxhtml: for mixing html with PHP/eruby...
; (load "~/.emacs.d/nxhtml/autostart")
;
; ;;; php-mode
; (autoload 'php-mode "php-mode" "Major mode for editing php code." t)
; (add-to-list 'auto-mode-alist '("\\.php$" . php-mode))
; (add-to-list 'auto-mode-alist '("\\.inc$" . php-mode))
; (defun clean-php-mode ()
; (interactive)
; (php-mode)
; (setq c-basic-offset 2) ; 2 tabs indenting
; (setq indent-tabs-mode nil)
; ; (setq fill-column 78)
; (c-set-offset 'case-label '+)
; (c-set-offset 'arglist-close 'c-lineup-arglist-operators))
; (c-set-offset 'arglist-intro '+) ; for FAPI arrays and DBTNG
; (c-set-offset 'arglist-cont-nonempty 'c-lineup-math) ; for DBTNG fields and values
;; '(custom-enabled-themes (quote (wombat)))
(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.
'(column-number-mode t)
'(custom-enabled-themes (quote (wombat)))
'(display-time-mode t)
'(scroll-bar-mode nil)
'(show-paren-mode t)
'(tool-bar-mode nil))
(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.
)
; (add-to-list 'package-archives
; '("marmalade" . "http://marmalade-repo.org/packages/"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment