.emacs.d/init.el
This commit is contained in:
parent
cf592759af
commit
555164a19a
1 changed files with 46 additions and 74 deletions
120
.emacs.d/init.el
120
.emacs.d/init.el
|
@ -26,7 +26,6 @@
|
||||||
(autoload 'identica-mode "identica-mode" nil t)
|
(autoload 'identica-mode "identica-mode" nil t)
|
||||||
(autoload 'jabber-connect "jabber" nil t)
|
(autoload 'jabber-connect "jabber" nil t)
|
||||||
(autoload 'mu4e "mu4e" nil t)
|
(autoload 'mu4e "mu4e" nil t)
|
||||||
(autoload 'naquadah-get-colors "naquadah-theme")
|
|
||||||
(autoload 'php-mode "php-mode" nil t)
|
(autoload 'php-mode "php-mode" nil t)
|
||||||
(autoload 'po-mode "po-mode" nil t)
|
(autoload 'po-mode "po-mode" nil t)
|
||||||
(autoload 'pony-mode "pony-mode" nil t)
|
(autoload 'pony-mode "pony-mode" nil t)
|
||||||
|
@ -48,32 +47,6 @@
|
||||||
|
|
||||||
(defalias 'yes-or-no-p 'y-or-n-p)
|
(defalias 'yes-or-no-p 'y-or-n-p)
|
||||||
|
|
||||||
(defconst oni:c-outline-regex
|
|
||||||
(eval-when-compile
|
|
||||||
(concat
|
|
||||||
"\\(?:static\\s +\\)?\\(?:\\sw+\\(?: \\|\t\\|\n\\)*?\\*?\\)"
|
|
||||||
"\\(?:\\s \\|\t\\|\n\\)\\(?:\\sw\\|_\\)+([^)]*)[^;\n]*$"))
|
|
||||||
"Regex for command `outline-minor-mode' for `c-mode'.")
|
|
||||||
|
|
||||||
(defconst oni:javascript-outline-regex "function \\(\\w\\|_\\)+("
|
|
||||||
"Regex for command `outline-minor-mode' for `js-mode'.")
|
|
||||||
|
|
||||||
(defconst oni:php-outline-regex
|
|
||||||
(eval-when-compile
|
|
||||||
(concat
|
|
||||||
"^ *\\(\\(?:namespace\\|interface\\) [a-zA-Z0-9_]\\|\\(\\(abstract"
|
|
||||||
"\\|final\\) \\)?class [a-zA-Z0-9_]+\\( extends [\\a-zA-Z0-9_]+\\)?"
|
|
||||||
"\\|\\(abstract \\)?\\(public\\|private\\|protected\\)?"
|
|
||||||
"\\( static\\)? function [a-zA-Z0-9_]+(\\|/\\*\\*\\)"))
|
|
||||||
"Regex for command `outline-minor-mode' for `php-mode'.")
|
|
||||||
|
|
||||||
(defconst oni:python-outline-regex
|
|
||||||
(eval-when-compile
|
|
||||||
(concat "^[ \t]*\\(?:@[a-zA-Z0-9_]+\\(?:([a-zA-Z0-9_=, ]*)\\)?"
|
|
||||||
"\n\\)*[ \t]*\\(?:\\(class\\|def\\)[ \t]+\\(\\sw\\|\\s_\\)+"
|
|
||||||
"\\(([^)]*):\\)?\\|\\#[ a-zA-Z0-9]*\\#\\)"))
|
|
||||||
"Regex for command `outline-minor-mode' for `python-mode'.")
|
|
||||||
|
|
||||||
(defface oni:mode-line-buffer-column
|
(defface oni:mode-line-buffer-column
|
||||||
'((t (:inherit font-lock-type-face)))
|
'((t (:inherit font-lock-type-face)))
|
||||||
"Face for the column number in the mode-line"
|
"Face for the column number in the mode-line"
|
||||||
|
@ -127,20 +100,6 @@ DOT are intentionally being skipped."
|
||||||
(concat (symbol-name user) "@" (symbol-name host) "."
|
(concat (symbol-name user) "@" (symbol-name host) "."
|
||||||
(symbol-name com)))
|
(symbol-name com)))
|
||||||
|
|
||||||
(defmacro oni:generic-outline (regex)
|
|
||||||
"Prepare for enabling command `outline-minor-mode'.
|
|
||||||
Argument REGEX will be used to set `outline-regexp' for this buffer."
|
|
||||||
`(progn
|
|
||||||
(when (buffer-file-name)
|
|
||||||
(outline-minor-mode)
|
|
||||||
(set (make-local-variable 'outline-regexp) ,regex)
|
|
||||||
(hide-body)
|
|
||||||
(local-set-key [C-tab] 'outline-toggle-children))))
|
|
||||||
|
|
||||||
(defmacro oni:color (name)
|
|
||||||
"Fetch color NAME from the naquadah color theme."
|
|
||||||
`(naquadah-get-colors (quote ,name)))
|
|
||||||
|
|
||||||
(defvar oni:mailbox-map
|
(defvar oni:mailbox-map
|
||||||
'("top" ("menu"
|
'("top" ("menu"
|
||||||
("ryulash.org" . "ryuslash")
|
("ryulash.org" . "ryuslash")
|
||||||
|
@ -174,9 +133,7 @@ Argument REGEX will be used to set `outline-regexp' for this buffer."
|
||||||
|
|
||||||
(defun oni:c-mode-common-func ()
|
(defun oni:c-mode-common-func ()
|
||||||
"Function for `c-mode-common-hook'."
|
"Function for `c-mode-common-hook'."
|
||||||
(setq hs-adjust-block-beginning 'hs-c-like-adjust-block-beginning)
|
)
|
||||||
(when (buffer-file-name)
|
|
||||||
(hs-minor-mode)))
|
|
||||||
|
|
||||||
(defun oni:c-mode-func ()
|
(defun oni:c-mode-func ()
|
||||||
"Function for `c-mode-hook'."
|
"Function for `c-mode-hook'."
|
||||||
|
@ -199,9 +156,6 @@ Argument REGEX will be used to set `outline-regexp' for this buffer."
|
||||||
|
|
||||||
(defun oni:css-mode-func ()
|
(defun oni:css-mode-func ()
|
||||||
"Function for `css-mode-hook'."
|
"Function for `css-mode-hook'."
|
||||||
(setq hs-adjust-block-beginning 'hs-c-like-adjust-block-beginning)
|
|
||||||
(when (buffer-file-name)
|
|
||||||
(hs-minor-mode))
|
|
||||||
(local-set-key "\C-j" 'oni:newline-and-indent)
|
(local-set-key "\C-j" 'oni:newline-and-indent)
|
||||||
(rainbow-mode))
|
(rainbow-mode))
|
||||||
|
|
||||||
|
@ -211,9 +165,7 @@ Argument REGEX will be used to set `outline-regexp' for this buffer."
|
||||||
|
|
||||||
(defun oni:emacs-lisp-mode-func ()
|
(defun oni:emacs-lisp-mode-func ()
|
||||||
"Function for `emacs-lisp-mode-hook'."
|
"Function for `emacs-lisp-mode-hook'."
|
||||||
(eldoc-mode)
|
(eldoc-mode))
|
||||||
(when (buffer-file-name)
|
|
||||||
(hs-minor-mode)))
|
|
||||||
|
|
||||||
(defun oni:emms-toggle-playing ()
|
(defun oni:emms-toggle-playing ()
|
||||||
"Toggle between playing/paused states."
|
"Toggle between playing/paused states."
|
||||||
|
@ -244,8 +196,8 @@ Argument REGEX will be used to set `outline-regexp' for this buffer."
|
||||||
(concat
|
(concat
|
||||||
(propertize (char-to-string status)
|
(propertize (char-to-string status)
|
||||||
'face `(:foreground ,(if (= status ?+)
|
'face `(:foreground ,(if (= status ?+)
|
||||||
(oni:color chameleon-1)
|
"green"
|
||||||
(oni:color scarlet-red-2))))
|
"red")))
|
||||||
" "
|
" "
|
||||||
(propertize (substring hostname 0 -1) 'face 'mode-line-buffer-id)
|
(propertize (substring hostname 0 -1) 'face 'mode-line-buffer-id)
|
||||||
" "
|
" "
|
||||||
|
@ -258,7 +210,7 @@ Argument REGEX will be used to set `outline-regexp' for this buffer."
|
||||||
'face 'font-lock-function-name-face))
|
'face 'font-lock-function-name-face))
|
||||||
" \n"
|
" \n"
|
||||||
(propertize (char-to-string userstatus)
|
(propertize (char-to-string userstatus)
|
||||||
'face `(:foreground ,(oni:color sky-blue-1)))
|
'face `(:foreground "blue"))
|
||||||
"> ")))
|
"> ")))
|
||||||
|
|
||||||
(defun oni:flymake-mode-func ()
|
(defun oni:flymake-mode-func ()
|
||||||
|
@ -272,7 +224,7 @@ Argument REGEX will be used to set `outline-regexp' for this buffer."
|
||||||
'flymake-create-temp-inplace))
|
'flymake-create-temp-inplace))
|
||||||
(local-file (file-relative-name temp-file (file-name-directory
|
(local-file (file-relative-name temp-file (file-name-directory
|
||||||
buffer-file-name))))
|
buffer-file-name))))
|
||||||
(list "pyflakes" (list local-file))))
|
(list "pycheck.sh" (list local-file))))
|
||||||
|
|
||||||
(defun oni:go-mode-func ()
|
(defun oni:go-mode-func ()
|
||||||
"Function for `go-mode-hook'."
|
"Function for `go-mode-hook'."
|
||||||
|
@ -284,11 +236,6 @@ Argument REGEX will be used to set `outline-regexp' for this buffer."
|
||||||
(local-set-key "\M-," 'gtags-find-tag)
|
(local-set-key "\M-," 'gtags-find-tag)
|
||||||
(local-set-key "\M-." 'gtags-find-rtag))
|
(local-set-key "\M-." 'gtags-find-rtag))
|
||||||
|
|
||||||
(defun oni:hs-minor-mode-func ()
|
|
||||||
"Function for `hs-minor-mode-hook'."
|
|
||||||
(local-set-key [C-tab] 'hs-toggle-hiding)
|
|
||||||
(hs-hide-all))
|
|
||||||
|
|
||||||
(defun oni:html-mode-func ()
|
(defun oni:html-mode-func ()
|
||||||
"Function for `html-mode-hook'."
|
"Function for `html-mode-hook'."
|
||||||
(fci-mode))
|
(fci-mode))
|
||||||
|
@ -352,7 +299,6 @@ If COUNT has been specified indent by that much, otherwise look at
|
||||||
|
|
||||||
(defun oni:js-mode-func ()
|
(defun oni:js-mode-func ()
|
||||||
"Function for `js-mode-hook'."
|
"Function for `js-mode-hook'."
|
||||||
(oni:generic-outline oni:javascript-outline-regex)
|
|
||||||
(rainbow-delimiters-mode)
|
(rainbow-delimiters-mode)
|
||||||
(local-set-key "\C-j" 'oni:newline-and-indent)
|
(local-set-key "\C-j" 'oni:newline-and-indent)
|
||||||
(pretty-symbols-mode -1))
|
(pretty-symbols-mode -1))
|
||||||
|
@ -387,8 +333,7 @@ If COUNT has been specified indent by that much, otherwise look at
|
||||||
|
|
||||||
(defun oni:lisp-mode-func ()
|
(defun oni:lisp-mode-func ()
|
||||||
"Function for `lisp-mode-hook'."
|
"Function for `lisp-mode-hook'."
|
||||||
(when (buffer-file-name)
|
)
|
||||||
(hs-minor-mode)))
|
|
||||||
|
|
||||||
(defun oni:lua-mode-func()
|
(defun oni:lua-mode-func()
|
||||||
"Function for `lisp-mode-hook'."
|
"Function for `lisp-mode-hook'."
|
||||||
|
@ -520,11 +465,9 @@ When dealing with braces, add another line and indent that too."
|
||||||
(flymake-mode)
|
(flymake-mode)
|
||||||
(local-set-key (kbd "C->") 'python-indent-shift-right)
|
(local-set-key (kbd "C->") 'python-indent-shift-right)
|
||||||
(local-set-key (kbd "C-<") 'python-indent-shift-left)
|
(local-set-key (kbd "C-<") 'python-indent-shift-left)
|
||||||
(local-set-key [C-tab] 'outline-toggle-children)
|
|
||||||
(oni:generic-outline oni:python-outline-regex)
|
|
||||||
(set (make-local-variable 'electric-indent-chars) nil)
|
(set (make-local-variable 'electric-indent-chars) nil)
|
||||||
(rainbow-delimiters-mode)
|
(rainbow-delimiters-mode)
|
||||||
(setq fci-rule-column 80
|
(setq fci-rule-column 79
|
||||||
fill-column 72)
|
fill-column 72)
|
||||||
(fci-mode))
|
(fci-mode))
|
||||||
|
|
||||||
|
@ -591,8 +534,7 @@ use. If MODE is not nil, open a new buffer with the name
|
||||||
|
|
||||||
(defun oni:scheme-mode-func ()
|
(defun oni:scheme-mode-func ()
|
||||||
"Function for `scheme-mode-hook'."
|
"Function for `scheme-mode-hook'."
|
||||||
(when (buffer-file-name)
|
)
|
||||||
(hs-minor-mode)))
|
|
||||||
|
|
||||||
(defun oni:self-insert-dwim ()
|
(defun oni:self-insert-dwim ()
|
||||||
"Execute self insert, but when the region is active call self
|
"Execute self insert, but when the region is active call self
|
||||||
|
@ -615,6 +557,29 @@ insert at the end of the region and at the beginning."
|
||||||
(setq dir (replace-match "\\1/" nil nil dir)))
|
(setq dir (replace-match "\\1/" nil nil dir)))
|
||||||
dir)
|
dir)
|
||||||
|
|
||||||
|
(defun oni:split-window-interactive (dir)
|
||||||
|
"Split windows in direction DIR.
|
||||||
|
|
||||||
|
Can also delete or switch to another window."
|
||||||
|
(interactive
|
||||||
|
(list (read-char "Direction (h,v,q,d,o): ")))
|
||||||
|
(case dir
|
||||||
|
((?v) (split-window-vertically))
|
||||||
|
((?h) (split-window-horizontally))
|
||||||
|
((?q) (delete-other-windows))
|
||||||
|
((?d) (delete-window))
|
||||||
|
((?o) (other-window 1))))
|
||||||
|
|
||||||
|
(defun oni:split-window-interactively (window)
|
||||||
|
"Ask for a direction and split WINDOW that way.
|
||||||
|
|
||||||
|
If no direction is given, don't split."
|
||||||
|
(let ((dir (read-char "Direction (h,v): ")))
|
||||||
|
(case dir
|
||||||
|
((?v) (split-window-vertically))
|
||||||
|
((?h) (split-window-horizontally))
|
||||||
|
(t window))))
|
||||||
|
|
||||||
(defun oni:start-emms ()
|
(defun oni:start-emms ()
|
||||||
"Check to see if the function `emms' exists, if not call
|
"Check to see if the function `emms' exists, if not call
|
||||||
`emms-player-mpd-connect' and assume that will have loaded it."
|
`emms-player-mpd-connect' and assume that will have loaded it."
|
||||||
|
@ -839,6 +804,12 @@ for easy selection."
|
||||||
(setq flymake-gui-warnings-enabled nil)
|
(setq flymake-gui-warnings-enabled nil)
|
||||||
(setq flymake-log-file-name (expand-file-name "~/.emacs.d/flymake.log"))
|
(setq flymake-log-file-name (expand-file-name "~/.emacs.d/flymake.log"))
|
||||||
(setq flymake-log-level 0)
|
(setq flymake-log-level 0)
|
||||||
|
(setq flymake-warn-line-regexp
|
||||||
|
(eval-when-compile
|
||||||
|
(regexp-opt '("warning"
|
||||||
|
"Warning"
|
||||||
|
"Missing docstring"
|
||||||
|
"String statement has no effect"))))
|
||||||
(setq frame-title-format '(:eval (concat "emacs: " (buffer-name))))
|
(setq frame-title-format '(:eval (concat "emacs: " (buffer-name))))
|
||||||
(setq geiser-repl-history-filename "~/.emacs.d/geiser-history")
|
(setq geiser-repl-history-filename "~/.emacs.d/geiser-history")
|
||||||
(setq gtags-auto-update t)
|
(setq gtags-auto-update t)
|
||||||
|
@ -993,7 +964,6 @@ for easy selection."
|
||||||
(add-hook 'flymake-mode-hook 'oni:flymake-mode-func)
|
(add-hook 'flymake-mode-hook 'oni:flymake-mode-func)
|
||||||
(add-hook 'go-mode-hook 'oni:go-mode-func)
|
(add-hook 'go-mode-hook 'oni:go-mode-func)
|
||||||
(add-hook 'gtags-mode-hook 'oni:gtags-mode-func)
|
(add-hook 'gtags-mode-hook 'oni:gtags-mode-func)
|
||||||
(add-hook 'hs-minor-mode-hook 'oni:hs-minor-mode-func)
|
|
||||||
(add-hook 'html-mode-hook 'oni:html-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-chat-mode-hook 'oni:jabber-chat-mode-func)
|
||||||
(add-hook 'jabber-roster-mode-hook 'oni:jabber-roster-mode-func)
|
(add-hook 'jabber-roster-mode-hook 'oni:jabber-roster-mode-func)
|
||||||
|
@ -1029,7 +999,7 @@ for easy selection."
|
||||||
(global-set-key (kbd "<f8>") 'oni:raise-eshell)
|
(global-set-key (kbd "<f8>") 'oni:raise-eshell)
|
||||||
(global-set-key (kbd "C-<") 'indent-shift-left)
|
(global-set-key (kbd "C-<") 'indent-shift-left)
|
||||||
(global-set-key (kbd "C->") 'indent-shift-right)
|
(global-set-key (kbd "C->") 'indent-shift-right)
|
||||||
(global-set-key (kbd "C-@") 'er/expand-region)
|
(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-d") 'kill-word)
|
||||||
(global-set-key (kbd "C-M-w") 'backward-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-S-k") 'kill-whole-line)
|
||||||
|
@ -1044,6 +1014,8 @@ for easy selection."
|
||||||
(global-set-key (kbd "C-x C-b") 'electric-buffer-list)
|
(global-set-key (kbd "C-x C-b") 'electric-buffer-list)
|
||||||
(global-set-key (kbd "M-n") 'idomenu)
|
(global-set-key (kbd "M-n") 'idomenu)
|
||||||
(global-set-key (kbd "\"") 'oni:self-insert-dwim)
|
(global-set-key (kbd "\"") 'oni:self-insert-dwim)
|
||||||
|
(global-set-key (kbd "M-4") 'split-window-horizontally)
|
||||||
|
(global-set-key (kbd "C-M-4") 'split-window-vertically)
|
||||||
|
|
||||||
(if (daemonp)
|
(if (daemonp)
|
||||||
(global-set-key "\C-x\C-c" 'oni:close-client-window)
|
(global-set-key "\C-x\C-c" 'oni:close-client-window)
|
||||||
|
@ -1062,11 +1034,10 @@ for easy selection."
|
||||||
(add-to-list 'auto-mode-alist '("^PKGBUILD$" . shell-script-mode))
|
(add-to-list 'auto-mode-alist '("^PKGBUILD$" . shell-script-mode))
|
||||||
(add-to-list 'auto-mode-alist '("^\\.Xmodmap$" . xmodmap-mode))
|
(add-to-list 'auto-mode-alist '("^\\.Xmodmap$" . xmodmap-mode))
|
||||||
|
|
||||||
(add-to-list 'custom-theme-load-path
|
|
||||||
(concat custom-theme-directory "/naquadah-theme"))
|
|
||||||
|
|
||||||
(add-to-list 'debug-ignored-errors "^Can't shift all lines enough")
|
(add-to-list 'debug-ignored-errors "^Can't shift all lines enough")
|
||||||
|
|
||||||
|
(add-to-list 'display-buffer-alist
|
||||||
|
'(".*" . ((bw-display-in-other-window . nil))))
|
||||||
(add-to-list 'display-buffer-alist
|
(add-to-list 'display-buffer-alist
|
||||||
'("^\\*.*\\*$" . ((bw-display-in-bottom-window . nil))))
|
'("^\\*.*\\*$" . ((bw-display-in-bottom-window . nil))))
|
||||||
|
|
||||||
|
@ -1085,18 +1056,19 @@ for easy selection."
|
||||||
(tool-bar-mode -1)
|
(tool-bar-mode -1)
|
||||||
(tooltip-mode -1)
|
(tooltip-mode -1)
|
||||||
|
|
||||||
|
(auto-insert-mode)
|
||||||
|
(column-number-mode)
|
||||||
(electric-indent-mode)
|
(electric-indent-mode)
|
||||||
(electric-pair-mode)
|
(electric-pair-mode)
|
||||||
(ido-mode)
|
(ido-mode)
|
||||||
(ido-ubiquitous-mode)
|
(ido-ubiquitous-mode)
|
||||||
(savehist-mode)
|
(savehist-mode)
|
||||||
(show-paren-mode)
|
(show-paren-mode)
|
||||||
(auto-insert-mode)
|
|
||||||
|
|
||||||
(smex-initialize)
|
(smex-initialize)
|
||||||
(help-at-pt-set-timer)
|
(help-at-pt-set-timer)
|
||||||
|
|
||||||
(load-theme 'naquadah t)
|
(load-theme 'new t)
|
||||||
|
|
||||||
(load custom-file)
|
(load custom-file)
|
||||||
(load "rudel-loaddefs.el")
|
(load "rudel-loaddefs.el")
|
||||||
|
|
Loading…
Reference in a new issue