# HG changeset patch # User Luke Hoersten # Date 1260723986 21600 # Node ID 7b7afa6e09a681429aae7c6b00f573924ac0fd65 # Parent 4fc155f601d6e617b48c7b9fd53ba3feb977e9de Refactored setq calls to use the multi-variable form. diff -r 4fc155f601d6 -r 7b7afa6e09a6 hoersten-c-style.el --- a/hoersten-c-style.el Sun Dec 13 11:05:49 2009 -0600 +++ b/hoersten-c-style.el Sun Dec 13 11:06:26 2009 -0600 @@ -2,68 +2,72 @@ ;; Luke Hoersten ;; hoersten c++-style -(c-add-style "hoersten" - '(;; indentation - (indent-tabs-mode . t) - (tab-width . 3) - (c-basic-offset . 3) +(c-add-style + "hoersten" + '(;; indentation + (indent-tabs-mode . t) + (tab-width . 3) + (c-basic-offset . 3) - ;; brace cleanups - (c-cleanup-list - brace-else-brace - brace-elseif-brace - brace-catch-brace - empty-defun-braces - defun-close-semi - list-close-comma - scope-operator) + ;; brace cleanups + (c-cleanup-list + brace-else-brace + brace-elseif-brace + brace-catch-brace + empty-defun-braces + defun-close-semi + list-close-comma + scope-operator) - ;; syntactic symbols - (c-offsets-alist - (substatement-open . 0) - (inline-open . 0) - (case-label . +) - (innamespace . 0) - (arglist-cont-nonempty . +) - (cpp-macro . -)))) + ;; syntactic symbols + (c-offsets-alist + (substatement-open . 0) + (inline-open . 0) + (case-label . +) + (innamespace . 0) + (arglist-cont-nonempty . +) + (cpp-macro . -)))) ;; c-like language settings (c, c++, java, etc.) ;;(require 'doxymacs) (setq-default c-hungry-delete-key t) ; enable hungry delete (setq-default c-default-style "hoersten") ; load c-style -(add-hook 'c-mode-common-hook - (lambda () - ;; indentation - (setq tab-width 3) - (setq c-basic-offset 3) - (setq indent-tabs-mode t) - (setq standard-indent 3) - (setq whitespace-line-column 120) +(add-hook + 'c-mode-common-hook + (lambda () + ;; indentation + (setq + tab-width 3 + c-basic-offset 3 + indent-tabs-mode t + standard-indent 3 + whitespace-line-column 120) - (c-toggle-auto-newline t) ; auto newline - (c-subword-mode t) - ;;(doxymacs-mode t) - ;;(doxymacs-font-lock) + (c-toggle-auto-newline t) ; auto newline + (c-subword-mode t) + ;;(doxymacs-mode t) + ;;(doxymacs-font-lock) - ;; custom keys - (local-set-key (kbd "C-c f") 'ff-find-other-file) ; toggle header/source file - (local-set-key (kbd "C-c C-c") 'comment-or-uncomment-region) + ;; custom keys + (local-set-key (kbd "C-c f") 'ff-find-other-file) ; toggle header/source file + (local-set-key (kbd "C-c C-c") 'comment-or-uncomment-region) - ;; code folding - (local-set-key (kbd "C-c v") 'hs-toggle-hiding) - (local-set-key (kbd "") 'hs-hide-all) - (local-set-key (kbd "") 'hs-show-all) - (hs-minor-mode t) ; enable hide-show mode + ;; code folding + (local-set-key (kbd "C-c v") 'hs-toggle-hiding) + (local-set-key (kbd "") 'hs-hide-all) + (local-set-key (kbd "") 'hs-show-all) + (hs-minor-mode t) ; enable hide-show mode - ;; gdb settings - (setq gdb-many-windows t) ; gdb many windows - (setq gdb-use-separate-io-buffer t) ; gdb stdio output - (setq gud-tooltip-mode t) ; mouse hover variables - (local-set-key (kbd "C-c g") 'gdb) ; gdb + ;; gdb settings + (setq + gdb-many-windows t ; gdb many windows + gdb-use-separate-io-buffer t ; gdb stdio output + setq gud-tooltip-mode t) ; mouse hover variables + (local-set-key (kbd "C-c g") 'gdb) ; gdb - ;; auto-close bracing - (dolist (key '("(" "[")) (define-key (current-local-map) key 'insert-pair)) - )) + ;; auto-close bracing + (dolist (key '("(" "[")) (define-key (current-local-map) key 'insert-pair)) + )) (add-to-list 'auto-mode-alist '("\\.ipp$" . c++-mode)) (add-to-list 'auto-mode-alist '("\\.inl$" . c++-mode)) diff -r 4fc155f601d6 -r 7b7afa6e09a6 init.el --- a/init.el Sun Dec 13 11:05:49 2009 -0600 +++ b/init.el Sun Dec 13 11:06:26 2009 -0600 @@ -2,46 +2,50 @@ ;; Luke Hoersten ;; general -(setq-default load-path (cons "~/.emacs.d/" load-path)) ; set default emacs load path +(add-to-list 'load-path "~/.emacs.d/") ; set default emacs load path -(setq-default ediff-split-window-function 'split-window-horizontally) ; diff horizontally -(setq-default x-select-enable-clipboard t) ; paste from X buffer -(setq-default inhibit-splash-screen t) ; disable splash screen -(setq-default truncate-lines t) -(put 'set-goal-column 'disabled nil) ; enable goal column setting -(put 'narrow-to-region 'disabled nil) ; enable hiding +(setq-default + ediff-split-window-function 'split-window-horizontally ; diff horizontally + x-select-enable-clipboard t ; paste from X buffer + inhibit-splash-screen t ; disable splash screen + truncate-lines t ; truncate, not wrap, lines + indent-tabs-mode nil) ; mouse hover variables -(menu-bar-mode nil) ; remove menu bar -(display-time-mode t) ; show clock -(column-number-mode t) ; show column numbers -(delete-selection-mode t) ; replace highlighted text -(windmove-default-keybindings) ; move between windows with shift-arrow -(setq-default indent-tabs-mode nil) ; mouse hover variables -(ido-mode t) ; file/buffer selector -(setq-default ido-enable-flex-matching t) ; fuzzy matching for ido mode -(add-hook 'text-mode-hook 'flyspell-mode t) ; spellcheck text +(put 'set-goal-column 'disabled nil) ; enable goal column setting +(put 'narrow-to-region 'disabled nil) ; enable hiding + +(menu-bar-mode nil) ; remove menu bar +(display-time-mode t) ; show clock +(column-number-mode t) ; show column numbers +(delete-selection-mode t) ; replace highlighted text +(windmove-default-keybindings) ; move between windows with shift-arrow +(ido-mode t) ; file/buffer selector +(setq-default ido-enable-flex-matching t) ; fuzzy matching for ido mode +(add-hook 'text-mode-hook 'flyspell-mode t) ; spellcheck text +(add-hook 'text-mode-hook 'turn-on-aut-fill) ; autofill text ;; whitespace -(global-whitespace-mode t) ; show whitespace -(add-hook 'before-save-hook 'whitespace-cleanup) ; cleanup whitespace on exit -(setq-default whitespace-line-column 120) ; column width -(setq-default whitespace-style - '(tabs tab-mark trailing lines-tail - space-before-tab indentation empty)) ; what whitespace elements to show +(global-whitespace-mode t) ; show whitespace +(add-hook 'before-save-hook 'whitespace-cleanup) ; cleanup whitespace on exit +(setq-default + whitespace-line-column 120 ; column width + whitespace-style ; whitespace elements to show + '(tabs tab-mark trailing lines-tail + space-before-tab indentation empty)) ;; coding -(which-func-mode t) ; show current function -(show-paren-mode t) ; show matching paren -(transient-mark-mode t) ; show highlighting -(global-font-lock-mode t) ; syntax highlighting -(global-set-key (kbd "C-c c") 'compile) ; compile -(global-set-key (kbd "C-c r") 'recompile) ; recompile +(which-func-mode t) ; show current function +(show-paren-mode t) ; show matching paren +(transient-mark-mode t) ; show highlighting +(global-font-lock-mode t) ; syntax highlighting +(global-set-key (kbd "C-c c") 'compile) ; compile +(global-set-key (kbd "C-c r") 'recompile) ; recompile ;; includes -(require 'hoersten-pastebin-region) ; send selected text to pastebin -(require 'mercurial) ; load mercurial mode -(require 'nav) ; load nav bar -(require 'hoersten-c-style) ; load c specific lisp +(require 'hoersten-pastebin-region) ; send selected text to pastebin +(require 'mercurial) ; load mercurial mode +(require 'nav) ; load nav bar +(require 'hoersten-c-style) ; load c specific lisp ;; unicode (require 'pretty-mode) @@ -53,19 +57,9 @@ (yas/initialize) (yas/load-directory "~/.emacs.d/snippets/") -;; shell -(global-set-key (kbd "C-c s") 'shell) ; start shell -(ansi-color-for-comint-mode-on) ; color in shell buffer -(setq-default comint-scroll-to-bottom-on-input t) ; only type on prompt -(setq-default comint-scroll-show-maximum-output t) ; place text at bottom - -;; org mode -(add-hook 'org-mode-hook - '(lambda () - (local-set-key (kbd "M-p") 'org-move-item-up) - (local-set-key (kbd "M-S-p") 'org-move-subtree-up) - (local-set-key (kbd "M-n") 'org-move-item-down) - (local-set-key (kbd "M-S-n") 'org-move-subtree-down))) +;; zencoding html +(require 'zencoding-mode) +(add-hook 'sgml-mode-hook 'zencoding-mode) ; Auto-start on any markup modes ;; unique buffer names with dirs (require 'uniquify) @@ -73,18 +67,35 @@ uniquify-buffer-name-style 'post-forward uniquify-separator ":") +;; shell +(global-set-key (kbd "C-c s") 'shell) ; start shell +(ansi-color-for-comint-mode-on) ; color in shell buffer +(setq-default + comint-scroll-to-bottom-on-input t ; only type on prompt + comint-scroll-show-maximum-output t) ; place text at bottom + +;; org mode +(add-hook + 'org-mode-hook + '(lambda () + (local-set-key (kbd "M-p") 'org-move-item-up) + (local-set-key (kbd "M-S-p") 'org-move-subtree-up) + (local-set-key (kbd "M-n") 'org-move-item-down) + (local-set-key (kbd "M-S-n") 'org-move-subtree-down))) + ;; line numbers ;;(global-linum-mode t) -(mapc (lambda (x) - (add-hook x 'linum-mode)) - '(text-mode-hook - c-mode-common-hook - python-mode-hook - haskell-mode-hook - emacs-lisp-mode-hook)) +(mapc + (lambda (x) + (add-hook x 'linum-mode)) + '(text-mode-hook + c-mode-common-hook + python-mode-hook + haskell-mode-hook + emacs-lisp-mode-hook)) ;; use only spaces for alignment -(global-set-key (kbd "C-c a") 'align-with-spaces) ; align +(global-set-key (kbd "C-c a") 'align-with-spaces) (defun align-with-spaces (beg end pattern) "Align selected using only spaces for whitespace." (interactive "r\nsAlign by: ")