summary refs log tree commit diff stats
path: root/tag-emacs
diff options
context:
space:
mode:
Diffstat (limited to 'tag-emacs')
-rw-r--r--tag-emacs/emacs.d/init.org292
1 files changed, 137 insertions, 155 deletions
diff --git a/tag-emacs/emacs.d/init.org b/tag-emacs/emacs.d/init.org
index 6d9733c4..10081200 100644
--- a/tag-emacs/emacs.d/init.org
+++ b/tag-emacs/emacs.d/init.org
@@ -64,6 +64,126 @@ pass =:noerror= to =load=
   (load custom-file :noerror :nomessage)
 #+END_SRC
 
+* Styles
+
+I prefer an always-visible cursor.  Feels less distracting.
+#+BEGIN_SRC emacs-lisp
+(when (fboundp #'blink-cursor-mode)
+  (blink-cursor-mode -1))
+#+END_SRC
+
+Disable all the bars, unless on OSX, in which case, keep the menu bar.
+
+#+BEGIN_SRC emacs-lisp
+  (when (and menu-bar-mode (not (eq window-system 'ns)))
+    (menu-bar-mode -1))
+  (with-eval-after-load 'scroll-bar
+    (set-scroll-bar-mode nil))
+  (with-eval-after-load 'tooltip
+    (tooltip-mode -1))
+  (with-eval-after-load 'tool-bar
+    (tool-bar-mode -1))
+#+END_SRC
+
+Ring the bell sometimes, but not so often
+#+BEGIN_SRC emacs-lisp
+(setq ring-bell-function
+      (lambda ()
+        (unless (memq this-command
+                      '(isearch-abort abort-recursive-edit exit-minibuffer keyboard-quit undo-tree-undo))
+          (ding))))
+#+END_SRC
+
+When I’m using dash in emacs lisp, it’s nice to have proper font
+locking for it.
+#+BEGIN_SRC emacs-lisp
+  (use-package dash
+    :commands (dash-enable-font-lock)
+    :init (progn
+            (add-hook 'emacs-lisp-mode-hook #'dash-enable-font-lock)))
+#+END_SRC
+
+** Colours
+
+I quite like solarized.  I don’t think it’s perfect, but it supports a
+lot of modes.
+#+BEGIN_SRC emacs-lisp
+  (use-package solarized-theme
+    :config (progn
+              (setq solarized-distinct-fringe-background t)
+              (setq solarized-high-contrast-mode-line t)
+              (load-theme 'solarized-light t)))
+#+END_SRC
+
+Colourise colour names in certain types of buffer.  I don’t use this
+in modes for webdev because [[web-mode]] includes that functionality.
+#+BEGIN_SRC emacs-lisp
+(use-package rainbow-mode
+  :commands (rainbow-turn-on
+             rainbow-turn-off)
+  :config (progn
+            (add-hook 'xmonad-mode-hook #'rainbow-turn-on)))
+#+END_SRC
+
+Highlighting quasi-quoted expressions in lisps is quite useful.
+#+BEGIN_SRC emacs-lisp
+(use-package highlight-stages
+  :defer t
+  :diminish highlight-stages-mode
+  :init (progn
+          (add-hook 'lisp-mode-common-hook #'highlight-stages-mode)))
+#+END_SRC
+
+** Fonts
+
+When possible, set up fonts.  I don’t have any settings here for X11,
+because I manage those in my [[file:~/projects/dotfiles/tag-xresources/xresources/main][XResources file]].
+#+BEGIN_SRC emacs-lisp
+  (when (or (display-graphic-p)
+            (daemonp))
+
+    (defun use-variable-fonts ()
+      (interactive)
+      (variable-pitch-mode)
+      (setq cursor-type 'bar))
+
+    (defun ap/set-fonts (mono-face mono-font-size variable-face variable-font-size)
+      (when mono-face
+        (let ((default-font (concat mono-face "-" (number-to-string mono-font-size))))
+          (add-to-list 'default-frame-alist `(font . ,default-font))
+          (set-face-font 'fixed-pitch default-font)
+          (set-frame-font default-font t t)))
+      (when variable-face
+        (set-face-font 'variable-pitch (concat variable-face "-"
+                                               (number-to-string variable-font-size)))))
+
+    (cond
+     ((eq window-system 'w32)
+      (ap/set-fonts "Consolas" 10 "Segoe UI" 11))
+     ((eq system-type 'darwin)
+      (ap/set-fonts "Hack" 14 "Avenir" 14))))
+#+END_SRC
+
+Allow font-lock-mode to do background parsing.  I’m not really sure if
+these settings are particularly useful
+#+BEGIN_SRC emacs-lisp
+  (setq jit-lock-stealth-time nil
+        jit-lock-stealth-load 100
+        jit-lock-chunk-size 300
+        jit-lock-defer-time nil
+        font-lock-maximum-decoration '((dired-mode . 1)
+                                       (t . t)))
+#+END_SRC
+
+** Page Breaks
+
+By default, Emacs displays page breaks as ^L.  Lines look much nicer.
+
+#+BEGIN_SRC emacs-lisp
+  (use-package page-break-lines
+    :defer 5
+    :config (global-page-break-lines-mode))
+#+END_SRC
 * Projects
 
    #+BEGIN_SRC emacs-lisp
@@ -206,127 +326,6 @@ a particular way, but it changed later.
     :commands git-timemachine)
 #+END_SRC
 
-* Styles
-
-I prefer an always-visible cursor.  Feels less distracting.
-#+BEGIN_SRC emacs-lisp
-(when (fboundp #'blink-cursor-mode)
-  (blink-cursor-mode -1))
-#+END_SRC
-
-Disable all the bars, unless on OSX, in which case, keep the menu bar.
-
-#+BEGIN_SRC emacs-lisp
-  (when (and menu-bar-mode (not (eq window-system 'ns)))
-    (menu-bar-mode -1))
-  (with-eval-after-load 'scroll-bar
-    (set-scroll-bar-mode nil))
-  (with-eval-after-load 'tooltip
-    (tooltip-mode -1))
-  (with-eval-after-load 'tool-bar
-    (tool-bar-mode -1))
-#+END_SRC
-
-Ring the bell sometimes, but not so often
-#+BEGIN_SRC emacs-lisp
-(setq ring-bell-function
-      (lambda ()
-        (unless (memq this-command
-                      '(isearch-abort abort-recursive-edit exit-minibuffer keyboard-quit undo-tree-undo))
-          (ding))))
-#+END_SRC
-
-When I’m using dash in emacs lisp, it’s nice to have proper font
-locking for it.
-#+BEGIN_SRC emacs-lisp
-  (use-package dash
-    :commands (dash-enable-font-lock)
-    :init (progn
-            (add-hook 'emacs-lisp-mode-hook #'dash-enable-font-lock)))
-#+END_SRC
-
-** Colours
-
-I quite like solarized.  I don’t think it’s perfect, but it supports a
-lot of modes.
-#+BEGIN_SRC emacs-lisp
-  (use-package solarized-theme
-    :config (progn
-              (setq solarized-distinct-fringe-background t)
-              (setq solarized-high-contrast-mode-line t)
-              (load-theme 'solarized-light t)))
-#+END_SRC
-
-Colourise colour names in certain types of buffer.  I don’t use this
-in modes for webdev because [[web-mode]] includes that functionality.
-#+BEGIN_SRC emacs-lisp
-(use-package rainbow-mode
-  :commands (rainbow-turn-on
-             rainbow-turn-off)
-  :config (progn
-            (add-hook 'xmonad-mode-hook #'rainbow-turn-on)))
-#+END_SRC
-
-Highlighting quasi-quoted expressions in lisps is quite useful.
-#+BEGIN_SRC emacs-lisp
-(use-package highlight-stages
-  :defer t
-  :diminish highlight-stages-mode
-  :init (progn
-          (add-hook 'lisp-mode-common-hook #'highlight-stages-mode)))
-#+END_SRC
-
-** Fonts
-
-When possible, set up fonts.  I don’t have any settings here for X11,
-because I manage those in my [[file:~/projects/dotfiles/tag-xresources/xresources/main][XResources file]].
-#+BEGIN_SRC emacs-lisp
-  (when (or (display-graphic-p)
-            (daemonp))
-
-    (defun use-variable-fonts ()
-      (interactive)
-      (variable-pitch-mode)
-      (setq cursor-type 'bar))
-
-    (defun ap/set-fonts (mono-face mono-font-size variable-face variable-font-size)
-      (when mono-face
-        (let ((default-font (concat mono-face "-" (number-to-string mono-font-size))))
-          (add-to-list 'default-frame-alist `(font . ,default-font))
-          (set-face-font 'fixed-pitch default-font)
-          (set-frame-font default-font t t)))
-      (when variable-face
-        (set-face-font 'variable-pitch (concat variable-face "-"
-                                               (number-to-string variable-font-size)))))
-
-    (cond
-     ((eq window-system 'w32)
-      (ap/set-fonts "Consolas" 10 "Segoe UI" 11))
-     ((eq system-type 'darwin)
-      (ap/set-fonts "Hack" 14 "Avenir" 14))))
-#+END_SRC
-
-Allow font-lock-mode to do background parsing.  I’m not really sure if
-these settings are particularly useful
-#+BEGIN_SRC emacs-lisp
-  (setq jit-lock-stealth-time nil
-        jit-lock-stealth-load 100
-        jit-lock-chunk-size 300
-        jit-lock-defer-time nil
-        font-lock-maximum-decoration '((dired-mode . 1)
-                                       (t . t)))
-#+END_SRC
-
-** Page Breaks
-
-By default, Emacs displays page breaks as ^L.  Lines look much nicer.
-
-#+BEGIN_SRC emacs-lisp
-  (use-package page-break-lines
-    :defer 5
-    :config (global-page-break-lines-mode))
-#+END_SRC
-
 * Files
 
 ** Auto-saving
@@ -776,30 +775,12 @@ Directional window movement
 Make built-in completion a bit more intelligent, by adding substring
 and initial-based completion and ignoring case.
 
-** TODO With =tab-always-indent=, do I need smart-tab anymore?
-
 #+BEGIN_SRC emacs-lisp
   (setq completion-styles '(basic initials partial-completion substring)
         completion-ignore-case t
         tab-always-indent 'complete)
 #+END_SRC
 
-*** Smart-tab
-
-Most editors use tab for both completion and indentation.  Smart-tab
-tries to do the right thing depending on the location of the point and
-the line’s current indentation.
-
-#+BEGIN_SRC emacs-lisp
-(use-package smart-tab
-  :commands (global-smart-tab-mode)
-  :init (global-smart-tab-mode)
-  :diminish smart-tab-mode
-  :config (progn
-            (nconc smart-tab-completion-functions-alist '((php-mode . php-complete-function)))
-            (diminish 'smart-tab-mode "")))
-#+END_SRC
-
 *** Company
 
 The main choices for automatic completion in Emacs are company and
@@ -807,20 +788,21 @@ auto-complete-mode.  I’ve not tried auto-complete-mode as company
 seems to work perfectly well for me.
 
 #+BEGIN_SRC emacs-lisp
-(use-package company
-  :commands (company-mode)
-  :diminish "Cmpl"
-  :bind (("C-<tab>" . company-complete))
-  :init (progn
-          (add-hook 'prog-mode-hook #'company-mode)
-          (setq company-backends '(company-tern (company-elisp company-bbdb company-nxml company-css company-eclim company-semantic company-clang company-xcode company-cmake company-capf company-gtags company-dabbrev-code company-etags company-keywords)
-                                                company-oddmuse company-files company-dabbrev)
-                company-idle-delay .3
-                company-begin-commands '(self-insert-command)
-                company-auto-complete #'company-explicit-action-p
-                company-auto-complete-chars '(?\ ?\( ?\) ?.)
-                company-tooltip-align-annotations t
-                company-dabbrev-downcase nil)))
+  (use-package company
+    :commands (company-mode)
+    :diminish "Cmpl"
+    :bind (("C-<tab>" . company-complete)
+           ("TAB" . company-indent-or-complete-common))
+    :init (progn
+            (add-hook 'prog-mode-hook #'company-mode)
+            (setq company-backends '(company-tern (company-elisp company-bbdb company-nxml company-css company-eclim company-semantic company-clang company-xcode company-cmake company-capf company-gtags company-dabbrev-code company-etags company-keywords)
+                                                  company-oddmuse company-files company-dabbrev)
+                  company-idle-delay .3
+                  company-begin-commands '(self-insert-command)
+                  company-auto-complete #'company-explicit-action-p
+                  company-auto-complete-chars '(?\ ?\( ?\) ?.)
+                  company-tooltip-align-annotations t
+                  company-dabbrev-downcase nil)))
 #+END_SRC
 
 * Dates & Times
@@ -1096,6 +1078,7 @@ Option/alt, then Control.
 
   (bind-key* "s-x" (define-prefix-command 'super-x-map))
   (bind-key* "s-," #'switch-to-dotfiles)
+  (bind-key* "C-M-x" #'execute-extended-command)
   (set-register ?z `(file . ,(expand-file-name ".config/zsh/zshrc" "~")))
 #+END_SRC
 * Misc
@@ -2437,8 +2420,7 @@ Start a server if possible.  A daemon is already a server.
   (run-with-idle-timer 2 nil (lambda ()
                                (unless (daemonp)
                                  (require 'server)
-                                 (if (server-running-p server-name)
-                                     (message "Server already appears to be running")
+                                 (unless (server-running-p server-name)
                                    (server-start)))))
   (setq gc-cons-threshold 800000
         file-name-handler-alist '(("\\(?:\\.dz\\|\\.txz\\|\\.xz\\|\\.lzma\\|\\.lz\\|\\.g?z\\|\\.\\(?:tgz\\|svgz\\|sifz\\)\\|\\.tbz2?\\|\\.bz2\\|\\.Z\\)\\(?:~\\|\\.~[-[:alnum:]:#@^._]+\\(?:~[[:digit:]]+\\)?~\\)?\\'" . jka-compr-handler)