From 01d77b518f4cd4df3179dea5bc88acd89f451e88 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Thu, 28 Mar 2013 01:15:03 +0100 Subject: Emacs: Move everything from init.el to init.org I'll write stuff about it later, as long as it's in the org file for now. --- emacs/init.el | 267 -------------- emacs/init.org | 1092 +++++++++++++++++++++++++++++++++----------------------- 2 files changed, 637 insertions(+), 722 deletions(-) diff --git a/emacs/init.el b/emacs/init.el index fa5a93b..d9dc98c 100644 --- a/emacs/init.el +++ b/emacs/init.el @@ -8,273 +8,6 @@ (load (concat user-emacs-directory "init2")) -(defface git-commit-summary-face - '((t (:inherit org-level-1))) - "Face for the git title line." - :group 'local) - -(defface git-commit-overlong-summary-face - '((t (:background "#873732"))) - "Face for commit titles that are too long." - :group 'local) - -(defface git-commit-nonempty-second-line-face - '((t (:inherit git-commit-overlong-summary-face))) - "Face for the supposedly empty line in commit messages." - :group 'local) - -(eval-after-load "newst-treeview" '(require 'newsticker-init)) -(eval-after-load "org" '(require 'org-init)) -(eval-after-load "rainbow-mode" '(oni:rainbow-mode-init)) -(eval-after-load "smex" '(oni:smex-init)) -(eval-after-load "yasnippet" '(oni:yasnippet-init)) - -(autoload 'define-slime-contrib "slime") -(autoload 'gtags-mode "gtags" nil t) -(autoload 'jabber-connect "jabber" nil t) -(autoload 'php-mode "php-mode" nil t) -(autoload 'po-mode "po-mode" nil t) -(autoload 'pony-mode "pony-mode" nil t) -(autoload 'sawfish-mode "sawfish" nil t) -(autoload 'server-running-p "server") -(autoload 'slime-js-minor-mode "slime-js" nil t) -(autoload 'xmodmap-mode "xmodmap-mode" nil t) -(autoload 'w3m-bookmark-view "w3m" nil t) -(autoload 'w3m-goto-url "w3m" nil t) - -(require 'geiser-install) -(require 'uniquify) -(require 'ext) -(require 'oni) - -(setq-default c-basic-offset 4) -(setq-default fci-rule-column 73) -(setq-default indent-tabs-mode nil) -(setq-default php-mode-warn-if-mumamo-off nil) -(setq-default require-final-newline t) -(setq-default tab-width 4) -(setq-default truncate-lines t) - -(setq appt-disp-window-function #'oni:appt-display-window-and-jabber) -(setq appt-display-diary nil) -(setq auto-mode-case-fold nil) -(setq auto-save-file-name-transforms oni:auto-save-name-transforms) -(setq avandu-article-render-function #'avandu-view-w3m) -(setq backup-directory-alist oni:backup-directory-alist) -(setq browse-url-browser-function 'browse-url-generic) -(setq browse-url-generic-program (getenv "BROWSER")) -(setq c-offsets-alist '((statement-block-intro . +) - (knr-argdecl-intro . 5) - (substatement-open . +) - (substatement-label . 0) - (label . 0) - (statement-case-open . +) - (statement-cont . +) - (arglist-intro . +) - (arglist-close . 0) - (inline-open . 0) - (brace-list-open . +) - (topmost-intro-cont first c-lineup-topmost-intro-cont - c-lineup-gnu-DEFUN-intro-cont))) -(setq comment-auto-fill-only-comments t) -(setq custom-file "~/.emacs.d/custom.el") -(setq custom-theme-directory "~/.emacs.d/themes") -(setq default-frame-alist - `((border-width . 0) - (internal-border-width . 0) - (vertical-scroll-bars . nil) - (menu-bar-lines . nil) - (tool-bar-lines . nil) - (font . "Envy Code R:pixelsize=18"))) -(setq elnode-do-init nil) -(setq fci-rule-color "darkred") -(setq frame-title-format '(:eval (concat "emacs: " (buffer-name)))) -(setq geiser-repl-history-filename "~/.emacs.d/geiser-history") -(setq gnus-init-file "~/.emacs.d/gnus") -(setq gtags-auto-update t) -(setq help-at-pt-display-when-idle t) -(setq highlight-80+-columns 72) -(setq identica-enable-striping t) -(setq inferior-lisp-program "sbcl") -(setq inhibit-default-init t) -(setq inhibit-local-menu-bar-menus t) -(setq inhibit-startup-message t) -(setq initial-major-mode 'emacs-lisp-mode) -(setq initial-scratch-message nil) -(setq jabber-avatar-cache-directory "~/.emacs.d/jabber-avatars/") -(setq jabber-chat-buffer-format "*jab:%n*") -(setq jabber-chat-buffer-show-avatar nil) -(setq jabber-chat-fill-long-lines nil) -(setq jabber-chat-foreign-prompt-format "%t %u/%r <\n") -(setq jabber-chat-local-prompt-format "%t %u/%r >\n") -(setq jabber-chatstates-confirm nil) -(setq jabber-muc-autojoin '("aethon@muc.ryuslash.org")) -(setq jabber-roster-show-bindings nil) -(setq jabber-vcard-avatars-publish nil) -(setq jabber-vcard-avatars-retrieve nil) -(setq jit-lock-defer-time 0.2) -(setq magit-repo-dirs '("~/projects/" "~/var/src/")) -(setq message-log-max 1000) -(setq message-send-mail-function 'message-send-mail-with-sendmail) -(setq message-sendmail-extra-arguments '("-a" "ryuslash")) -(setq package-archives - '(("melpa" . "http://melpa.milkbox.net/packages/") - ("marmalade" . "http://marmalade-repo.org/packages/") - ("gnu" . "http://elpa.gnu.org/packages/"))) -(setq package-load-list '((htmlize "1.39") - (lua-mode "20111107") - all)) -(setq php-function-call-face 'font-lock-function-name-face) -(setq php-mode-force-pear t) -(setq pony-tpl-indent-moves t) -(setq rainbow-delimiters-max-face-count 12) -(setq redisplay-dont-pause t) -(setq send-mail-function 'smtpmail-send-it) -(setq sendmail-program "/usr/bin/msmtp") -(setq sentence-end-double-space nil) -(setq smex-key-advice-ignore-menu-bar t) -(setq smex-save-file "~/.emacs.d/smex-items") -(setq split-height-threshold 40) -(setq time-stamp-active t) -(setq time-stamp-format "%04y-%02m-%02d %02H:%02M:%02S (%u)") -(setq type-break-good-rest-interval (* 60 10)) -(setq type-break-interval (* 60 50)) -(setq type-break-keystroke-threshold '(nil . nil)) -(setq uniquify-buffer-name-style 'post-forward) -(setq use-dialog-box nil) -(setq user-full-name "Tom Willemsen") -(setq user-mail-address "tom@ryuslash.org") -(setq w3m-fill-column 72) -(setq window-combination-resize t) -(setq yas-fallback-behavior nil) -(setq yas-prompt-functions '(yas-ido-prompt)) - -(add-hook 'after-change-major-mode-hook 'set-current-mode-icon) -(add-hook 'after-save-hook 'oni:after-save-func t) -(add-hook 'before-save-hook 'oni:before-save-func) -(add-hook 'c-mode-hook 'oni:c-mode-func) -(add-hook 'css-mode-hook 'oni:css-mode-func) -(add-hook 'diary-display-hook 'oni:diary-display-func) -(add-hook 'emacs-startup-hook 'oni:emacs-startup-func) -(add-hook 'emacs-lisp-mode-hook 'oni:emacs-lisp-mode-func) -(add-hook 'go-mode-hook 'oni:go-mode-func) -(add-hook 'gtags-mode-hook 'oni:gtags-mode-func) -(add-hook 'haskell-mode-hook 'oni:haskell-mode-func) -(add-hook 'html-mode-hook 'oni:html-mode-func) -(add-hook 'jabber-chat-mode-hook 'oni:jabber-chat-mode-func) -(add-hook 'jabber-roster-mode-hook 'oni:jabber-roster-mode-func) -(add-hook 'java-mode-hook 'oni:java-mode-func) -(add-hook 'js-mode-hook 'oni:js-mode-func) -(add-hook 'js2-mode-hook 'oni:js2-mode-func) -(add-hook 'lua-mode-hook 'oni:lua-mode-func) -(add-hook 'magit-log-edit-mode-hook 'oni:magit-log-edit-mode-func) -(add-hook 'markdown-mode-hook 'oni:markdown-mode-func) -(add-hook 'message-mode-hook 'oni:message-mode-func) -(add-hook 'org-mode-hook 'oni:org-mode-func) -(add-hook 'php-mode-hook 'oni:php-mode-func) -(add-hook 'prog-mode-hook 'oni:prog-mode-func) -(add-hook 'python-mode-hook 'oni:python-mode-func) -(add-hook 'rst-mode-hook 'oni:rst-mode-func) -(add-hook 'term-mode-hook 'oni:term-mode-func) -(add-hook 'texinfo-mode-hook 'oni:texinfo-mode-func) -(add-hook 'write-file-hooks 'oni:write-file-func) -(add-hook 'yas-minor-mode-hook 'oni:yas-minor-mode-func) - -(define-key key-translation-map (kbd "C-j") (kbd "C-l")) -(define-key key-translation-map (kbd "C-l") (kbd "C-j")) - -(global-set-key (kbd "'") 'oni:self-insert-dwim) -(global-set-key (kbd "") 'oni:raise-scratch) -(global-set-key (kbd "") 'gnus) -(global-set-key (kbd "") 'git-project-show-files) -(global-set-key (kbd "") 'ext:reload-buffer) -(global-set-key (kbd "") 'jabber-switch-to-roster-buffer) -(global-set-key (kbd "") 'magit-status) -(global-set-key (kbd "") 'oni:show-org-index) -(global-set-key (kbd "C-<") 'oni:indent-shift-left) -(global-set-key (kbd "C->") 'oni:indent-shift-right) -(global-set-key (kbd "C-M-4") 'split-window-vertically) -(global-set-key (kbd "C-M-SPC") 'er/expand-region) -(global-set-key (kbd "C-M-d") 'kill-word) -(global-set-key (kbd "C-M-w") 'backward-kill-word) -(global-set-key (kbd "C-S-k") 'kill-whole-line) -(global-set-key (kbd "C-a") 'oni:move-beginning-of-dwim) -(global-set-key (kbd "C-c a") 'org-agenda) -(global-set-key (kbd "C-c c") 'org-capture) -(global-set-key (kbd "C-c i p") 'identica-update-status-interactive) -(global-set-key (kbd "C-c p") 'oni:show-buffer-position) -(global-set-key (kbd "C-c t") 'oni:raise-ansi-term) -(global-set-key (kbd "C-d") 'oni:kill-region-or-forward-char) -(global-set-key (kbd "C-e") 'oni:move-end-of-dwim) -(global-set-key (kbd "C-k") 'oni:kill-region-or-line) -(global-set-key (kbd "C-w") 'oni:kill-region-or-backward-char) -(global-set-key (kbd "M-0") 'delete-window) -(global-set-key (kbd "M-1") 'delete-other-windows) -(global-set-key (kbd "M-2") 'split-window-below) -(global-set-key (kbd "M-3") 'split-window-right) -(global-set-key (kbd "M-4") 'split-window-horizontally) -(global-set-key (kbd "M-o") 'other-window) -(global-set-key (kbd "\"") 'oni:self-insert-dwim) - -(if (daemonp) - (global-set-key "\C-x\C-c" 'oni:close-client-window)) - -(when (or window-system (daemonp)) - (global-unset-key "\C-z")) - -(add-to-list 'auto-mode-alist '("\\.jl$" . sawfish-mode)) -(add-to-list 'auto-mode-alist '("\\.js\\(on\\)?$" . js2-mode)) -(add-to-list 'auto-mode-alist - '("\\.m\\(ark\\)?d\\(?:o?wn\\)?$" . markdown-mode)) -(add-to-list 'auto-mode-alist '("\\.php[345]?$" . php-mode)) -(add-to-list 'auto-mode-alist '("\\.po\\'\\|\\.po\\." . po-mode)) -(add-to-list 'auto-mode-alist '("\\.tpl$" . html-mode)) -(add-to-list 'auto-mode-alist '("^PKGBUILD$" . shell-script-mode)) -(add-to-list 'auto-mode-alist '("^\\.Xmodmap$" . xmodmap-mode)) - -(add-to-list 'debug-ignored-errors "^Can't shift all lines enough") - -(add-to-list - 'display-buffer-alist - '("^\\*\\(?:.+-\\)?scratch\\*$" . ((display-buffer-same-window . nil)))) -(add-to-list - 'display-buffer-alist - '("^\\*git-project-list\\*$" . ((git-project-show-window . nil)))) -(add-to-list - 'display-buffer-alist - '("^\\*magit: .*\\*$" . ((display-buffer-same-window . nil)))) - -(add-to-list 'compilation-finish-functions 'ext:comp-finish-function) - -(blink-cursor-mode -1) -(column-number-mode -1) -(line-number-mode -1) -(tooltip-mode -1) - -(package-initialize) - -(auto-insert-mode) -(cua-selection-mode t) -(electric-indent-mode) -(electric-pair-mode) -(savehist-mode) -(show-paren-mode) -(winner-mode) - -(smex-initialize) -(help-at-pt-set-timer) -(windmove-default-keybindings) -(global-diff-hl-mode) - -(load custom-file) -;; (load "rudel-loaddefs.el") -(load (expand-file-name "~/quicklisp/slime-helper.el")) - -(unless (server-running-p) - (server-start)) - -(diminish 'auto-fill-function "_") - (provide 'init) ;;; init.el ends here diff --git a/emacs/init.org b/emacs/init.org index 531e6d5..95536a7 100644 --- a/emacs/init.org +++ b/emacs/init.org @@ -92,195 +92,185 @@ functionality, plus more. (add-hook 'scheme-mode-hook 'paredit-mode) #+END_SRC -* flymake - - Load ~flymake-cursor~ after loading ~flymake~, add Python and Go to - "allowed" files and add go error output to error patterns. - - #+BEGIN_SRC emacs-lisp - (defun oni:flymake-init () - "Initialization function for flymake." - (require 'flymake-cursor) - - (add-to-list ; Make sure pyflakes is loaded - 'flymake-allowed-file-name-masks ; for python files. - '("\\.py\\'" ext:flymake-pyflakes-init)) - - (add-to-list ; Error line repexp for go - 'flymake-err-line-patterns ; compilation. - '("^\\([a-zA-Z0-9_]+\\.go\\):\\([0-9]+\\):\\(.*\\)$" - 1 2 nil 3)) - - (add-to-list ; Go uses makefiles, makes - 'flymake-allowed-file-name-masks ; flymaking 'easy'. - '("\\.go$" flymake-simple-make-init))) - - (eval-after-load "flymake" '(oni:flymake-init)) - #+END_SRC - - Disable the GUI for flymake errors. This causes the flymake errors - to be shown in the minibuffer. - - #+BEGIN_SRC emacs-lisp - (setq flymake-gui-warnings-enabled nil) - #+END_SRC - - Add a bunch of pep8, flymake and pyflakes messages to warning and - info patterns, set the log file to somewhere in my home directory - and set logging level to 0. - - #+BEGIN_SRC emacs-lisp - (setq flymake-info-line-regexp - (eval-when-compile - (regexp-opt - '("Invalid name" - "String statement has no effect" - "Missing docstring" - "Empty docstring" - "multiple imports on one line" - "expected 2 blank lines, found 1" - "expected 2 blank lines, found 0" - "TODO:" - "whitespace after '{'" - "whitespace before '}'" - "whitespace before ':'" - "whitespace after '('" - "whitespace before ')'" - "whitespace after '['" - "whitespace before ']'" - "the backslash is redundant between brackets" - "continuation line over-indented for visual indent" - "continuation line under-indented for visual indent" - "Too many statements" - "comparison to None should be" - "missing whitespace around operator" - "missing whitespace after ','" - "line too long" - "at least two spaces before inline comment" - "trailing whitespace" - "imported but unused" - "Unused import" - "too many blank lines")))) - (setq flymake-log-file-name (expand-file-name "~/.emacs.d/flymake.log")) - (setq flymake-log-level 0) - (setq flymake-warn-line-regexp - (eval-when-compile - (regexp-opt '("warning" - "Warning" - "redefinition of unused" - "Redefining built-in" - "Redefining name" - "Unused argument" - "Unused variable" - "Dangerous default value {} as argument" - "no newline at end of file" - "Access to a protected member")))) - #+END_SRC - -* flycheck - - After loading ~flycheck~ Remove the default python checkers and - replace them with my own, which tries both ~flake8~ and ~pylint~. - - #+BEGIN_SRC emacs-lisp - (eval-after-load "flycheck" - '(progn - (mapc (lambda (c) (delete c flycheck-checkers)) - '(python-pylint python-pyflakes)))) - #+END_SRC - -* pretty-control-l-mode - - Make the ~C-l~ look like a line of ~-~ up to =fill-column= or - =fci-rule-column= and remove the string displayed before the ~C-l~. - - #+BEGIN_SRC emacs-lisp - (defun oni:pretty-control-l-function (win) - "Just make a string of either `fci-rule-column' or - `fill-column' length -1. Use the `-' character. WIN is ignored." - (make-string - (1- (if (boundp 'fci-rule-column) - fci-rule-column fill-column)) ?-)) - - (setq pp^L-^L-string-function 'oni:pretty-control-l-function) - #+END_SRC - - Remove the string displayed before the ~C-l~. - - #+BEGIN_SRC emacs-lisp - (setq pp^L-^L-string-pre nil) - #+END_SRC - - Enable =pretty-control-l-mode= at startup and whenever a new frame is - created. - - #+BEGIN_SRC emacs-lisp - (add-hook 'emacs-startup-hook 'pretty-control-l-mode) - (add-hook 'after-make-frame-functions - '(lambda (arg) (pretty-control-l-mode))) - #+END_SRC - -* erc - - Automatically join some channels when connecting to freenode.net. - - #+BEGIN_SRC emacs-lisp - (setq erc-autojoin-channels-alist - '(("freenode.net" "#ninthfloor" "#emacs"))) - #+END_SRC - - Don't show ~PART~ messages. - - #+BEGIN_SRC emacs-lisp - (setq erc-hide-list '("PART")) - #+END_SRC - - Insert a timestamp every time a message comes in, print it on the - left and print the hour and minute parts of the time. - - #+BEGIN_SRC emacs-lisp - (setq erc-insert-timestamp-function 'erc-insert-timestamp-left) - (setq erc-timestamp-format "[%H:%M] ") - (setq erc-timestamp-only-if-changed-flag nil) - #+END_SRC - - Set my nickname. - - #+BEGIN_SRC emacs-lisp - (setq erc-nick "ryuslash") - #+END_SRC - - When starting ERC disable truncating lines, don't let ERC fill each - line and enable =visual-line-mode=. - - #+BEGIN_SRC emacs-lisp - (defun oni:erc-mode-func () - "Function for `erc-mode-hook'." - (erc-fill-mode -1) - (visual-line-mode) - (setq truncate-lines nil)) +Load ~flymake-cursor~ after loading ~flymake~, add Python and Go to +"allowed" files and add go error output to error patterns. - (add-hook 'erc-mode-hook 'oni:erc-mode-func) - #+END_SRC +#+BEGIN_SRC emacs-lisp + (defun oni:flymake-init () + "Initialization function for flymake." + (require 'flymake-cursor) + + (add-to-list ; Make sure pyflakes is loaded + 'flymake-allowed-file-name-masks ; for python files. + '("\\.py\\'" ext:flymake-pyflakes-init)) + + (add-to-list ; Error line repexp for go + 'flymake-err-line-patterns ; compilation. + '("^\\([a-zA-Z0-9_]+\\.go\\):\\([0-9]+\\):\\(.*\\)$" + 1 2 nil 3)) + + (add-to-list ; Go uses makefiles, makes + 'flymake-allowed-file-name-masks ; flymaking 'easy'. + '("\\.go$" flymake-simple-make-init))) + + (eval-after-load "flymake" '(oni:flymake-init)) +#+END_SRC + +Disable the GUI for flymake errors. This causes the flymake errors +to be shown in the minibuffer. + +#+BEGIN_SRC emacs-lisp + (setq flymake-gui-warnings-enabled nil) +#+END_SRC + +Add a bunch of pep8, flymake and pyflakes messages to warning and +info patterns, set the log file to somewhere in my home directory +and set logging level to 0. + +#+BEGIN_SRC emacs-lisp + (setq flymake-info-line-regexp + (eval-when-compile + (regexp-opt + '("Invalid name" + "String statement has no effect" + "Missing docstring" + "Empty docstring" + "multiple imports on one line" + "expected 2 blank lines, found 1" + "expected 2 blank lines, found 0" + "TODO:" + "whitespace after '{'" + "whitespace before '}'" + "whitespace before ':'" + "whitespace after '('" + "whitespace before ')'" + "whitespace after '['" + "whitespace before ']'" + "the backslash is redundant between brackets" + "continuation line over-indented for visual indent" + "continuation line under-indented for visual indent" + "Too many statements" + "comparison to None should be" + "missing whitespace around operator" + "missing whitespace after ','" + "line too long" + "at least two spaces before inline comment" + "trailing whitespace" + "imported but unused" + "Unused import" + "too many blank lines")))) + (setq flymake-log-file-name (expand-file-name "~/.emacs.d/flymake.log")) + (setq flymake-log-level 0) + (setq flymake-warn-line-regexp + (eval-when-compile + (regexp-opt '("warning" + "Warning" + "redefinition of unused" + "Redefining built-in" + "Redefining name" + "Unused argument" + "Unused variable" + "Dangerous default value {} as argument" + "no newline at end of file" + "Access to a protected member")))) +#+END_SRC + +After loading ~flycheck~ Remove the default python checkers and +replace them with my own, which tries both ~flake8~ and ~pylint~. -* eshell +#+BEGIN_SRC emacs-lisp + (eval-after-load "flycheck" + '(progn + (mapc (lambda (c) (delete c flycheck-checkers)) + '(python-pylint python-pyflakes)))) +#+END_SRC - Add ~unison~ to the list of =eshell-visual-commands= because it - expects unbuffered input and eshell just doesn't give that. +Make the ~C-l~ look like a line of ~-~ up to =fill-column= or +=fci-rule-column= and remove the string displayed before the ~C-l~. - #+BEGIN_SRC emacs-lisp - (eval-after-load "em-term" - '(add-to-list 'eshell-visual-commands "unison")) - #+END_SRC +#+BEGIN_SRC emacs-lisp + (defun oni:pretty-control-l-function (win) + "Just make a string of either `fci-rule-column' or + `fill-column' length -1. Use the `-' character. WIN is ignored." + (make-string + (1- (if (boundp 'fci-rule-column) + fci-rule-column fill-column)) ?-)) + + (setq pp^L-^L-string-function 'oni:pretty-control-l-function) +#+END_SRC - Don't let eshell highlight it's prompt, this way I can decide the - colors for it myself. +Remove the string displayed before the ~C-l~. - #+BEGIN_SRC emacs-lisp - (setq eshell-highlight-prompt nil) - #+END_SRC +#+BEGIN_SRC emacs-lisp + (setq pp^L-^L-string-pre nil) +#+END_SRC - In the prompt: +Enable =pretty-control-l-mode= at startup and whenever a new frame is +created. + +#+BEGIN_SRC emacs-lisp + (add-hook 'emacs-startup-hook 'pretty-control-l-mode) + (add-hook 'after-make-frame-functions + '(lambda (arg) (pretty-control-l-mode))) +#+END_SRC + +Automatically join some channels when connecting to freenode.net. + +#+BEGIN_SRC emacs-lisp + (setq erc-autojoin-channels-alist + '(("freenode.net" "#ninthfloor" "#emacs"))) +#+END_SRC + +Don't show ~PART~ messages. + +#+BEGIN_SRC emacs-lisp + (setq erc-hide-list '("PART")) +#+END_SRC + +Insert a timestamp every time a message comes in, print it on the +left and print the hour and minute parts of the time. + +#+BEGIN_SRC emacs-lisp + (setq erc-insert-timestamp-function 'erc-insert-timestamp-left) + (setq erc-timestamp-format "[%H:%M] ") + (setq erc-timestamp-only-if-changed-flag nil) +#+END_SRC + +Set my nickname. + +#+BEGIN_SRC emacs-lisp + (setq erc-nick "ryuslash") +#+END_SRC + +When starting ERC disable truncating lines, don't let ERC fill each +line and enable =visual-line-mode=. + +#+BEGIN_SRC emacs-lisp + (defun oni:erc-mode-func () + "Function for `erc-mode-hook'." + (erc-fill-mode -1) + (visual-line-mode) + (setq truncate-lines nil)) + + (add-hook 'erc-mode-hook 'oni:erc-mode-func) +#+END_SRC + +Add ~unison~ to the list of =eshell-visual-commands= because it +expects unbuffered input and eshell just doesn't give that. + +#+BEGIN_SRC emacs-lisp + (eval-after-load "em-term" + '(add-to-list 'eshell-visual-commands "unison")) +#+END_SRC + +Don't let eshell highlight it's prompt, this way I can decide the +colors for it myself. + +#+BEGIN_SRC emacs-lisp + (setq eshell-highlight-prompt nil) +#+END_SRC + +In the prompt: - Show the exit status of the last program/command run represented by a green ~+~ and a red ~-~ sign. @@ -291,316 +281,508 @@ functionality, plus more. =font-lock-function-name-face= face. - Show the status of priviledges in blue. - And set the =eshell-prompt-regexp= to - - #+BEGIN_SRC emacs-lisp - (defun oni:eshell-prompt-function () - "Show a pretty shell prompt." - (let ((status (if (zerop eshell-last-command-status) ?+ ?-)) - (hostname (shell-command-to-string "hostname")) - (dir (abbreviate-file-name (eshell/pwd))) - (branch - (shell-command-to-string - "git branch --contains HEAD 2>/dev/null | sed -e '/^[^*]/d'")) - (userstatus (if (zerop (user-uid)) ?# ?$))) - (concat - (propertize (char-to-string status) - 'face `(:foreground ,(if (= status ?+) - "green" - "red"))) - " " - (propertize (substring hostname 0 -1) 'face 'mode-line-buffer-id) - " " - (propertize (oni:shorten-dir dir) 'face 'font-lock-string-face) - " " - (when (not (string= branch "")) - (propertize - ;; Cut off "* " and "\n" - (substring branch 2 -1) - 'face 'font-lock-function-name-face)) - " \n" - (propertize (char-to-string userstatus) - 'face `(:foreground "blue")) - "> "))) - - (setq eshell-prompt-function 'oni:eshell-prompt-function - eshell-prompt-regexp "^[#$]> ") - #+END_SRC - - Don't truncate lines in eshell, wrap them. - - #+BEGIN_SRC emacs-lisp - (defun oni:eshell-mode-func () - "Function for `eshell-mode-hook'." - (setq truncate-lines nil)) - - (add-hook 'eshell-mode-hook 'oni:eshell-mode-func) - #+END_SRC - - Bind the ~f8~ key to easily show eshell. - - #+BEGIN_SRC emacs-lisp - (defun oni:raise-eshell () - "Start or switch back to `eshell'. - Also change directories to current working directory." - (interactive) - (let ((dir (file-name-directory - (or (buffer-file-name) "~/"))) - (hasfile (not (eq (buffer-file-name) nil)))) - (eshell) - (if (and hasfile (eq eshell-process-list nil)) - (progn - (eshell/cd dir) - (eshell-reset))))) - - (global-set-key (kbd "") 'oni:raise-eshell) - #+END_SRC - -* svg-mode-line-themes - - After Emacs has initialized, enable =svg-mode-line-themes= and select - a theme. - - #+BEGIN_SRC emacs-lisp - (defun oni:smt/minor-mode-indicator-text (widget) - (let* ((mm-alist '((auto-complete-mode . "AC ") - (auto-fill-mode . "AF ") - (eldoc-mode . "LD ") - (paredit-mode . "()"))) - (text (apply 'concat - (mapcar - (lambda (pair) - (when (and (boundp (car pair)) - (symbol-value (car pair))) - (cdr pair))) - mm-alist)))) - (if (plusp (length text)) - (concat " " text) - ""))) - - (defun oni:jabber-activity (widget) - (when (boundp 'jabber-activity-mode-string) - (concat jabber-activity-mode-string " "))) - - (eval-after-load "svg-mode-line-themes" - '(progn - (smt/defwidget oni:jabber-activity-widget - :text 'oni:jabber-activity) - - (smt/defrow oni:default-right - :widgets '(oni:jabber-activity-widget major-mode version-control - minor-modes) - :align "right" - :margin 14) - - (smt/deftheme yoshi - :prototype 'black-crystal - :local-widgets - (lambda (theme) - (let ((parent-local-widgets - (smt/t-local-widgets (smt/t-prototype theme)))) - (append - (list (cons 'minor-modes - (smt/make-widget - :prototye 'minor-modes - :text 'oni:smt/minor-mode-indicator-text))) - parent-local-widgets))) - :rows '(default-left default-position oni:default-right)))) - - (defun oni:enable-svg-mode-line-theme () - "Enable `svg-mode-line-theme' and select a theme." - (smt/enable) - (smt/set-theme 'yoshi)) - - (add-hook 'emacs-startup-hook 'oni:enable-svg-mode-line-theme) - #+END_SRC - -* bidi - - Disable bi-directional text, since I don't write right-to-left - myself and I don't know anyone who does. I have read that it is a - bad idea to disable it completely, but forcing left-to-right should - help. - - #+BEGIN_SRC emacs-lisp - (setq-default bidi-paragraph-direction 'left-to-right) - #+END_SRC - -* disabled - - There are some functions which get disabled by default because they - "confuse new users", but these I like using. - - #+BEGIN_SRC emacs-lisp - (put 'upcase-region 'disabled nil) - (put 'downcase-region 'disabled nil) - (put 'narrow-to-region 'disabled nil) - (put 'scroll-left 'disabled nil) - #+END_SRC - -* jabber - - Don't echo presence updates in the message area. - - #+BEGIN_SRC emacs-lisp - (defun oni:jabber-init () - "Initialization function for jabber." - (remove-hook 'jabber-alert-presence-hooks 'jabber-presence-echo)) - - (eval-after-load "jabber" '(oni:jabber-init)) - #+END_SRC - - Require ~jabber-libnotify~ so we can use its alert functions. - - #+BEGIN_SRC emacs-lisp - (require 'jabber-libnotify) - #+END_SRC - - Enable libnotify alerts for regular and mutli-user chats, this is - preferable to seeing them in the echo area. - - #+BEGIN_SRC emacs-lisp - (add-hook 'jabber-alert-message-hooks 'jabber-message-libnotify) - (add-hook 'jabber-alert-muc-hooks 'jabber-muc-libnotify) - #+END_SRC - - Keep track of what was said to and by my contacts, both for - "personal" chats and muc chats. - - #+BEGIN_SRC emacs-lisp - (setq jabber-history-enabled t - jabber-history-muc-enabled t) - #+END_SRC +And set the =eshell-prompt-regexp= to - Store history on a per-contact basis and keep these files in - ~$HOME/.emacs.d/jabber-hist~. +#+BEGIN_SRC emacs-lisp + (defun oni:eshell-prompt-function () + "Show a pretty shell prompt." + (let ((status (if (zerop eshell-last-command-status) ?+ ?-)) + (hostname (shell-command-to-string "hostname")) + (dir (abbreviate-file-name (eshell/pwd))) + (branch + (shell-command-to-string + "git branch --contains HEAD 2>/dev/null | sed -e '/^[^*]/d'")) + (userstatus (if (zerop (user-uid)) ?# ?$))) + (concat + (propertize (char-to-string status) + 'face `(:foreground ,(if (= status ?+) + "green" + "red"))) + " " + (propertize (substring hostname 0 -1) 'face 'mode-line-buffer-id) + " " + (propertize (oni:shorten-dir dir) 'face 'font-lock-string-face) + " " + (when (not (string= branch "")) + (propertize + ;; Cut off "* " and "\n" + (substring branch 2 -1) + 'face 'font-lock-function-name-face)) + " \n" + (propertize (char-to-string userstatus) + 'face `(:foreground "blue")) + "> "))) + + (setq eshell-prompt-function 'oni:eshell-prompt-function + eshell-prompt-regexp "^[#$]> ") +#+END_SRC - #+BEGIN_SRC emacs-lisp - (setq jabber-use-global-history nil - jabber-history-dir "~/.emacs.d/jabber-hist") - #+END_SRC +Don't truncate lines in eshell, wrap them. - Add some accounts. +#+BEGIN_SRC emacs-lisp + (defun oni:eshell-mode-func () + "Function for `eshell-mode-hook'." + (setq truncate-lines nil)) - #+BEGIN_SRC emacs-lisp - (setq jabber-account-list '(("ryuslash@jabber.org") - ("tom@ryuslash.org/drd" - (:connection-type . ssl)))) - #+END_SRC + (add-hook 'eshell-mode-hook 'oni:eshell-mode-func) +#+END_SRC -* ido +Bind the ~f8~ key to easily show eshell. - Keep some buffers from showing up when using ido-mode. Either these - get used very rarely or they don't have any really useful - information in them. +#+BEGIN_SRC emacs-lisp + (defun oni:raise-eshell () + "Start or switch back to `eshell'. + Also change directories to current working directory." + (interactive) + (let ((dir (file-name-directory + (or (buffer-file-name) "~/"))) + (hasfile (not (eq (buffer-file-name) nil)))) + (eshell) + (if (and hasfile (eq eshell-process-list nil)) + (progn + (eshell/cd dir) + (eshell-reset))))) + + (global-set-key (kbd "") 'oni:raise-eshell) +#+END_SRC + +Disable bi-directional text, since I don't write right-to-left +myself and I don't know anyone who does. I have read that it is a +bad idea to disable it completely, but forcing left-to-right should +help. + +#+BEGIN_SRC emacs-lisp + (setq-default bidi-paragraph-direction 'left-to-right) +#+END_SRC + +There are some functions which get disabled by default because they +"confuse new users", but these I like using. - #+BEGIN_SRC emacs-lisp - (defun oni:ido-init () - "Initialization functionn for ido." - (setq ido-ignore-buffers - (list "^\\` " "^irc\\." "^\\#" "^\\*Customize Option:" - (eval-when-compile - (regexp-opt - '("*-jabber-roster-*" - "*Messages*" - "*fsm-debug*" - "*magit-process*" - "*magit-edit-log*" - "*Backtrace*" - "*Ibuffer*")))))) +#+BEGIN_SRC emacs-lisp + (put 'upcase-region 'disabled nil) + (put 'downcase-region 'disabled nil) + (put 'narrow-to-region 'disabled nil) + (put 'scroll-left 'disabled nil) +#+END_SRC - (eval-after-load "ido" '(oni:ido-init)) - #+END_SRC +Don't echo presence updates in the message area. - Ido tries to be smart and find files in other directories, I don't - like that, stop doing that (or at least wait a long time). +#+BEGIN_SRC emacs-lisp + (defun oni:jabber-init () + "Initialization function for jabber." + (remove-hook 'jabber-alert-presence-hooks 'jabber-presence-echo)) + + (eval-after-load "jabber" '(oni:jabber-init)) +#+END_SRC + +Require ~jabber-libnotify~ so we can use its alert functions. + +#+BEGIN_SRC emacs-lisp + (require 'jabber-libnotify) +#+END_SRC - #+BEGIN_SRC emacs-lisp - (setq ido-auto-merge-delay-time 1000000) - #+END_SRC +Enable libnotify alerts for regular and mutli-user chats, this is +preferable to seeing them in the echo area. + +#+BEGIN_SRC emacs-lisp + (add-hook 'jabber-alert-message-hooks 'jabber-message-libnotify) + (add-hook 'jabber-alert-muc-hooks 'jabber-muc-libnotify) +#+END_SRC + +Keep track of what was said to and by my contacts, both for +"personal" chats and muc chats. + +#+BEGIN_SRC emacs-lisp + (setq jabber-history-enabled t + jabber-history-muc-enabled t) +#+END_SRC + +Store history on a per-contact basis and keep these files in +~$HOME/.emacs.d/jabber-hist~. + +#+BEGIN_SRC emacs-lisp + (setq jabber-use-global-history nil + jabber-history-dir "~/.emacs.d/jabber-hist") +#+END_SRC + +Add some accounts. + +#+BEGIN_SRC emacs-lisp + (setq jabber-account-list '(("ryuslash@jabber.org") + ("tom@ryuslash.org/drd" + (:connection-type . ssl)))) +#+END_SRC - Open files in the selected window when switching between buffers. +Keep some buffers from showing up when using ido-mode. Either these +get used very rarely or they don't have any really useful +information in them. - #+BEGIN_SRC emacs-lisp - (setq ido-default-buffer-method 'selected-window) - #+END_SRC +#+BEGIN_SRC emacs-lisp + (defun oni:ido-init () + "Initialization functionn for ido." + (setq ido-ignore-buffers + (list "^\\` " "^irc\\." "^\\#" "^\\*Customize Option:" + (eval-when-compile + (regexp-opt + '("*-jabber-roster-*" + "*Messages*" + "*fsm-debug*" + "*magit-process*" + "*magit-edit-log*" + "*Backtrace*" + "*Ibuffer*")))))) + + (eval-after-load "ido" '(oni:ido-init)) +#+END_SRC - Only ever show one line of possibilities when using ido. I hate it - when the minibuffer grows. +Ido tries to be smart and find files in other directories, I don't +like that, stop doing that (or at least wait a long time). - #+BEGIN_SRC emacs-lisp - (setq ido-max-window-height 1) - #+END_SRC +#+BEGIN_SRC emacs-lisp + (setq ido-auto-merge-delay-time 1000000) +#+END_SRC - Don't save ido state between invocations. +Open files in the selected window when switching between buffers. - #+BEGIN_SRC emacs-lisp - (setq ido-save-directory-list-file nil) - #+END_SRC +#+BEGIN_SRC emacs-lisp + (setq ido-default-buffer-method 'selected-window) +#+END_SRC - Enable =ido-mode=. +Only ever show one line of possibilities when using ido. I hate it +when the minibuffer grows. - #+BEGIN_SRC emacs-lisp - (ido-mode) - #+END_SRC +#+BEGIN_SRC emacs-lisp + (setq ido-max-window-height 1) +#+END_SRC -** ido-ubiquitous +Don't save ido state between invocations. - Don't use ido when calling =org-refile= or =org-capture-refile=. +#+BEGIN_SRC emacs-lisp + (setq ido-save-directory-list-file nil) +#+END_SRC - #+BEGIN_SRC emacs-lisp - (setq ido-ubiquitous-command-exceptions - '(org-refile org-capture-refile)) - #+END_SRC +Enable =ido-mode=. - Enable =ido-ubiquitous=. +#+BEGIN_SRC emacs-lisp + (ido-mode) +#+END_SRC - #+BEGIN_SRC emacs-lisp - (add-hook 'emacs-startup-hook 'ido-ubiquitous-mode) - #+END_SRC +Don't use ido when calling =org-refile= or =org-capture-refile=. -** idomenu +#+BEGIN_SRC emacs-lisp + (setq ido-ubiquitous-command-exceptions + '(org-refile org-capture-refile)) +#+END_SRC - Call =idomenu= with ~M-n~. +Enable =ido-ubiquitous=. - #+BEGIN_SRC emacs-lisp - (global-set-key (kbd "M-n") 'idomenu) - #+END_SRC +#+BEGIN_SRC emacs-lisp + (add-hook 'emacs-startup-hook 'ido-ubiquitous-mode) +#+END_SRC -* minibuffer +Call =idomenu= with ~M-n~. - A new feature in Emacs 24.3 can shorten ~(default ...)~ to ~[...]~ when - prompting for something. The =minibuffer-eldef-shorten-default= should - be set before enabling the =minibuffer-electric-default-mode=. +#+BEGIN_SRC emacs-lisp + (global-set-key (kbd "M-n") 'idomenu) +#+END_SRC - #+BEGIN_SRC emacs-lisp - (setq minibuffer-eldef-shorten-default t) - (minibuffer-electric-default-mode) - #+END_SRC +A new feature in Emacs 24.3 can shorten ~(default ...)~ to ~[...]~ when +prompting for something. The =minibuffer-eldef-shorten-default= should +be set before enabling the =minibuffer-electric-default-mode=. -* mode-line +#+BEGIN_SRC emacs-lisp + (setq minibuffer-eldef-shorten-default t) + (minibuffer-electric-default-mode) +#+END_SRC - Don't show any default help messages, if no help message was - specified, just leave the echo area empty. +Don't show any default help messages, if no help message was +specified, just leave the echo area empty. - #+BEGIN_SRC emacs-lisp - (setq mode-line-default-help-echo "") - #+END_SRC +#+BEGIN_SRC emacs-lisp + (setq mode-line-default-help-echo "") +#+END_SRC -* jedi +Start jedi when =python-mode= is started. - Start jedi when =python-mode= is started. +#+BEGIN_SRC emacs-lisp + (eval-after-load "jedi" '(setcar jedi:server-command "python2")) + (add-hook 'python-mode-hook 'jedi:setup) +#+END_SRC - #+BEGIN_SRC emacs-lisp - (eval-after-load "jedi" '(setcar jedi:server-command "python2")) - (add-hook 'python-mode-hook 'jedi:setup) - #+END_SRC +Show argument lists and such in the echo area. - Show argument lists and such in the echo area. +#+BEGIN_SRC emacs-lisp + (setq jedi:tooltip-method nil) +#+END_SRC - #+BEGIN_SRC emacs-lisp - (setq jedi:tooltip-method nil) - #+END_SRC +#+BEGIN_SRC emacs-lisp + (defface git-commit-summary-face + '((t (:inherit org-level-1))) + "Face for the git title line." + :group 'local) + + (defface git-commit-overlong-summary-face + '((t (:background "#873732"))) + "Face for commit titles that are too long." + :group 'local) + + (defface git-commit-nonempty-second-line-face + '((t (:inherit git-commit-overlong-summary-face))) + "Face for the supposedly empty line in commit messages." + :group 'local) + + (eval-after-load "newst-treeview" '(require 'newsticker-init)) + (eval-after-load "org" '(require 'org-init)) + (eval-after-load "rainbow-mode" '(oni:rainbow-mode-init)) + (eval-after-load "smex" '(oni:smex-init)) + (eval-after-load "yasnippet" '(oni:yasnippet-init)) + + (autoload 'define-slime-contrib "slime") + (autoload 'gtags-mode "gtags" nil t) + (autoload 'jabber-connect "jabber" nil t) + (autoload 'php-mode "php-mode" nil t) + (autoload 'po-mode "po-mode" nil t) + (autoload 'pony-mode "pony-mode" nil t) + (autoload 'sawfish-mode "sawfish" nil t) + (autoload 'server-running-p "server") + (autoload 'slime-js-minor-mode "slime-js" nil t) + (autoload 'xmodmap-mode "xmodmap-mode" nil t) + (autoload 'w3m-bookmark-view "w3m" nil t) + (autoload 'w3m-goto-url "w3m" nil t) + + (require 'geiser-install) + (require 'uniquify) + (require 'ext) + (require 'oni) + + (setq-default c-basic-offset 4) + (setq-default fci-rule-column 73) + (setq-default indent-tabs-mode nil) + (setq-default php-mode-warn-if-mumamo-off nil) + (setq-default require-final-newline t) + (setq-default tab-width 4) + (setq-default truncate-lines t) + + (setq appt-disp-window-function #'oni:appt-display-window-and-jabber) + (setq appt-display-diary nil) + (setq auto-mode-case-fold nil) + (setq auto-save-file-name-transforms oni:auto-save-name-transforms) + (setq avandu-article-render-function #'avandu-view-w3m) + (setq backup-directory-alist oni:backup-directory-alist) + (setq browse-url-browser-function 'browse-url-generic) + (setq browse-url-generic-program (getenv "BROWSER")) + (setq c-offsets-alist '((statement-block-intro . +) + (knr-argdecl-intro . 5) + (substatement-open . +) + (substatement-label . 0) + (label . 0) + (statement-case-open . +) + (statement-cont . +) + (arglist-intro . +) + (arglist-close . 0) + (inline-open . 0) + (brace-list-open . +) + (topmost-intro-cont first c-lineup-topmost-intro-cont + c-lineup-gnu-DEFUN-intro-cont))) + (setq comment-auto-fill-only-comments t) + (setq custom-file "~/.emacs.d/custom.el") + (setq custom-theme-directory "~/.emacs.d/themes") + (setq default-frame-alist + `((border-width . 0) + (internal-border-width . 0) + (vertical-scroll-bars . nil) + (menu-bar-lines . nil) + (tool-bar-lines . nil) + (font . "Envy Code R:pixelsize=18"))) + (setq elnode-do-init nil) + (setq fci-rule-color "darkred") + (setq frame-title-format '(:eval (concat "emacs: " (buffer-name)))) + (setq geiser-repl-history-filename "~/.emacs.d/geiser-history") + (setq gnus-init-file "~/.emacs.d/gnus") + (setq gtags-auto-update t) + (setq help-at-pt-display-when-idle t) + (setq highlight-80+-columns 72) + (setq identica-enable-striping t) + (setq inferior-lisp-program "sbcl") + (setq inhibit-default-init t) + (setq inhibit-local-menu-bar-menus t) + (setq inhibit-startup-message t) + (setq initial-major-mode 'emacs-lisp-mode) + (setq initial-scratch-message nil) + (setq jabber-avatar-cache-directory "~/.emacs.d/jabber-avatars/") + (setq jabber-chat-buffer-format "*jab:%n*") + (setq jabber-chat-buffer-show-avatar nil) + (setq jabber-chat-fill-long-lines nil) + (setq jabber-chat-foreign-prompt-format "%t %u/%r <\n") + (setq jabber-chat-local-prompt-format "%t %u/%r >\n") + (setq jabber-chatstates-confirm nil) + (setq jabber-muc-autojoin '("aethon@muc.ryuslash.org")) + (setq jabber-roster-show-bindings nil) + (setq jabber-vcard-avatars-publish nil) + (setq jabber-vcard-avatars-retrieve nil) + (setq jit-lock-defer-time 0.2) + (setq magit-repo-dirs '("~/projects/" "~/var/src/")) + (setq message-log-max 1000) + (setq message-send-mail-function 'message-send-mail-with-sendmail) + (setq message-sendmail-extra-arguments '("-a" "ryuslash")) + (setq package-archives + '(("melpa" . "http://melpa.milkbox.net/packages/") + ("marmalade" . "http://marmalade-repo.org/packages/") + ("gnu" . "http://elpa.gnu.org/packages/"))) + (setq package-load-list '((htmlize "1.39") + (lua-mode "20111107") + all)) + (setq php-function-call-face 'font-lock-function-name-face) + (setq php-mode-force-pear t) + (setq pony-tpl-indent-moves t) + (setq rainbow-delimiters-max-face-count 12) + (setq redisplay-dont-pause t) + (setq send-mail-function 'smtpmail-send-it) + (setq sendmail-program "/usr/bin/msmtp") + (setq sentence-end-double-space nil) + (setq smex-key-advice-ignore-menu-bar t) + (setq smex-save-file "~/.emacs.d/smex-items") + (setq split-height-threshold 40) + (setq time-stamp-active t) + (setq time-stamp-format "%04y-%02m-%02d %02H:%02M:%02S (%u)") + (setq type-break-good-rest-interval (* 60 10)) + (setq type-break-interval (* 60 50)) + (setq type-break-keystroke-threshold '(nil . nil)) + (setq uniquify-buffer-name-style 'post-forward) + (setq use-dialog-box nil) + (setq user-full-name "Tom Willemsen") + (setq user-mail-address "tom@ryuslash.org") + (setq w3m-fill-column 72) + (setq window-combination-resize t) + (setq yas-fallback-behavior nil) + (setq yas-prompt-functions '(yas-ido-prompt)) + + (add-hook 'after-change-major-mode-hook 'set-current-mode-icon) + (add-hook 'after-save-hook 'oni:after-save-func t) + (add-hook 'before-save-hook 'oni:before-save-func) + (add-hook 'c-mode-hook 'oni:c-mode-func) + (add-hook 'css-mode-hook 'oni:css-mode-func) + (add-hook 'diary-display-hook 'oni:diary-display-func) + (add-hook 'emacs-startup-hook 'oni:emacs-startup-func) + (add-hook 'emacs-lisp-mode-hook 'oni:emacs-lisp-mode-func) + (add-hook 'go-mode-hook 'oni:go-mode-func) + (add-hook 'gtags-mode-hook 'oni:gtags-mode-func) + (add-hook 'haskell-mode-hook 'oni:haskell-mode-func) + (add-hook 'html-mode-hook 'oni:html-mode-func) + (add-hook 'jabber-chat-mode-hook 'oni:jabber-chat-mode-func) + (add-hook 'jabber-roster-mode-hook 'oni:jabber-roster-mode-func) + (add-hook 'java-mode-hook 'oni:java-mode-func) + (add-hook 'js-mode-hook 'oni:js-mode-func) + (add-hook 'js2-mode-hook 'oni:js2-mode-func) + (add-hook 'lua-mode-hook 'oni:lua-mode-func) + (add-hook 'magit-log-edit-mode-hook 'oni:magit-log-edit-mode-func) + (add-hook 'markdown-mode-hook 'oni:markdown-mode-func) + (add-hook 'message-mode-hook 'oni:message-mode-func) + (add-hook 'org-mode-hook 'oni:org-mode-func) + (add-hook 'php-mode-hook 'oni:php-mode-func) + (add-hook 'prog-mode-hook 'oni:prog-mode-func) + (add-hook 'python-mode-hook 'oni:python-mode-func) + (add-hook 'rst-mode-hook 'oni:rst-mode-func) + (add-hook 'term-mode-hook 'oni:term-mode-func) + (add-hook 'texinfo-mode-hook 'oni:texinfo-mode-func) + (add-hook 'write-file-hooks 'oni:write-file-func) + (add-hook 'yas-minor-mode-hook 'oni:yas-minor-mode-func) + + (define-key key-translation-map (kbd "C-j") (kbd "C-l")) + (define-key key-translation-map (kbd "C-l") (kbd "C-j")) + + (global-set-key (kbd "'") 'oni:self-insert-dwim) + (global-set-key (kbd "") 'oni:raise-scratch) + (global-set-key (kbd "") 'gnus) + (global-set-key (kbd "") 'git-project-show-files) + (global-set-key (kbd "") 'ext:reload-buffer) + (global-set-key (kbd "") 'jabber-switch-to-roster-buffer) + (global-set-key (kbd "") 'magit-status) + (global-set-key (kbd "") 'oni:show-org-index) + (global-set-key (kbd "C-<") 'oni:indent-shift-left) + (global-set-key (kbd "C->") 'oni:indent-shift-right) + (global-set-key (kbd "C-M-4") 'split-window-vertically) + (global-set-key (kbd "C-M-SPC") 'er/expand-region) + (global-set-key (kbd "C-M-d") 'kill-word) + (global-set-key (kbd "C-M-w") 'backward-kill-word) + (global-set-key (kbd "C-S-k") 'kill-whole-line) + (global-set-key (kbd "C-a") 'oni:move-beginning-of-dwim) + (global-set-key (kbd "C-c a") 'org-agenda) + (global-set-key (kbd "C-c c") 'org-capture) + (global-set-key (kbd "C-c i p") 'identica-update-status-interactive) + (global-set-key (kbd "C-c p") 'oni:show-buffer-position) + (global-set-key (kbd "C-c t") 'oni:raise-ansi-term) + (global-set-key (kbd "C-d") 'oni:kill-region-or-forward-char) + (global-set-key (kbd "C-e") 'oni:move-end-of-dwim) + (global-set-key (kbd "C-k") 'oni:kill-region-or-line) + (global-set-key (kbd "C-w") 'oni:kill-region-or-backward-char) + (global-set-key (kbd "M-0") 'delete-window) + (global-set-key (kbd "M-1") 'delete-other-windows) + (global-set-key (kbd "M-2") 'split-window-below) + (global-set-key (kbd "M-3") 'split-window-right) + (global-set-key (kbd "M-4") 'split-window-horizontally) + (global-set-key (kbd "M-o") 'other-window) + (global-set-key (kbd "\"") 'oni:self-insert-dwim) + + (if (daemonp) + (global-set-key "\C-x\C-c" 'oni:close-client-window)) + + (when (or window-system (daemonp)) + (global-unset-key "\C-z")) + + (add-to-list 'auto-mode-alist '("\\.jl$" . sawfish-mode)) + (add-to-list 'auto-mode-alist '("\\.js\\(on\\)?$" . js2-mode)) + (add-to-list 'auto-mode-alist + '("\\.m\\(ark\\)?d\\(?:o?wn\\)?$" . markdown-mode)) + (add-to-list 'auto-mode-alist '("\\.php[345]?$" . php-mode)) + (add-to-list 'auto-mode-alist '("\\.po\\'\\|\\.po\\." . po-mode)) + (add-to-list 'auto-mode-alist '("\\.tpl$" . html-mode)) + (add-to-list 'auto-mode-alist '("^PKGBUILD$" . shell-script-mode)) + (add-to-list 'auto-mode-alist '("^\\.Xmodmap$" . xmodmap-mode)) + + (add-to-list 'debug-ignored-errors "^Can't shift all lines enough") + + (add-to-list + 'display-buffer-alist + '("^\\*\\(?:.+-\\)?scratch\\*$" . ((display-buffer-same-window . nil)))) + (add-to-list + 'display-buffer-alist + '("^\\*git-project-list\\*$" . ((git-project-show-window . nil)))) + (add-to-list + 'display-buffer-alist + '("^\\*magit: .*\\*$" . ((display-buffer-same-window . nil)))) + + (add-to-list 'compilation-finish-functions 'ext:comp-finish-function) + + (blink-cursor-mode -1) + (column-number-mode -1) + (line-number-mode -1) + (tooltip-mode -1) + + (package-initialize) + + (auto-insert-mode) + (cua-selection-mode t) + (electric-indent-mode) + (electric-pair-mode) + (savehist-mode) + (show-paren-mode) + (winner-mode) + + (smex-initialize) + (help-at-pt-set-timer) + (windmove-default-keybindings) + (global-diff-hl-mode) + + (load custom-file) + ;; (load "rudel-loaddefs.el") + (load (expand-file-name "~/quicklisp/slime-helper.el")) + + (unless (server-running-p) + (server-start)) + + (diminish 'auto-fill-function "_") +#+END_SRC # Local Variables: # eval: (flyspell-mode 1) -- cgit v1.2.3-54-g00ecf