legacy-dotfiles/emacs/init.el

646 lines
21 KiB
EmacsLisp
Raw Normal View History

2013-05-15 17:35:51 +02:00
(menu-bar-mode -1)
(scroll-bar-mode -1)
2013-05-15 17:35:51 +02:00
(tool-bar-mode -1)
(mapc #'(lambda (dir)
(add-to-list 'load-path dir)
(let ((loaddefs (concat dir "/loaddefs.el")))
(when (file-exists-p loaddefs)
(load loaddefs))))
2013-05-15 17:35:51 +02:00
'("~/.emacs.d/site-lisp" "~/projects/emacs/pony-mode/src"
"~/projects/emacs/php-mode" "~/.emacs.d/vendor-lisp/org/lisp"
"~/.emacs.d/vendor-lisp/org/contrib/lisp"))
(require 'ext)
(require 'oni)
(setq custom-theme-directory "~/.emacs.d/themes")
(oni:eval-after-init (load-theme 'yoshi t))
(defalias 'yes-or-no-p 'y-or-n-p)
(defalias 'list-buffers 'ibuffer)
2013-05-15 17:35:51 +02:00
(defalias 'dabbrev-expand 'hippie-expand)
2013-05-15 17:35:51 +02:00
(defun ext:comp-finish-function (buf str)
"Close the compilation buffer quickly if everything went OK."
(if (string-match "exited abnormally" str)
;; there were errors
(message "compilation errors, press C-x ` to visit")
;; no errors, make the compilation window go away in 0.5 seconds
(when (member (buffer-name) '("*Compilation*" "*compilation*"))
2013-05-15 17:35:51 +02:00
(delete-windows-on buf)
(message "No compilation errors!"))))
(add-to-list 'compilation-finish-functions 'ext:comp-finish-function)
(setq compilation-scroll-output t)
2013-05-15 17:35:51 +02:00
(add-hook 'prog-mode-hook 'auto-fill-mode)
(add-hook 'text-mode-hook 'auto-fill-mode)
(add-hook 'emacs-lisp-mode-hook 'eldoc-mode)
(add-hook 'ielm-mode-hook 'eldoc-mode)
(add-hook 'html-mode-hook 'fci-mode)
(add-hook 'prog-mode-hook 'fci-mode)
(add-hook 'css-mode-hook 'flycheck-mode)
(add-hook 'emacs-lisp-mode-hook 'flycheck-mode)
(add-hook 'go-mode-hook 'flycheck-mode)
(add-hook 'html-mode-hook 'flycheck-mode)
(add-hook 'js2-mode-hook 'flycheck-mode)
(add-hook 'lua-mode-hook 'flycheck-mode)
(add-hook 'php-mode-hook 'flycheck-mode)
(add-hook 'python-mode-hook 'flycheck-mode)
(add-hook 'rst-mode-hook 'flycheck-mode)
(add-hook 'ruby-mode-hook 'flycheck-mode)
(add-hook 'rust-mode-hook 'flycheck-mode)
(add-hook 'sh-mode-hook 'flycheck-mode)
(add-hook 'text-mode-hook 'flyspell-mode)
(add-hook 'clojure-mode-hook 'paredit-mode)
(add-hook 'emacs-lisp-mode-hook 'paredit-mode)
2013-05-15 17:35:51 +02:00
(add-hook 'lisp-mode-hook 'paredit-mode)
(add-hook 'sawfish-mode-hook 'paredit-mode)
(add-hook 'scheme-mode-hook 'paredit-mode)
(add-hook 'ielm-mode-hook 'paredit-mode)
(add-hook 'prog-mode-hook 'rainbow-delimiters-mode)
(add-hook 'css-mode-hook 'rainbow-mode)
(add-hook 'js2-mode-hook 'slime-js-minor-mode)
(add-hook 'html-mode-hook 'smartparens-mode)
(add-hook 'python-mode-hook 'smartparens-mode)
(add-hook 'jabber-chat-mode-hook 'visual-line-mode)
(add-hook 'erc-mode-hook 'visual-line-mode)
(add-hook 'markdown-mode-hook 'whitespace-mode)
(add-hook 'python-mode-hook 'whitespace-mode)
(add-hook 'html-mode-hook 'yas-minor-mode)
(add-hook 'org-mode-hook 'yas-minor-mode)
(add-hook 'prog-mode-hook 'yas-minor-mode)
(defun oni:turn-on-tagedit-mode ()
(require 'tagedit)
(tagedit-mode)
(tagedit-add-paredit-like-keybindings)
(tagedit-add-experimental-features))
(add-hook 'html-mode-hook 'oni:turn-on-tagedit-mode)
(eval-after-load "flycheck"
'(progn
(mapc (lambda (c) (delq c flycheck-checkers))
'(python-pylint python-pyflakes))))
2013-05-15 17:35:51 +02:00
(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."
(ignore win)
(make-string
(1- (if (boundp 'fci-rule-column) fci-rule-column fill-column)) ?-))
2013-05-15 17:35:51 +02:00
(setq pp^L-^L-string-function 'oni:pretty-control-l-function
pp^L-^L-string-pre nil)
(add-hook 'emacs-startup-hook 'pretty-control-l-mode)
(add-hook 'after-make-frame-functions
'(lambda (arg) (pretty-control-l-mode)))
2013-05-15 17:35:51 +02:00
(setq erc-autojoin-channels-alist
2013-05-15 17:35:51 +02:00
'(("freenode.net" "#ninthfloor" "#emacs" "#dispass")))
(setq erc-hide-list '("PART"))
2013-05-15 17:35:51 +02:00
(setq erc-insert-timestamp-function 'erc-insert-timestamp-left
erc-timestamp-format "[%H:%M] "
erc-timestamp-only-if-changed-flag nil)
(setq erc-nick "ryuslash")
2013-05-15 17:35:51 +02:00
(defun oni:turn-off-erc-fill-mode () (erc-fill-mode -1))
(add-hook 'erc-mode-hook 'oni:turn-off-erc-fill-mode)
(eval-after-load "em-term"
'(add-to-list 'eshell-visual-commands "unison"))
(setq eshell-highlight-prompt nil)
(defun oni:eshell-prompt-function ()
"Show a pretty shell prompt."
(let ((status (if (zerop eshell-last-command-status) ?+ ?-))
2013-05-15 17:35:51 +02:00
(hostname (oni:hostname))
(dir (abbreviate-file-name (eshell/pwd)))
(branch
(shell-command-to-string
2013-05-15 17:35:51 +02:00
"git branch --contains HEAD 2>/dev/null | sed -e '/^[^*]/d'")))
(concat
(propertize (char-to-string status)
'face `(:foreground ,(if (= status ?+)
"green"
"red")))
" "
2013-05-15 17:35:51 +02:00
(propertize hostname '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))
2013-05-15 17:35:51 +02:00
" \n> ")))
(setq eshell-prompt-function 'oni:eshell-prompt-function
2013-05-15 17:35:51 +02:00
eshell-prompt-regexp "^> ")
(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) "~/")))
2013-05-15 17:35:51 +02:00
(hasfile (not (eq (buffer-file-name) nil)))
(started (and (boundp 'eshell-buffer-name) eshell-buffer-name
(buffer-live-p (get-buffer eshell-buffer-name)))))
(eshell)
2013-05-15 17:35:51 +02:00
(when (and hasfile (eq eshell-process-list nil))
(eshell/cd dir)
(when started
(eshell-reset)))))
(global-set-key (kbd "<f8>") 'oni:raise-eshell)
2013-05-15 17:35:51 +02:00
(add-hook 'eshell-mode-hook 'buffer-disable-undo)
(setq-default bidi-paragraph-direction 'left-to-right)
2013-05-15 17:35:51 +02:00
(put 'downcase-region 'disabled nil)
(put 'narrow-to-page 'disabled nil)
(put 'narrow-to-region 'disabled nil)
2013-05-15 17:35:51 +02:00
(put 'scroll-left 'disabled nil)
(put 'upcase-region 'disabled nil)
2013-05-15 17:35:51 +02:00
(eval-after-load "jabber"
'(remove-hook 'jabber-alert-presence-hooks 'jabber-presence-echo))
(autoload 'jabber-message-libnotify "jabber-libnotify")
2013-05-15 17:35:51 +02:00
(autoload 'jabber-muc-libnotify "jabber-libnotify")
(add-hook 'jabber-alert-message-hooks 'jabber-message-libnotify)
2013-05-15 17:35:51 +02:00
(add-hook 'jabber-alert-muc-hooks 'jabber-muc-libnotify)
2013-05-15 17:35:51 +02:00
(setq jabber-history-enabled t
jabber-history-muc-enabled t
jabber-use-global-history nil
jabber-history-dir "~/.emacs.d/jabber-hist")
2013-05-15 17:35:51 +02:00
(setq jabber-account-list `((,(concat "tom@ryuslash.org/" (oni:hostname))
(:connection-type . ssl))))
2013-05-15 17:35:51 +02:00
(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))
2013-05-15 17:35:51 +02:00
(setq ido-auto-merge-work-directories-length -1)
(setq ido-default-buffer-method 'selected-window)
(setq ido-max-window-height 1)
(setq ido-save-directory-list-file nil)
(ido-mode)
2013-05-15 17:35:51 +02:00
(setq ido-ubiquitous-command-exceptions '(org-refile org-capture-refile))
(add-hook 'emacs-startup-hook 'ido-ubiquitous-mode)
(global-set-key (kbd "M-n") 'idomenu)
2013-05-15 17:35:51 +02:00
(setq minibuffer-eldef-shorten-default t)
(minibuffer-electric-default-mode)
2013-05-15 17:35:51 +02:00
(setq mode-line-default-help-echo "")
2013-05-15 17:35:51 +02:00
(eval-after-load "jedi" '(setcar jedi:server-command "python2"))
(add-hook 'python-mode-hook 'jedi:setup)
(setq jedi:tooltip-method nil)
(eval-after-load "org" '(require 'org-init))
2013-05-15 17:35:51 +02:00
(global-set-key (kbd "C-M-z") 'ext:indent-defun)
(defadvice term-handle-exit (after oni:kill-buffer-after-exit activate)
"Kill the term buffer if the process finished."
2013-05-15 17:35:51 +02:00
(kill-buffer (current-buffer)))
(global-set-key (kbd "C-c u") 'oni:upcase-prev)
(global-set-key (kbd "C-c d") 'oni:downcase-prev)
(add-hook 'vala-mode-hook 'oni:vala-mode-func)
2013-05-15 17:35:51 +02:00
(global-set-key (kbd "M-x") 'smex)
(global-set-key (kbd "C-M-x") 'smex-major-mode-commands)
(autoload 'define-slime-contrib "slime")
2013-05-15 17:35:51 +02:00
(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 'w3m-bookmark-view "w3m" nil t)
(autoload 'w3m-goto-url "w3m" nil t)
(autoload 'xmodmap-mode "xmodmap-mode" nil t)
(require 'uniquify)
2013-05-15 17:35:51 +02:00
(setq-default c-basic-offset 4
tab-width 4)
(setq-default fci-rule-column 73)
2013-05-15 17:35:51 +02:00
(setq-default indent-tabs-mode nil)
2013-05-15 17:35:51 +02:00
(setq-default php-mode-warn-if-mumamo-off nil)
2013-05-15 17:35:51 +02:00
(setq-default require-final-newline t)
2013-05-15 17:35:51 +02:00
(setq-default truncate-lines t)
(setq appt-disp-window-function #'oni:appt-display-window-and-jabber)
2013-05-15 17:35:51 +02:00
(setq appt-display-diary nil)
2013-05-15 17:35:51 +02:00
(setq auto-mode-case-fold nil)
2013-05-15 17:35:51 +02:00
(setq auto-save-file-name-transforms
`((".*" "~/.local/share/emacs/autosave/" t)))
(setq backup-directory-alist `((".*" . "~/.local/share/emacs/backup/")))
(setq browse-url-browser-function 'browse-url-generic
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 custom-file "~/.emacs.d/custom.el")
2013-05-15 17:35:51 +02:00
(setq default-frame-alist
`((border-width . 0)
(internal-border-width . 0)
(vertical-scroll-bars . nil)
(menu-bar-lines . nil)
(tool-bar-lines . nil)
2013-05-15 17:35:51 +02:00
(font . "Inconsolata:pixelsize=18")))
(setq elnode-do-init nil)
2013-05-15 17:35:51 +02:00
(setq frame-title-format '(:eval (concat "emacs: " (buffer-name))))
2013-05-15 17:35:51 +02:00
(setq geiser-repl-history-filename "~/.emacs.d/geiser-history")
2013-05-15 17:35:51 +02:00
(setq gnus-init-file "~/.emacs.d/gnus")
2013-05-15 17:35:51 +02:00
(setq gtags-auto-update t)
2013-05-15 17:35:51 +02:00
(setq help-at-pt-display-when-idle t)
2013-05-15 17:35:51 +02:00
(setq inferior-lisp-program "sbcl --noinform --no-linedit")
(setq inhibit-default-init t
inhibit-local-menu-bar-menus t
inhibit-startup-message t)
(setq initial-major-mode 'emacs-lisp-mode
initial-scratch-message nil)
(setq jabber-avatar-cache-directory "~/.emacs.d/jabber-avatars/")
2013-05-15 17:35:51 +02:00
(setq jabber-chat-buffer-format "+%n"
jabber-chat-foreign-prompt-format "%t %u/%r <\n"
jabber-chat-local-prompt-format "%t %u/%r >\n"
jabber-groupchat-buffer-format "++%n"
jabber-groupchat-prompt-format "%t %u --\n")
(setq jabber-chat-buffer-show-avatar nil
jabber-vcard-avatars-publish nil
jabber-vcard-avatars-retrieve nil)
(setq jabber-chat-fill-long-lines nil)
2013-05-15 17:35:51 +02:00
(setq jabber-chatstates-confirm nil)
2013-05-15 17:35:51 +02:00
(setq jabber-muc-autojoin '("aethon@muc.ryuslash.org"))
2013-05-15 17:35:51 +02:00
(setq jabber-roster-show-bindings nil)
2013-05-15 17:35:51 +02:00
(setq jabber-show-offline-contacts nil)
(setq jit-lock-defer-time 0.2)
2013-05-15 17:35:51 +02:00
(defun turn-on-compilation-shell-for-pony ()
(add-hook 'pony-minor-mode-hook 'compilation-shell-minor-mode nil t))
(add-hook 'comint-mode-hook 'turn-on-compilation-shell-for-pony)
(defun oni:smartparens-set-keys ()
(local-set-key (kbd "DEL") 'sp-backward-delete-char)
(local-set-key (kbd "<deletechar>") 'sp-delete-char)
(local-set-key (kbd "C-d") 'sp-delete-char))
(add-hook 'smartparens-mode-on-hook 'oni:smartparens-set-keys)
(eval-after-load "emms"
`(progn
(emms-minimalistic)
(emms-default-players)
(require 'emms-player-mpd)
(add-to-list 'emms-player-list 'emms-player-mpd)
(setq emms-player-mpd-music-directory "/mnt/music/mp3")
(require 'emms-mode-line)
(setq emms-mode-line-mode-line-function 'oni:mode-line-current-song)
(emms-mode-line 1)))
(defun oni:set-smartparens-keys ()
(local-set-key (kbd "<C-left>") 'sp-forward-barf-sexp)
(local-set-key (kbd "<C-right>") 'sp-forward-slurp-sexp))
(defun oni:local-set-smartparens-hook ()
(add-hook 'smartparens-mode-hook 'oni:set-smartparens-keys nil t))
(add-hook 'python-mode-hook 'oni:local-set-smartparens-hook)
(setq magit-repo-dirs '("~/projects/"))
(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)
2013-05-15 17:35:51 +02:00
(setq send-mail-function 'sendmail-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)
2013-04-10 22:05:48 +02:00
(setq user-full-name "Tom Willemse")
(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 '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 '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 'markdown-mode-hook 'oni:markdown-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 'term-mode-hook 'oni:term-mode-func)
(add-hook 'write-file-hooks 'oni:write-file-func)
(add-hook 'yas-minor-mode-hook 'oni:yas-minor-mode-func)
2013-05-15 17:35:51 +02:00
(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 "<XF86HomePage>") 'oni:raise-scratch)
(global-set-key (kbd "<XF86Mail>") 'gnus)
(global-set-key (kbd "<f10>") 'git-project-show-files)
(global-set-key (kbd "<f5>") 'ext:reload-buffer)
(global-set-key (kbd "<f6>") 'jabber-switch-to-roster-buffer)
(global-set-key (kbd "<f7>") 'magit-status)
(global-set-key (kbd "<hiragana>") '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-e") 'oni:move-end-of-dwim)
(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
2013-05-15 17:35:51 +02:00
'("^\\*\\(?:.+-\\)?scratch\\*$" display-buffer-same-window))
(add-to-list
'display-buffer-alist
2013-05-15 17:35:51 +02:00
'("^\\*git-project-list\\*$" git-project-show-window))
(add-to-list
'display-buffer-alist
2013-05-15 17:35:51 +02:00
'("^\\*magit: .*\\*$" display-buffer-same-window))
(blink-cursor-mode -1)
(column-number-mode -1)
(line-number-mode -1)
(tooltip-mode -1)
(package-initialize)
(auto-insert-mode)
(electric-indent-mode)
(savehist-mode)
(show-paren-mode)
(winner-mode)
(smex-initialize)
(help-at-pt-set-timer)
(windmove-default-keybindings)
(global-diff-hl-mode)
;;; Diminish lighter for a bunch of minor modes that should be on in
;;; certain modes and usually just clogg up the mode line.
(diminish 'auto-fill-function)
2013-05-15 17:35:51 +02:00
(eval-after-load "auto-complete" '(diminish 'auto-complete-mode))
2013-05-15 17:35:51 +02:00
(eval-after-load "eldoc" '(diminish 'eldoc-mode))
(eval-after-load "flycheck" '(diminish 'flycheck-mode))
2013-05-15 17:35:51 +02:00
(eval-after-load "paredit" '(diminish 'paredit-mode))
(eval-after-load "rainbow-mode" '(diminish 'rainbow-mode))
(eval-after-load "smartparens" '(diminish 'smartparens-mode))
2013-05-15 17:35:51 +02:00
(eval-after-load "yasnippet" '(diminish 'yas-minor-mode))
;;; Popping up multiple frames out of the blue does not usually play
;;; well with (manual) tiling window managers.
(setq ediff-window-setup-function 'ediff-setup-windows-plain)
;;; Not being able to find newly written functions in imenu is a pain.
(setq imenu-auto-rescan t)
;;; Yanking at click makes not sense to me. I normally have my cursor
;;; where it needs to point and if I *have* to use the mouse I prefer
;;; just clicking it wherever it lands, without having to drag it all
;;; the way to the proper place.
(setq mouse-yank-at-point t)
;;; Always having to move the cursor around so much after scrolling
;;; gets annoying.
(setq scroll-preserve-screen-position t)
;;; I store my blog posts in `~/documents/blog', not the default
;;; `~/Blog'.
(setq eltuki-blog-dir "~/documents/blog")
(setq sp-cancel-autoskip-on-backward-movement nil)
(defun oni:scroll-down-or-prev-page (arg)
"Either scroll down or go to the previous page.
Depending on the value of `buffer-narrowed-p'."
2013-05-15 17:35:51 +02:00
(interactive "^P")
(if (buffer-narrowed-p)
2013-05-15 17:35:51 +02:00
(let ((scroll-error-top-bottom nil))
(condition-case nil
(scroll-down-command arg)
(beginning-of-buffer
(narrow-to-page -1)
(goto-char (point-min)))))
(scroll-down-command arg)))
(defun oni:scroll-up-or-next-page (arg)
"Either scroll up or go to the next page.
Depending on the value of `buffer-narrowed-p'."
2013-05-15 17:35:51 +02:00
(interactive "^P")
(if (buffer-narrowed-p)
2013-05-15 17:35:51 +02:00
(let ((scroll-error-top-bottom nil))
(condition-case nil
(scroll-up-command arg)
(end-of-buffer
(narrow-to-page 1)
(goto-char (point-min)))))
(scroll-up-command arg)))
(global-set-key (kbd "<prior>") 'oni:scroll-down-or-prev-page)
(global-set-key (kbd "<next>") 'oni:scroll-up-or-next-page)
;;; Emacs Alsa Player
(add-to-list 'load-path "~/.emacs.d/site-lisp/eap")
(load "eap-autoloads")
(setq eap-music-library "/mnt/music")
(setq eap-playlist-library "~/music/playlists")
2013-05-15 17:35:51 +02:00
;;;; Auto-complete
(setq-default ac-sources '(ac-source-imenu
ac-source-gtags
ac-source-abbrev
ac-source-yasnippet
ac-source-words-in-buffer
ac-source-words-in-same-mode-buffers
ac-source-dictionary
ac-source-functions
ac-source-symbols
ac-source-variables
ac-source-features))
;;;; Magit
(setq magit-default-tracking-name-function
'magit-default-tracking-name-branch-only)
(setq magit-diff-refine-hunk 'all)
;;; Finally, load any `customize' settings and slime.
(load custom-file)
(load (expand-file-name "~/quicklisp/slime-helper.el"))