Permalink
Browse files

misc!

  • Loading branch information...
1 parent 90fbe7b commit e8740d50647f63992c2e5adb5fefaa5ee0fb21b2 @dakrone committed Mar 12, 2013
View
4 .emacs.d/init.d/01_basic_settings.el
@@ -43,6 +43,7 @@
;; enable yascrollbar
(global-yascroll-bar-mode)
+(add-to-list 'yascroll:disabled-modes 'git-gutter-mode)
;; not create backup file
(setq backup-inhibited t)
@@ -79,7 +80,7 @@
(require 'which-func)
(set-face-foreground 'which-func "chocolate4")
(set-face-bold-p 'which-func t)
-(which-func-mode t)
+(which-function-mode t)
;; invisible mouse cursor when editing text
(setq make-pointer-invisible t)
@@ -126,4 +127,3 @@
;; gpg stuff
(require 'epa-file)
(epa-file-enable)
-
View
3 .emacs.d/init.d/07_spelling.el
@@ -1,5 +1,6 @@
;; configuration of spell check
-(require 'ispell)
+;; ispell is already enabled on linux
+;; (require 'ispell)
(setq-default ispell-program-name "aspell")
(add-to-list 'ispell-skip-region-alist '("[^\000-\377]+"))
View
16 .emacs.d/init.d/08_auto-complete.el
@@ -49,19 +49,3 @@
(requires . 2)))
(global-set-key (kbd "C-M-l") 'ac-look)
-
-;; nrepl auto-complete
-(add-hook 'nrepl-mode-hook 'ac-nrepl-setup)
-(add-hook 'nrepl-interaction-mode-hook 'ac-nrepl-setup)
-(eval-after-load "auto-complete"
- '(add-to-list 'ac-modes 'nrepl-mode))
-
-(defun set-auto-complete-as-completion-at-point-function ()
- (setq completion-at-point-functions '(auto-complete)))
-(add-hook 'auto-complete-mode-hook
- 'set-auto-complete-as-completion-at-point-function)
-
-(add-hook 'nrepl-mode-hook 'set-auto-complete-as-completion-at-point-function)
-(add-hook 'nrepl-interaction-mode-hook
- 'set-auto-complete-as-completion-at-point-function)
-
View
8 .emacs.d/init.d/09_flymake.el
@@ -80,3 +80,11 @@
:underline t
;;:background "dark orange"
)))
+
+(flycheck-declare-checker yaml
+ "A YAML syntax checker using kwalify
+
+See URL `http://www.kuwata-lab.com/kwalify/'."
+ :command '("kwalify" "-E" "-P" "-m" source)
+ :error-patterns '(("^.+:\\(?2:[0-9+]\\):\\(?3:[0-9+]\\) \\(?4:.+\\)$" error))
+ :modes 'yaml-mode)
View
1 .emacs.d/init.d/15_yasnippet.el
@@ -6,6 +6,7 @@
;; enable yasnippet mode
(dolist (hook '(c-mode-hook
c++-mode-hook
+ clojure-mode-hook
cperl-mode-hook
emacs-lisp-mode-hook
js-mode-hook
View
23 .emacs.d/init.d/24_clojure.el
@@ -69,7 +69,24 @@
:scroll-bar t
:margin t))
-;; (define-key nrepl-interaction-mode-map
-;; (kbd "C-c C-d")
-;; 'nrepl-popup-tip-symbol-at-point)
+(add-hook 'nrepl-mode-hook
+ (lambda ()
+ (define-key nrepl-interaction-mode-map
+ (kbd "C-c C-d")
+ 'nrepl-popup-tip-symbol-at-point)))
(setq nrepl-popup-stacktraces nil)
+
+;; nrepl auto-complete
+(add-hook 'nrepl-mode-hook 'ac-nrepl-setup)
+(add-hook 'nrepl-interaction-mode-hook 'ac-nrepl-setup)
+(eval-after-load "auto-complete"
+ '(add-to-list 'ac-modes 'nrepl-mode))
+
+(defun set-auto-complete-as-completion-at-point-function ()
+ (setq completion-at-point-functions '(auto-complete)))
+(add-hook 'auto-complete-mode-hook
+ 'set-auto-complete-as-completion-at-point-function)
+
+(add-hook 'nrepl-mode-hook 'set-auto-complete-as-completion-at-point-function)
+(add-hook 'nrepl-interaction-mode-hook
+ 'set-auto-complete-as-completion-at-point-function)
View
157 .emacs.d/init.d/80_sonian.el
@@ -0,0 +1,157 @@
+;;; Slimy bits
+
+(eval-after-load 'slime
+ '(setq slime-words-of-encouragement
+ (append '("I'll take you 'round the you-knee-verse..."
+ "Time to hunt the glorious Piranhamoose."
+ "\"Shut up woman, get on my horse.\""
+ "Data Analysis Cosby uses a REPL, and so should you.")
+ slime-words-of-encouragement)))
+
+(defun lein-swank ()
+ (interactive)
+ (if (fboundp 'clojure-jack-in)
+ (progn (clojure-jack-in)
+ (message "Calling clojure-jack-in for you..."))
+ (message "Ooh, you should upgrade your clojure-mode, buddy.")))
+
+(defalias 'jack-in 'lein-swank)
+
+(defun swank-clojure-dim-font-lock ()
+ "Dim irrelevant lines in Clojure debugger buffers."
+ (if (string-match "clojure" (buffer-name))
+ (font-lock-add-keywords
+ nil `((,(concat " [0-9]+: " (regexp-opt '("clojure.core"
+ "clojure.lang"
+ "swank." "java."))
+ ;; TODO: regexes ending in .* are ignored by
+ ;; font-lock; what gives?
+ "[a-zA-Z0-9\\._$]*")
+ . font-lock-comment-face)) t)))
+
+(add-hook 'sldb-mode-hook 'swank-clojure-dim-font-lock)
+
+(ignore-errors
+ (load-file (expand-file-name "pcomplete-ssh.el"
+ (file-name-directory
+ (or (buffer-file-name) load-file-name)))))
+
+(setq slime-net-coding-system 'utf-8-unix) ; welcome to the 21st century, slime.
+
+(defvar safe-tunnel-process nil)
+
+(defvar safe-tunnel-port 4008)
+
+(defun safe-remote-slime ()
+ (interactive)
+ (let ((host (ido-completing-read "Host: " (pcmpl-ssh-hosts))))
+ (when (and safe-tunnel-process
+ (eq 'run (process-status safe-tunnel-process)))
+ (if (y-or-n-p "Tunnel already open; kill?")
+ (ignore-errors (kill-process safe-tunnel-process))
+ (error "Aborted.")))
+ (setq safe-tunnel-process
+ (start-process "safe-tunnel" "*safe-tunnel*" "ssh"
+ "-L" (format "%s:127.0.0.1:4005" safe-tunnel-port)
+ ;; TODO: launch swank if needed
+ host "echo connected && sleep 16"))
+ (set-process-filter safe-tunnel-process
+ (lambda (process output)
+ (with-current-buffer "*safe-tunnel*"
+ (insert output))
+ (when (string-match "connected" output)
+ (slime-connect "localhost" safe-tunnel-port)
+ (set-process-filter process nil))))))
+
+(ignore-errors
+ (load-file (expand-file-name "cdt.el"
+ (file-name-directory
+ (or (buffer-file-name) load-file-name)))))
+
+;;; Magit
+
+(defun add-safe-ticket-number ()
+ (when (string-match "\\(sa-\\)?safe.*/$" default-directory)
+ (goto-char (point-max))
+ (let* ((branch (magit-get-current-branch))
+ (parts (split-string branch "-"))
+ (project (first parts))
+ (ticket-number (second parts)))
+ (when (and ticket-number (string-match "^[0-9]+$" ticket-number)
+ (= (point-min) (point-max)))
+ (insert "[#" project "-" ticket-number "] ")))))
+
+(eval-after-load 'magit
+ '(defadvice magit-log-edit-toggle-amending (before clear-ticket activate)
+ (delete-region (point-min) (point-max))))
+
+(add-hook 'magit-log-edit-mode-hook 'add-safe-ticket-number)
+
+(setq clojure-test-ns-segment-position 1)
+
+(put 'ns+ 'clojure-indent-function 1)
+
+;;; Hooks
+
+(defun sonian-format-buffer ()
+ "Should be used in a git-hook because calling this function
+actually kills emacs. Exits with code 0 if the file is correctly
+formatted, 1 if it isn't."
+ (indent-region (point-min) (point-max))
+ (untabify (point-min) (point-max))
+ (delete-trailing-whitespace)
+ (if (buffer-modified-p)
+ (kill-emacs 1)
+ (kill-emacs 0)))
+
+(when (> emacs-major-version 23)
+ ;; Emacs 24 needs new whitespace-style settings
+ (setq whitespace-style '(face trailing lines-tail tabs)
+ whitespace-line-column 80))
+
+(eval-after-load 'clojure-mode
+ '(add-hook 'clojure-mode-hook
+ (lambda ()
+ (progn
+ (font-lock-add-keywords
+ 'clojure-mode
+ '(("(\\(with-[^[:space:]]*\\)" (1 font-lock-keyword-face))
+ ("(\\(when-[^[:space:]]*\\)" (1 font-lock-keyword-face))
+ ("(\\(if-[^[:space:]]*\\)" (1 font-lock-keyword-face))
+ ("(\\(def[^[:space:]]*\\)" (1 font-lock-keyword-face))
+ ("(\\(ns\\+\\)" (1 font-lock-keyword-face))
+ ("(\\(try\\+\\)" (1 font-lock-keyword-face))
+ ("(\\(ensure-call-counts\\)" (1 font-lock-keyword-face))
+ ("(\\(while-guarded\\)" (1 font-lock-keyword-face))
+ ("(\\(throw\\+\\)" (1 font-lock-keyword-face))))
+ (put-clojure-indent 'ensure-call-counts 'defun)
+ (put-clojure-indent 'while-guarded 'defun)
+ (put-clojure-indent 'when-lock 'defun)
+ (put-clojure-indent 'if-lock 'defun)
+ (put-clojure-indent 'parallel-calling-doseq 'defun)
+ (put-clojure-indent 'do1 'defun)))))
+
+(defvar namespace-buffers '()
+ "alist of namespace => buffer")
+
+(add-hook 'clojure-mode-hook
+ (lambda ()
+ (let ((some-ns (clojure-find-ns)))
+ (setq namespace-buffers
+ (cons (cons some-ns (current-buffer))
+ (assq-delete-all some-ns namespace-buffers))))))
+
+(add-hook 'kill-buffer-hook
+ (lambda ()
+ (setq namespace-buffers
+ (rassq-delete-all (current-buffer)
+ namespace-buffers))))
+
+(defun goto-namespace ()
+ (interactive)
+ (let ((buf-name (ido-completing-read "Goto ns: "
+ (mapcar (lambda (x) (car x))
+ namespace-buffers))))
+ (switch-to-buffer (cdr (assoc buf-name namespace-buffers)))))
+
+(provide 'sonian)
View
54 .emacs.d/init.d/82_dictionary.el
@@ -1,54 +0,0 @@
-;; SDIC dictonary for Linux
-(autoload 'sdic-describe-word "sdic" "search word" t nil)
-(global-set-key (kbd "C-c w") 'sdic-describe-word)
-
-(eval-after-load "sdic"
- '(progn
- (global-set-key (kbd "C-c W") 'sdic-describe-word-at-point)
- (setq sdic-default-coding-system 'utf-8)
-
- (setq sdicf-array-command "/usr/bin/sary") ;; my modified sary command path
- (setq sdic-eiwa-dictionary-list
- '((sdicf-client "/home/syohei/local/dict/eijiro127.sdic"
- (strategy array))))
- (setq sdic-waei-dictionary-list
- '((sdicf-client "/home/syohei/local/dict/waeiji127.sdic"
- (strategy array))))
- ;; saryを直接使用できるように sdicf.el 内に定義されている
- ;; arrayコマンド用関数を強制的に置換
- (fset 'sdicf-array-init 'sdicf-common-init)
- (fset 'sdicf-array-quit 'sdicf-common-quit)
- (fset 'sdicf-array-search
- (lambda (sdic pattern &optional case regexp)
- (sdicf-array-init sdic)
- (if regexp
- (signal 'sdicf-invalid-method '(regexp))
- (save-excursion
- (set-buffer (sdicf-get-buffer sdic))
- (delete-region (point-min) (point-max))
- (apply 'sdicf-call-process
- sdicf-array-command
- (sdicf-get-coding-system sdic)
- nil t nil
- (if case
- (list "-i" pattern (sdicf-get-filename sdic))
- (list pattern (sdicf-get-filename sdic))))
- (goto-char (point-min))
- (let (entries)
- (while (not (eobp)) (sdicf-search-internal))
- (nreverse entries))))))
-
- (defadvice sdic-search-eiwa-dictionary (after highlight-phrase (arg) activate)
- (highlight-phrase arg "hi-yellow"))
- (defadvice sdic-search-waei-dictionary (after highlight-phrase (arg) activate)
- (highlight-phrase arg "hi-yellow"))
-
- ;; omake
- (defadvice sdic-forward-item (after sdic-forward-item-always-top activate)
- (recenter 0))
- (defadvice sdic-backward-item (after sdic-backward-item-always-top activate)
- (recenter 0))))
-
-(defun sdic-popup-last-word ()
- (interactive)
- (pop-to-buffer "*sdic*"))
View
16 .vimperator/noscript.js
@@ -40,9 +40,9 @@
*/
function NoscriptVimperator() {
var popup = (
- noscriptOverlay.stickyUI &&
- noscriptOverlay.ns.getPref("stickyUI.onKeyboard") &&
- (popup = noscriptOverlay.stickyUI)
+ window.noscriptOverlay.stickyUI &&
+ window.noscriptOverlay.ns.getPref("stickyUI.onKeyboard") &&
+ (popup = window.noscriptOverlay.stickyUI)
) || document.getElementById("noscript-status-popup");
popup.addEventListener('popupshown', popupshown, true);
popup.addEventListener('popuphidden', popuphidden, true);
@@ -94,21 +94,21 @@ function NoscriptVimperator() {
return {
info: function(){
- liberator.echo(util.objectToString(noscriptOverlay.getSites(), true));
+ liberator.echo(util.objectToString(window.noscriptOverlay.getSites(), true));
},
popup: function(){
- noscriptOverlay.showUI();
+ window.noscriptOverlay.showUI();
},
toggletemp: function(){
- noscriptOverlay.toggleCurrentPage(3);
+ window.noscriptOverlay.toggleCurrentPage(3);
},
toggleperm: function(){
- const ns = noscriptOverlay.ns;
+ const ns = window.noscriptOverlay.ns;
const url = ns.getQuickSite(content.document.documentURI, /*level*/ 3);
- noscriptOverlay.safeAllow(url, !ns.isJSEnabled(url), false);
+ window.noscriptOverlay.safeAllow(url, !ns.isJSEnabled(url), false);
},
_execute: function(args){
View
4 .vimperatorrc
@@ -6,8 +6,8 @@
"set guioptions+=B
" Source noscript plugin
-"source ~/.vimperator/noscript.js
-"nnoremap ,n :noscript popup<CR>
+source ~/.vimperator/noscript.js
+nnoremap ,n :noscript popup<CR>
" Show status bar in fullscreen mode
nmap ,ss :js document.getElementById("status-bar").setAttribute("moz-collapsed", false)<CR>

0 comments on commit e8740d5

Please sign in to comment.