summaryrefslogtreecommitdiffstats
path: root/.emacs.d/init.el
diff options
context:
space:
mode:
authorGravatar Tom Willemsen2012-09-25 22:20:43 +0200
committerGravatar Tom Willemsen2012-09-25 22:20:43 +0200
commit5b8d412cf79168fc6cdd45eac3ce65934d1f7b8d (patch)
treef534c84e67552c694dfa0cb5a6178446801612f2 /.emacs.d/init.el
parentb2de3d6412ba51111ce9b51cc2a3b384735e040a (diff)
parent73700816128c0788e822710dbad5e0bd3d8d54bf (diff)
downloaddotfiles-5b8d412cf79168fc6cdd45eac3ce65934d1f7b8d.tar.gz
dotfiles-5b8d412cf79168fc6cdd45eac3ce65934d1f7b8d.zip
Merge remote-tracking branch 'origin/master' into phoenix
Conflicts: .emacs.d/init.el
Diffstat (limited to '.emacs.d/init.el')
-rw-r--r--.emacs.d/init.el120
1 files changed, 46 insertions, 74 deletions
diff --git a/.emacs.d/init.el b/.emacs.d/init.el
index c0b184e..75c52e7 100644
--- a/.emacs.d/init.el
+++ b/.emacs.d/init.el
@@ -26,7 +26,6 @@
(autoload 'identica-mode "identica-mode" nil t)
(autoload 'jabber-connect "jabber" nil t)
(autoload 'mu4e "mu4e" nil t)
-(autoload 'naquadah-get-colors "naquadah-theme")
(autoload 'php-mode "php-mode" nil t)
(autoload 'po-mode "po-mode" nil t)
(autoload 'pony-mode "pony-mode" nil t)
@@ -48,32 +47,6 @@
(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
'((t (:inherit font-lock-type-face)))
"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) "."
(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
'("top" ("menu"
("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 ()
"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 ()
"Function for `c-mode-hook'."
@@ -206,9 +163,6 @@ Argument REGEX will be used to set `outline-regexp' for this buffer."
(defun oni:css-mode-func ()
"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)
(rainbow-mode))
@@ -218,9 +172,7 @@ Argument REGEX will be used to set `outline-regexp' for this buffer."
(defun oni:emacs-lisp-mode-func ()
"Function for `emacs-lisp-mode-hook'."
- (eldoc-mode)
- (when (buffer-file-name)
- (hs-minor-mode)))
+ (eldoc-mode))
(defun oni:emms-toggle-playing ()
"Toggle between playing/paused states."
@@ -251,8 +203,8 @@ Argument REGEX will be used to set `outline-regexp' for this buffer."
(concat
(propertize (char-to-string status)
'face `(:foreground ,(if (= status ?+)
- (oni:color chameleon-1)
- (oni:color scarlet-red-2))))
+ "green"
+ "red")))
" "
(propertize (substring hostname 0 -1) 'face 'mode-line-buffer-id)
" "
@@ -265,7 +217,7 @@ Argument REGEX will be used to set `outline-regexp' for this buffer."
'face 'font-lock-function-name-face))
" \n"
(propertize (char-to-string userstatus)
- 'face `(:foreground ,(oni:color sky-blue-1)))
+ 'face `(:foreground "blue"))
"> ")))
(defun oni:flymake-mode-func ()
@@ -279,7 +231,7 @@ Argument REGEX will be used to set `outline-regexp' for this buffer."
'flymake-create-temp-inplace))
(local-file (file-relative-name temp-file (file-name-directory
buffer-file-name))))
- (list "pyflakes" (list local-file))))
+ (list "pycheck.sh" (list local-file))))
(defun oni:go-mode-func ()
"Function for `go-mode-hook'."
@@ -291,11 +243,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-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 ()
"Function for `html-mode-hook'."
(fci-mode))
@@ -359,7 +306,6 @@ If COUNT has been specified indent by that much, otherwise look at
(defun oni:js-mode-func ()
"Function for `js-mode-hook'."
- (oni:generic-outline oni:javascript-outline-regex)
(rainbow-delimiters-mode)
(local-set-key "\C-j" 'oni:newline-and-indent)
(pretty-symbols-mode -1))
@@ -394,8 +340,7 @@ If COUNT has been specified indent by that much, otherwise look at
(defun oni:lisp-mode-func ()
"Function for `lisp-mode-hook'."
- (when (buffer-file-name)
- (hs-minor-mode)))
+ )
(defun oni:lua-mode-func()
"Function for `lisp-mode-hook'."
@@ -527,11 +472,9 @@ When dealing with braces, add another line and indent that too."
(flymake-mode)
(local-set-key (kbd "C->") 'python-indent-shift-right)
(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)
(rainbow-delimiters-mode)
- (setq fci-rule-column 80
+ (setq fci-rule-column 79
fill-column 72)
(fci-mode))
@@ -598,8 +541,7 @@ use. If MODE is not nil, open a new buffer with the name
(defun oni:scheme-mode-func ()
"Function for `scheme-mode-hook'."
- (when (buffer-file-name)
- (hs-minor-mode)))
+ )
(defun oni:self-insert-dwim ()
"Execute self insert, but when the region is active call self
@@ -622,6 +564,29 @@ insert at the end of the region and at the beginning."
(setq dir (replace-match "\\1/" nil nil 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 ()
"Check to see if the function `emms' exists, if not call
`emms-player-mpd-connect' and assume that will have loaded it."
@@ -846,6 +811,12 @@ for easy selection."
(setq flymake-gui-warnings-enabled nil)
(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"
+ "Missing docstring"
+ "String statement has no effect"))))
(setq frame-title-format '(:eval (concat "emacs: " (buffer-name))))
(setq geiser-repl-history-filename "~/.emacs.d/geiser-history")
(setq gtags-auto-update t)
@@ -1000,7 +971,6 @@ for easy selection."
(add-hook 'flymake-mode-hook 'oni:flymake-mode-func)
(add-hook 'go-mode-hook 'oni:go-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 'jabber-chat-mode-hook 'oni:jabber-chat-mode-func)
(add-hook 'jabber-roster-mode-hook 'oni:jabber-roster-mode-func)
@@ -1036,7 +1006,7 @@ for easy selection."
(global-set-key (kbd "<f8>") 'oni:raise-eshell)
(global-set-key (kbd "C-<") 'indent-shift-left)
(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-w") 'backward-kill-word)
(global-set-key (kbd "C-S-k") 'kill-whole-line)
@@ -1051,6 +1021,8 @@ for easy selection."
(global-set-key (kbd "C-x C-b") 'electric-buffer-list)
(global-set-key (kbd "M-n") 'idomenu)
(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)
(global-set-key "\C-x\C-c" 'oni:close-client-window)
@@ -1072,12 +1044,11 @@ for easy selection."
(add-to-list 'compilation-finish-functions
'oni:compilation-finish-function)
-(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 'display-buffer-alist
+ '(".*" . ((bw-display-in-other-window . nil))))
+(add-to-list 'display-buffer-alist
'("^\\*.*\\*$" . ((bw-display-in-bottom-window . nil))))
(unless (oni:required-packages-installed-p)
@@ -1095,18 +1066,19 @@ for easy selection."
(tool-bar-mode -1)
(tooltip-mode -1)
+(auto-insert-mode)
+(column-number-mode)
(electric-indent-mode)
(electric-pair-mode)
(ido-mode)
(ido-ubiquitous-mode)
(savehist-mode)
(show-paren-mode)
-(auto-insert-mode)
(smex-initialize)
(help-at-pt-set-timer)
-(load-theme 'naquadah t)
+(load-theme 'new t)
(load custom-file)
(load "rudel-loaddefs.el")