summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--tag-emacs/emacs.d/Cask1
-rw-r--r--tag-emacs/emacs.d/init.org45
2 files changed, 31 insertions, 15 deletions
diff --git a/tag-emacs/emacs.d/Cask b/tag-emacs/emacs.d/Cask
index ba75ee8a..ead4a523 100644
--- a/tag-emacs/emacs.d/Cask
+++ b/tag-emacs/emacs.d/Cask
@@ -130,6 +130,7 @@
 (depends-on "smex")
 (depends-on "solarized-theme")
 (depends-on "spinner")
+(depends-on "spotlight")
 (depends-on "swiper")
 (depends-on "tern")
 (depends-on "toml-mode")
diff --git a/tag-emacs/emacs.d/init.org b/tag-emacs/emacs.d/init.org
index ba3b610e..eea2e00f 100644
--- a/tag-emacs/emacs.d/init.org
+++ b/tag-emacs/emacs.d/init.org
@@ -338,7 +338,7 @@ because I manage those in my [[file:~/projects/dotfiles/tag-xresources/xresource
    ((eq window-system 'w32)
     (ap/set-fonts "Consolas" "Segoe UI" 10))
    ((eq system-type 'darwin)
-    (ap/set-fonts "Hack" "Helvetica" 12))))
+    (ap/set-fonts "Input Mono Narrow" "Input Sans Condensed" 12))))
 #+END_SRC
 
 Allow font-lock-mode to do background parsing.  I’m not really sure if
@@ -514,6 +514,16 @@ I only use this occasionally, but it’s nice for files outside of projects.
                (recentf-mode 1)))
 #+END_SRC
 
+** spotlight
+
+An awesome way to open files on OS X.
+
+#+BEGIN_SRC emacs-lisp
+  (req-package spotlight
+    :if (eq system-type 'darwin)
+    :config (setq spotlight-tmp-file "/tmp/.emacs-spotlight-tmp-file"))
+#+END_SRC
+
 ** saveplace
 
 It.. saves the position I visited a file at last.  Might try turning
@@ -1094,33 +1104,33 @@ Option/alt, then Control.
 
 #+BEGIN_SRC emacs-lisp
   (unbind-key "<f4>")
-  (bind-key "<f5>" #'compile)
-  (bind-key "<f6>" #'kmacro-start-macro-or-insert-counter)
-  (bind-key "<f7>" #'kmacro-end-or-call-macro)
+  (bind-key* "<f5>" #'compile)
+  (bind-key* "<f6>" #'kmacro-start-macro-or-insert-counter)
+  (bind-key* "<f7>" #'kmacro-end-or-call-macro)
 
-  (bind-key "<apps>" #'execute-extended-command)
+  (bind-key* "<apps>" #'execute-extended-command)
 
   (unbind-key "C-z")
-  (bind-key "C-<tab>" #'other-window)
+  (bind-key* "C-<tab>" #'other-window)
 
-  (bind-key "C-x C-r" #'revert-buffer)
-  (bind-key "C-x C-j" #'delete-indentation)
+  (bind-key* "C-x C-r" #'revert-buffer)
+  (bind-key* "C-x C-j" #'delete-indentation)
   (unbind-key "C-x C-c")
 
-  (bind-key "C-c i" #'insert-char)
-  (bind-key "M-/" #'hippie-expand)
+  (bind-key* "C-c i" #'insert-char)
+  (bind-key* "M-/" #'hippie-expand)
 
   (unbind-key "s-h")
   (unbind-key "s-n")
   (unbind-key "s-p")
   (unbind-key "s-w")
-  (bind-key "s-k" #'kill-or-delete-this-buffer-dwim)
+  (bind-key* "s-k" #'kill-or-delete-this-buffer-dwim)
 
-  (bind-key "C-M-a" #'backward-paragraph text-mode-map)
-  (bind-key "C-M-e" #'forward-paragraph text-mode-map)
+  (bind-key* "C-M-a" #'backward-paragraph text-mode-map)
+  (bind-key* "C-M-e" #'forward-paragraph text-mode-map)
 
-  (bind-key "s-x" (define-prefix-command 'super-x-map))
-  (bind-key "s-," #'switch-to-dotfiles)
+  (bind-key* "s-x" (define-prefix-command 'super-x-map))
+  (bind-key* "s-," #'switch-to-dotfiles)
   (set-register ?z `(file . ,(expand-file-name ".config/zsh/zshrc" "~")))
 #+END_SRC
 * Misc
@@ -1233,6 +1243,11 @@ replace helm and ido.
            ("C-x C-f" . counsel-find-file)
            ("C-x b" . counsel-switch-to-projectile-buffer))
     :config (progn
+              (defadvice counsel-find-file (after find-file-sudo activate)
+                "Find file as root if necessary."
+                (unless (and buffer-file-name
+                             (file-writable-p buffer-file-name))
+                  (find-alternate-file (concat "/sudo::" buffer-file-name))))
               (defun counsel-switch-to-projectile-buffer (arg)
                 "Forward to `projectile-switch-to-buffer'."
                 (interactive "P")