diff --git a/emacs.d/functions.el b/emacs.d/functions.el index 9035d34..9e831db 100644 --- a/emacs.d/functions.el +++ b/emacs.d/functions.el @@ -179,10 +179,7 @@ Currently adds | & ! . + = - / % * , < > ? : ->" (defun on-html-mode () (local-set-key [f9] 'browse-to-current-file) - (auto-fill-mode)) - -(defun on-markdown-mode () - (whitespace-mode) + (setq fill-column 73) (auto-fill-mode)) (defun on-php-mode () diff --git a/emacs.el b/emacs.el index 0e17e20..fc3dbbc 100644 --- a/emacs.el +++ b/emacs.el @@ -1,7 +1,7 @@ ;; -*- mode: Emacs-Lisp; -*- (add-to-list 'load-path "~/.emacs.d/elisp") -;; Autopair +;;; Autopair (require 'autopair) (autopair-global-mode t) ; automatically add the other delimiter (setq autopair-skip-criteria 'always @@ -25,7 +25,7 @@ (lambda () (set-column-markers 76 81))) -;; Org mode +;;; Org mode (require 'org-crypt) (require 'org-publish) (setq @@ -61,21 +61,50 @@ (auto-fill-mode t))) (org-crypt-use-before-save-magic) +;;; Rainbow delimiters +(add-to-list 'load-path "~/.emacs.d/elisp/rainbow-delimiters") +(require 'rainbow-delimiters) +(setq rainbow-delimiters-max-face-count 8) + +;;; Uniquify +(require 'uniquify) +(setq uniquify-buffer-name-style 'post-forward) + +;;; Go +(autoload 'go-mode "go-mode" "Major mode for google go" t) +(autoload 'gofmt "go-mode" "" t) +(autoload 'go-fmt-before-save "go-mode" "" t) +(add-to-list 'auto-mode-alist '("\\.go$" . go-mode)) +(add-hook 'go-mode-hook + (lambda () + (turn-off-auto-fill) + (column-marker-1 -1))) + +;;; Htmlize +(require 'htmlize) +(setq htmlize-output-type 'inline-css) + +;;; Git +(require 'git) + +;;; Markdown mode (add-to-list 'load-path "~/.emacs.d/elisp/markdown-mode") +(autoload 'markdown-mode "markdown-mode" "Major mode for Markdown" t) +(setq whitespace-style '(face trailing)) ; For use with markdown mode +(add-to-list 'auto-mode-alist '("\\.m\\(ark\\)?do?wn$". markdown-mode)) +(add-hook 'markdown-mode-hook + (lambda () + (whitespace-mode 1) + (turn-on-auto-fill))) + (add-to-list 'load-path "~/.emacs.d/elisp/git-commit-mode") (add-to-list 'load-path "~/.emacs.d/elisp/lua-mode") (add-to-list 'load-path "~/.emacs.d/elisp/pi-php-mode") -(add-to-list 'load-path "~/.emacs.d/elisp/rainbow-delimiters") (add-to-list 'load-path "~/.emacs.d/elisp/rainbow") ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; REQUIRES ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -(require 'rainbow-delimiters) -(require 'uniquify) -(require 'server) -(require 'htmlize) -(require 'git) (load-file "~/.emacs.d/functions.el") ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -89,15 +118,10 @@ (autoload 'php-mode "pi-php-mode" "Major mode for PHP" t) (autoload 'graphviz-dot-mode "graphviz-dot-mode" "Major mode for dot" t) (autoload 'cmake-mode "cmake-mode" "Major mode for CMake" t) -(autoload 'markdown-mode "markdown-mode" "Major mode for Markdown" t) (autoload 'rainbow-mode "rainbow-mode" "Minor mode for colors" t) (autoload 'stumpwm-mode "stumpwm-mode" "Major mode for stumpwm" t) (autoload 'muttrc-mode "muttrc-mode" "Major mode for muttrc" t) -;; Go -(autoload 'go-mode "go-mode" "Major mode for google go" t) -(autoload 'gofmt "go-mode" "" t) -(autoload 'go-fmt-before-save "go-mode" "" t) -(autoload 'git-commit-mode "git-commit" "" t) +(autoload 'git-commit-mode "git-commit" "" t) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; VARIABLES ;; @@ -117,6 +141,7 @@ (setq-default indent-tabs-mode nil) ; spaces, no tabs (setq-default truncate-lines t) ; don't wrap (setq-default php-warn-if-mumamo-off nil) ; don't warn me about this +(setq-default tab-width 4) (setq inhibit-startup-message t) ; Don't show welcome screen (setq require-final-newline t) ; Always put final newline @@ -124,10 +149,8 @@ (setq scroll-conservatively 101) ; scroll only one line (setq browse-url-browser-function 'browse-url-generic) (setq browse-url-generic-program (getenv "BROWSER")) -(setq whitespace-style '(face trailing)) ; For use with markdown mode (setq uniquify-buffer-name-style 'reverse) (setq jit-lock-defer-time 0.2) ; Don't fontlock immediately -(setq htmlize-output-type 'inline-css) (setq ido-save-directory-list-file nil) (setq ido-auto-merge-delay-time 2) ; Wait before fixing names (setq mouse-autoselect-window t) @@ -176,12 +199,10 @@ (add-to-list 'auto-mode-alist '("\\.lua$" . lua-mode)) (add-to-list 'auto-mode-alist '("\\.php[345]?$" . php-mode)) (add-to-list 'auto-mode-alist '("\\.js\\(on\\)?$" . js-mode)) -(add-to-list 'auto-mode-alist '("\\.m\\(ark\\)?do?wn$". markdown-mode)) (add-to-list 'auto-mode-alist '("CMakeLists\\.txt$" . cmake-mode)) (add-to-list 'auto-mode-alist '("\\.cmake$" . cmake-mode)) (add-to-list 'auto-mode-alist '("\\.css$" . css-mode)) (add-to-list 'auto-mode-alist '("stumpwmrc" . stumpwm-mode)) -(add-to-list 'auto-mode-alist '("\\.go$" . go-mode)) (add-to-list 'auto-mode-alist '(".*mutt.*" . message-mode)) (add-to-list 'auto-mode-alist '("COMMIT_EDITMSG$" . git-commit-mode)) @@ -209,7 +230,6 @@ (add-hook 'prog-mode-hook 'on-prog-mode) (add-hook 'c-mode-hook 'on-c-mode) (add-hook 'html-mode-hook 'on-html-mode) -(add-hook 'markdown-mode-hook 'on-markdown-mode) (add-hook 'php-mode-hook 'on-php-mode) (add-hook 'message-mode-hook 'on-mail-mode) (add-hook 'git-commit-mode-hook 'auto-fill-mode)