From cf097a882af4b7b3510c68c70858dd88a8a52cff Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 18 Jul 2015 11:36:56 +0200 Subject: Dedent Emacs configuration --- tag-emacs/emacs.d/init.org | 266 ++++++++++++++++++++++----------------------- 1 file changed, 132 insertions(+), 134 deletions(-) (limited to 'tag-emacs/emacs.d/init.org') diff --git a/tag-emacs/emacs.d/init.org b/tag-emacs/emacs.d/init.org index deaa0330..18a6f97e 100644 --- a/tag-emacs/emacs.d/init.org +++ b/tag-emacs/emacs.d/init.org @@ -4,17 +4,15 @@ #+PROPERTY: header-args :tangle yes :comments link * Introduction This is a living document, detailing my Emacs configuration using org-mode -* Emacs Configuration - -** Basics -*** Startup +* Basics +** Startup Open Emacs with just a plain window. No graphics or messages, please! #+BEGIN_SRC emacs-lisp (setq inhibit-startup-echo-area-message "alan") (setq inhibit-startup-screen t) #+END_SRC -*** Scratch buffers +** Scratch buffers I usually use scratch buffers for any sort of text. If I need a programming mode in one, then I’ll just call it manually. I also like the buffer to be empty. @@ -23,13 +21,13 @@ the buffer to be empty. initial-major-mode 'text-mode) #+END_SRC -*** Personal Information +** Personal Information #+BEGIN_SRC emacs-lisp (setq user-mail-address "alan@alanpearce.co.uk" user-full-name "Alan Pearce") #+end_src -*** Customize +** Customize I don’t really like using customize for normal configuration. Instead, I use it for things that get saved automatically. That’s why I use a different file, which is ignored by the VCS. It also means @@ -42,7 +40,7 @@ pass =:noerror= to =load= #+END_SRC -** Packaging +* Packaging I still use a couple of [[file:elisp/][elisp files]] that don’t appear to be in any package archives. @@ -50,9 +48,9 @@ archives. (add-to-list 'load-path (expand-file-name "elisp/" user-emacs-directory)) #+END_SRC -*** TODO Move [[file:elisp/ap-functions.el][=ap-functions=]] into this file and delete above +** TODO Move [[file:elisp/ap-functions.el][=ap-functions=]] into this file and delete above -*** Cask +** Cask For most packages, I use [[https://github.com/cask/cask][cask]] #+BEGIN_SRC emacs-lisp @@ -61,7 +59,7 @@ For most packages, I use [[https://github.com/cask/cask][cask]] (cask-initialize) #+END_SRC -**** Cask commands +*** Cask commands Installing #+BEGIN_SRC sh :tangle no @@ -83,7 +81,7 @@ Update old packages cask update #+END_SRC -*** Req-package +** Req-package #+BEGIN_SRC emacs-lisp (setq package-archives '(("gnu" . "http://elpa.gnu.org/packages/") @@ -99,7 +97,7 @@ cask update (setq use-package-verbose t) #+END_SRC -*** Pallet +** Pallet I use [[https://github.com/rdallasgray/pallet][pallet]] to keep my [[file:Cask][Caskfile]] up-to-date with packages installed from inside Emacs. I don’t need it on startup, so I tell @@ -112,7 +110,7 @@ from inside Emacs. I don’t need it on startup, so I tell #+END_SRC -** Helpers +* Helpers I like to rename modeline lighters. This macro works for major modes. #+BEGIN_SRC emacs-lisp (defmacro rename-modeline (mode new-name) @@ -120,7 +118,7 @@ from inside Emacs. I don’t need it on startup, so I tell (setq mode-name ,new-name))) #+END_SRC -** Projects +* Projects #+BEGIN_SRC emacs-lisp (defvar work-project-directory "~/work") @@ -133,7 +131,7 @@ from inside Emacs. I don’t need it on startup, so I tell (projectile-persp-switch-project (expand-file-name "dotfiles" home-project-directory))) #+END_SRC -*** Projectile +** Projectile Projectile is awesome for working in projects, especially VCS-backed ones. I added a couple of functions to allow me to open new projects @@ -181,7 +179,7 @@ based upon some folder conventions I use. projectile-completion-system 'helm))) #+END_SRC -*** projector +** projector Project-based shell buffers sounds like a good idea, but for some reason I haven’t found a use for it. @@ -192,7 +190,7 @@ reason I haven’t found a use for it. :bind (("s-z" . projector-open-project-shell))) #+END_SRC -*** perspective +** perspective This package makes buffer-switching inside of projects make sense, by filtering the candidates to those within the project. For it to work, @@ -208,7 +206,7 @@ it needs hooking into projectile and a key bound to switch between projects. :require (projectile perspective)) #+END_SRC -*** vc +** vc This is nice for some things that magit doesn’t do, and for those rare occasions that I’m working with something other than git. @@ -221,7 +219,7 @@ occasions that I’m working with something other than git. (setq vc-follow-symlinks t))) #+END_SRC -*** diff-hl +** diff-hl It’s nice to be able to see at a glance which lines of a file have changed. This package colours the fringe @@ -233,7 +231,7 @@ changed. This package colours the fringe (add-hook 'magit-refresh-file-buffer-hook #'diff-hl-update))) #+END_SRC -*** magit +** magit Magit is my favourite way to use git. I use selective staging all the time. Make sure to set it up with a nice =completing-read-function= @@ -248,7 +246,7 @@ time. Make sure to set it up with a nice =completing-read-function= :init (add-hook 'magit-mode-hook #'magit-load-config-extensions)) #+END_SRC -** Styles +* Styles I prefer an always-visible cursor. Feels less distracting. #+BEGIN_SRC emacs-lisp @@ -286,7 +284,7 @@ locking for it. (dash--enable-fontlock 'dash-enable-font-lock t))) #+END_SRC -*** Colours +** Colours I quite like solarized. I don’t think it’s perfect, but it supports a lot of modes. @@ -315,7 +313,7 @@ Highlighting quasi-quoted expressions in lisps is quite useful. (add-hook 'lisp-mode-common-hook #'highlight-stages-mode))) #+END_SRC -*** Fonts +** 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]]. @@ -354,9 +352,9 @@ these settings are particularly useful jit-lock-defer-time 0.01) #+END_SRC -** Files +* Files -*** Auto-saving +** Auto-saving Auto-save everything to a temporary directory, instead of cluttering the filesystem. I don’t want emacs-specific lockfiles, either. @@ -365,7 +363,7 @@ the filesystem. I don’t want emacs-specific lockfiles, either. (setq auto-save-file-name-transforms `((".*" ,temporary-file-directory t)) create-lockfiles nil) #+END_SRC -*** Backups +** Backups I like to keep my backups out of regular folders. I tell emacs to use a subfolder of its configuration directory for that. Also, use the @@ -381,7 +379,7 @@ trash for deleting on OS X. (setq delete-by-moving-to-trash t)) #+END_SRC -*** autorevert +** autorevert #+BEGIN_SRC emacs-lisp (req-package autorevert @@ -390,7 +388,7 @@ trash for deleting on OS X. (setq auto-revert-verbose nil))) #+END_SRC -*** Encoding +** Encoding #+BEGIN_SRC emacs-lisp (prefer-coding-system 'utf-8-auto-unix) @@ -398,7 +396,7 @@ trash for deleting on OS X. (setq-default buffer-file-coding-system 'utf-8-auto-unix) #+END_SRC -*** Buffer-file management +** Buffer-file management Ask if I want to create a directory when it doesn’t exist. This is especially nice when starting new projects. @@ -459,7 +457,7 @@ with a buffer. (kill-buffer buf))))) #+END_SRC -*** Whitespace Butler +** Whitespace Butler I don’t like it when editors change an entire file’s layout when I open it. Whitespace butler fixes whitespace only for lines that I’m editing. @@ -472,7 +470,7 @@ open it. Whitespace butler fixes whitespace only for lines that I’m editing. (add-hook #'before-make-frame-hook (lambda () (ws-butler-global-mode 1)))) #+END_SRC -*** fasd +** fasd Fasd is a nice shell plugin that remembers file and folder arguments, making it easy to re-visit them later. This package hooks into that. @@ -485,7 +483,7 @@ I don’t seem to use it much though. (global-fasd-mode 1))) #+END_SRC -*** recentf +** recentf I only use this occasionally, but it’s nice for files outside of projects. @@ -496,7 +494,7 @@ I only use this occasionally, but it’s nice for files outside of projects. (recentf-mode 1))) #+END_SRC -*** saveplace +** saveplace It.. saves the position I visited a file at last. Might try turning it off to see if I notice it. @@ -507,7 +505,7 @@ it off to see if I notice it. (setq save-place-file (expand-file-name ".saveplace" user-emacs-directory)))) #+END_SRC -*** Tramp +** Tramp Tramp is awesome. It makes SSH feel Unix-y. The proxy setup is so that I can sudo on remote machines @@ -538,7 +536,7 @@ that I can sudo on remote machines (add-to-list 'tramp-remote-path "~/bin"))) #+END_SRC -*** ediff +** ediff I like a horizonal diff setup, with everything in one frame. @@ -550,7 +548,7 @@ I like a horizonal diff setup, with everything in one frame. ediff-window-setup-function 'ediff-setup-windows-plain))) #+END_SRC -** Indentation +* Indentation Ah, a complicated topic. One day we’ll all be using elastic tabstops. Until then, I want 4-wide tabs, and make them real tabs! @@ -565,7 +563,7 @@ tabstops. Until then, I want 4-wide tabs, and make them real tabs! '(4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 68 72 76 80 84 88 92 96 100 104 108 112 116 120)) #+END_SRC -*** auto-indent-mode +** auto-indent-mode Don’t make me think, just indent it! Unless it’s a whitespace-sensitive language, of course. @@ -590,9 +588,9 @@ whitespace-sensitive language, of course. (auto-indent-global-mode))) #+END_SRC -**** TODO Check for auto-indentation of whitespace-sensitive languages. +*** TODO Check for auto-indentation of whitespace-sensitive languages. -*** smart-tabs-mode +** smart-tabs-mode Not related to [[smart-tab][=smart-tab=]], this mode indents with tabs and aligns with spaces. Perfect! @@ -608,9 +606,9 @@ with spaces. Perfect! (smart-tabs-insinuate 'c 'javascript 'cperl 'python))) #+END_SRC -** Security +* Security -*** password-store +** password-store This is a frontend to the GPG-powered =pass= program. #+BEGIN_SRC emacs-lisp @@ -618,9 +616,9 @@ This is a frontend to the GPG-powered =pass= program. :config (progn (setq password-store-password-length 16))) #+END_SRC -** Buffers +* Buffers -*** Ibuffer +** Ibuffer Ibuffer is quite nice for listing all buffers. I don’t use it very often though, as it doesn’t really work with perspectives. @@ -657,7 +655,7 @@ often though, as it doesn’t really work with perspectives. filename-and-process))))) #+END_SRC -*** Uniqify +** Uniqify Sometimes projects have files with the same name. This gives them unique names, by adding enough path elements to make them unambiguous. @@ -671,7 +669,7 @@ unique names, by adding enough path elements to make them unambiguous. uniquify-ignore-buffers-re "^\\*"))) #+END_SRC -*** Narrowing +** Narrowing Enable it without prompting @@ -681,7 +679,7 @@ Enable it without prompting (put 'narrow-to-region 'disabled nil) #+END_SRC -*** Fancy Narrow +** Fancy Narrow Sometimes I like to be able to focus on one block of code at a time. Normally narrowing hides everything else completely, which I don’t @@ -692,14 +690,14 @@ like. This package just makes everything else lower-contrast. :config (fancy-narrow-mode 1)) #+END_SRC -*** ace-jump-buffer +** ace-jump-buffer #+BEGIN_SRC emacs-lisp (use-package ace-jump-buffer :bind ("s-b" . ace-jump-buffer)) #+END_SRC -*** ace-window +** ace-window I don’t often have many windows open at once, but when I do, =ace-window= is really nice to jump around them in the same way that @@ -722,7 +720,7 @@ I don’t often have many windows open at once, but when I do, aw-keys '(?a ?r ?s ?t ?n ?e ?i ?o)))) #+END_SRC -** Windows +* Windows Scrolling is tricky. I use this setup to help me keep track of the point whilst I’m moving about. @@ -753,7 +751,7 @@ A dedicated window always keeps the same buffer in view. "normal"))) #+END_SRC -*** popwin +** popwin This works really nicely wiht helm. I should think about whether it might be useful elsewhere @@ -767,7 +765,7 @@ might be useful elsewhere (add-to-list 'popwin:special-display-config '("^*helm.+*$" :regexp t :height 20)))) #+END_SRC -*** winner +** winner Undo, for window-based commands. @@ -778,7 +776,7 @@ Undo, for window-based commands. (setq winner-boring-buffers '("*Completions*" "*Help*" "*Apropos*" "*Buffer List*" "*info*" "*Compile-Log*")))) #+END_SRC -*** windmove +** windmove Directional window movement @@ -789,7 +787,7 @@ Directional window movement ("S-" . windmove-up) ("S-" . windmove-down))) #+END_SRC -** Completion +* Completion Make built-in completion a bit more intelligent, by adding substring and initial-based completion and ignoring case. @@ -841,9 +839,9 @@ seems to work perfectly well for me. company-dabbrev-downcase nil))) #+END_SRC -** Dates & Times +* Dates & Times -*** Calendar +** Calendar Weeks start on Monday for me and I prefer ISO-style dates. #+BEGIN_SRC emacs-lisp @@ -875,7 +873,7 @@ Sometimes I want to insert a date or time into a buffer. (insert (format-time-string format)))) #+END_SRC -** Directories +* Directories Dired works quite nicely, but not always in the way I want. I don’t like having so many prompts for recursive operations. Also, when I @@ -956,9 +954,9 @@ Expand subfolders like a tree inside the parent (bind-key "i" #'dired-subtree-toggle dired-mode-map))) #+END_SRC -** Documentation +* Documentation -*** helm-dash +** helm-dash Emacs’ documentation is great to read from inside Emacs. Helm-dash helps to make documentation for other languages easier to access @@ -990,7 +988,7 @@ helps to make documentation for other languages easier to access (ap/create-helm-dash-hook sql ("PostgreSQL" "MySQL")))) #+END_SRC -*** which-func +** which-func Use the modeline to show which function definition the point is in. @@ -1000,7 +998,7 @@ Use the modeline to show which function definition the point is in. :config (setq which-func-modes t)) #+END_SRC -*** discover-my-major +** discover-my-major A nicer way to browse keybindings for major modes. @@ -1009,7 +1007,7 @@ A nicer way to browse keybindings for major modes. :bind ("C-h C-m" . discover-my-major)) #+END_SRC -*** discover +** discover Makes some context menus for dired and other things, similarly to the way magit’s popups work. @@ -1019,7 +1017,7 @@ way magit’s popups work. :config (global-discover-mode)) #+END_SRC -*** eldoc +** eldoc Documentation in the echo-area (where the minibuffer is displayed) is rather useful. @@ -1032,7 +1030,7 @@ rather useful. (setq eldoc-idle-delay 0.1) (eldoc-add-command 'paredit-backward-delete 'paredit-close-round))) #+END_SRC -** Keybindings +* Keybindings I think =set-keyboard-coding-system= stops OS X from doing something annoying to add accents. The modifier setup is to match my @@ -1082,7 +1080,7 @@ Option/alt, then Control. (bind-key "s-," #'switch-to-dotfiles) (set-register ?z `(file . ,(expand-file-name ".config/zsh/zshrc" "~"))) #+END_SRC -** Misc +* Misc #+BEGIN_SRC emacs-lisp (defvar *init-file* @@ -1146,7 +1144,7 @@ org’s navigation commands. (add-hook 'emacs-lisp-mode-hook 'imenu-elisp-sections) #+END_SRC -** Minibuffer +* Minibuffer Sometimes I want to use the minibuffer, but I’m already inside it. Fortunately, this is possible. Of course, I need to know how many @@ -1170,7 +1168,7 @@ Occasionally, I exit emacs. I should probably reduce the frequency of this. (defalias 'exit-emacs #'save-buffers-kill-emacs)) #+END_SRC -*** helm +** helm I like to use =helm= for some completions, especially when there are lots of candidates. @@ -1195,7 +1193,7 @@ lots of candidates. (define-key helm-read-file-map (kbd "C-z") #'helm-select-action))) #+END_SRC -*** ido +** ido I really like ido. It’s part of emacs, it does flex matching nicely and it’s pretty configurable. @@ -1224,9 +1222,9 @@ and it’s pretty configurable. (bind-key "C-c C-s" #'ido-manual-merge ido-file-dir-completion-map))) #+END_SRC -**** TODO Figure out whether the merge stuff is useful. +*** TODO Figure out whether the merge stuff is useful. -**** ido-completing-read+ +*** ido-completing-read+ This is mostly a dependency of =magit=. #+BEGIN_SRC emacs-lisp @@ -1237,10 +1235,10 @@ This is mostly a dependency of =magit=. ido-cr+-max-items 2000))) #+END_SRC -***** TODO See if I can use ido-completing-read+ in ido places +**** TODO See if I can use ido-completing-read+ in ido places This would be good for finding files in projects. -***** Buffer switching within projects +**** Buffer switching within projects #+BEGIN_SRC emacs-lisp (defun ap/ido-projectile-switch-buffer-dwim (force-ido) @@ -1253,7 +1251,7 @@ This would be good for finding files in projects. (bind-key "s-x s-b" #'ap/ido-projectile-switch-buffer-dwim) #+END_SRC -**** ido-vertical-mode +*** ido-vertical-mode I find ido’s default horizonal presentation of completion candidates to be a little difficult to follow. Of course, there’s always a @@ -1280,7 +1278,7 @@ package for that. :config (ido-vertical-mode 1)) #+END_SRC -**** flx-ido +*** flx-ido I think ido’s flex matching could be a bit better, so I use =flx-ido= for that. It can be slow on large collectinos, but fortunately it can @@ -1294,7 +1292,7 @@ disable itself at that point (setq flx-ido-threshold 1000))) #+END_SRC -*** smex +** smex Smex is my favourite way to use =M-x=. I might try setting up =helm= again, to see whether it’s any better or not. @@ -1321,7 +1319,7 @@ again, to see whether it’s any better or not. (smex-initialize))) #+END_SRC -** Modeline +* Modeline I modified the mode-line format to show me less information. Instead, I put some of it in the frame-line at the top. @@ -1424,7 +1422,7 @@ I put some of it in the frame-line at the top. "%b")))) #+END_SRC -*** Modes +* Modes Setup some modes for systemd files #+BEGIN_SRC emacs-lisp @@ -1495,7 +1493,7 @@ configuration files. (add-to-list 'auto-mode-alist '("\\.sls\\'" . saltstack-mode)) #+END_SRC -**** ledger +** ledger I use [[http://ledger-cli.org/][=ledger=]] to manage my finances. It has an Emacs mode, which works really nicely. @@ -1516,7 +1514,7 @@ works really nicely. ledger-default-date-format "%Y-%m-%d"))) #+END_SRC -**** Markdown +** Markdown #+BEGIN_SRC emacs-lisp (req-package markdown-mode @@ -1525,11 +1523,11 @@ works really nicely. (add-hook 'markdown-mode-hook #'turn-on-auto-fill))) #+END_SRC -*** Org +** Org Org is wünderbar. -**** TODO Check whether all this configuration is necessary or helpful. +*** TODO Check whether all this configuration is necessary or helpful. #+BEGIN_SRC emacs-lisp (req-package org @@ -1584,7 +1582,7 @@ Org is wünderbar. (org-todo "STARTED"))))))) #+END_SRC -***** org-babel +**** org-babel Org’s babel feature is really nice. I use it for this file, and I can use it to communicate between programming languages. Sometime I hope @@ -1601,7 +1599,7 @@ with R or something. (sh . t)))) #+END_SRC -***** org-journal +**** org-journal I can use this to keep a journal. I should use it. @@ -1613,9 +1611,9 @@ I can use this to keep a journal. I should use it. (setq org-journal-date-format "%A, %d %B %Y"))) #+END_SRC -***** org-mobile +**** org-mobile -****** TODO Setup org-mobile +***** TODO Setup org-mobile #+BEGIN_SRC emacs-lisp (req-package org-mobile :require org @@ -1624,10 +1622,10 @@ I can use this to keep a journal. I should use it. (setq org-mobile-directory "~/Mobile/Org"))) #+END_SRC -** Programming -*** cedet +* Programming +** cedet -**** TODO Setup cedet and see whether it’s useful +*** TODO Setup cedet and see whether it’s useful #+BEGIN_SRC emacs-lisp (req-package cedet @@ -1640,7 +1638,7 @@ I can use this to keep a journal. I should use it. (global-semantic-decoration-mode t))) #+END_SRC -*** flycheck +** flycheck On-the-fly error checking in programming modes? Yes please. @@ -1650,7 +1648,7 @@ On-the-fly error checking in programming modes? Yes please. :init (global-flycheck-mode)) #+END_SRC -*** golang +** golang Go has a few packages to inter-operate with other emacs packages. @@ -1683,7 +1681,7 @@ Go has a few packages to inter-operate with other emacs packages. #+END_SRC -*** ggtags +** ggtags A nice completion backend for programming modes. @@ -1699,9 +1697,9 @@ A nice completion backend for programming modes. (add-hook 'c-mode-common-hook #'turn-on-ggtags-mode))) #+END_SRC -*** Lisps +** Lisps -**** All +*** All Lisp modes don’t seem to have a common ancestor. So I made a custom hook which I trigger in every lispy-mode. Of course, no tabs in @@ -1718,7 +1716,7 @@ lisps. Even I understand that. (setq indent-tabs-mode nil)) #+END_SRC -***** Redshank +**** Redshank Lisp syntax allows for really easy refactoring. Redshank gives some operations that aren’t part of paredit, like extracting variables into @@ -1731,7 +1729,7 @@ let bindings. (add-hook 'lisp-mode-common-hook #'turn-on-redshank-mode))) #+END_SRC -**** Emacs Lisp +*** Emacs Lisp Customise the modeline-display of =emacs-lisp-mode=. Then make sure it runs the common lisp hooks. @@ -1781,7 +1779,7 @@ don’t have to worry about a selection. (bind-key "C-c e" #'eval-and-replace) #+END_SRC -**** Scheme & Lisp +*** Scheme & Lisp I don’t work with these as often as I would like @@ -1794,7 +1792,7 @@ I don’t work with these as often as I would like (add-hook 'lisp-mode-hook #'set-common-lisp-indentation) #+END_SRC -***** geiser +**** geiser A REPL thing for Scheme. Hopefully I’ll get to use it more in the future. @@ -1807,7 +1805,7 @@ future. run-racket)) #+END_SRC -***** slime +**** slime A REPL thing (and more) for Lisp. @@ -1822,7 +1820,7 @@ A REPL thing (and more) for Lisp. (setq inferior-lisp-program (executable-find "sbcl")))) #+END_SRC -**** Clojure +*** Clojure #+BEGIN_SRC emacs-lisp (req-package clojure-mode @@ -1842,7 +1840,7 @@ A REPL thing (and more) for Lisp. (add-hook 'clojure-mode-hook #'turn-on-clj-refactor-mode))) #+END_SRC -***** cider +**** cider A REPL thing for Clojure @@ -1856,7 +1854,7 @@ A REPL thing for Clojure (add-hook 'cider-mode-hook #'cider-turn-on-eldoc-mode))) #+END_SRC -*** Auto-compile +** Auto-compile Auto-compile emacs lisp when saving. #+BEGIN_SRC emacs-lisp @@ -1865,7 +1863,7 @@ Auto-compile emacs lisp when saving. :init (add-hook 'emacs-lisp-mode-hook #'auto-compile-on-save-mode)) #+END_SRC -*** cc-mode +** cc-mode Although I don’t use C or C++, setting up the mode is helpful because quite a few other modes are derived from it. @@ -1883,7 +1881,7 @@ quite a few other modes are derived from it. (c-set-offset 'case-label '+))) #+END_SRC -*** quickrun +** quickrun It’s nice to be able to quickly evaluate some code. Although I don’t really seem to use it. @@ -1892,9 +1890,9 @@ really seem to use it. :bind (("C-c C-e" . quickrun))) #+END_SRC -*** Web development +** Web development -**** skewer-mode +*** skewer-mode I don’t use this as often as I probably should. I should figure out why that is. @@ -1907,7 +1905,7 @@ why that is. (add-hook 'css-mode-hook #'skewer-css-mode))) #+END_SRC -**** js2-mode +*** js2-mode This mode is really great for editing Javascript. It turns code into an AST internally, so it can work with it almost like a lisp. I don’t @@ -1933,7 +1931,7 @@ it though (add-to-list 'auto-mode-alist '("composer\\.lock" . js-mode)) #+END_SRC -**** tern +*** tern Tern understands javascript. It adds really clever documented completions, besides other IDE-like things. @@ -1951,14 +1949,14 @@ completions, besides other IDE-like things. :require (tern company)) #+END_SRC -**** json-mode +*** json-mode #+BEGIN_SRC emacs-lisp (req-package json-mode :mode ("\\.json\\'" . json-mode)) #+END_SRC -**** restclient +*** restclient Restclient is really nice. It’s like a scratchpad for HTTP api calls. Feels a bit like using =org-babel=. I wonder if there’s an @@ -1975,7 +1973,7 @@ integration between the two yet. (add-hook restclient-mode-hook #'imenu-restclient-sections))) #+END_SRC -**** sgml-mode +*** sgml-mode This is for HTML, since old versions of HTML were derived from SGML. #+BEGIN_SRC emacs-lisp @@ -1984,7 +1982,7 @@ This is for HTML, since old versions of HTML were derived from SGML. :config (setq sgml-basic-offset 4)) #+END_SRC -**** emmet-mode +*** emmet-mode Emmet is really nice to write HTML quickly. Especially with frameworks that require multiple nested elements to do anything useful. @@ -1997,7 +1995,7 @@ frameworks that require multiple nested elements to do anything useful. (add-hook 'web-mode-hook #'emmet-mode)))) #+END_SRC -**** web-mode +*** web-mode This mode handles just about every templating language out ther, which is really nice, because it handles the HTML part the same way in all @@ -2025,7 +2023,7 @@ I derived a mode for twig, in order to use its =mode-hook=. (add-to-list 'auto-mode-alist '("\\.html\\.twig\\'" . twig-mode)) #+END_SRC -**** mmm-mode +*** mmm-mode With =web-mode= being so good, I don’t really use this much. It’s good for embedded SQL though. @@ -2062,8 +2060,8 @@ good for embedded SQL though. :init (setq mmm-global-mode 'maybe)) #+END_SRC -***** TODO Setup for javascript + SQL -** Spelling +**** TODO Setup for javascript + SQL +* Spelling #+BEGIN_SRC emacs-lisp (req-package ispell @@ -2073,9 +2071,9 @@ good for embedded SQL though. ispell-dictionary "british"))) #+END_SRC -**** TODO Set up some functions to switch between en-GB and de-DE +*** TODO Set up some functions to switch between en-GB and de-DE -** Scripting +* Scripting Make a shell-script buffer executable after saving it, if it has a shebang. @@ -2088,7 +2086,7 @@ Make a shell-script buffer executable after saving it, if it has a shebang. :config (setq sh-shell-file "/usr/bin/env zsh")) #+END_SRC -*** eshell +** eshell I should try to get into the habit of using this more. It’s really nice, when I remember to use it. @@ -2116,7 +2114,7 @@ nice, when I remember to use it. (bind-key "C-c S" #'eshell-goto-current-dir) #+END_SRC -**** Shells +*** Shells #+BEGIN_SRC emacs-lisp (req-package shell @@ -2139,9 +2137,9 @@ nice, when I remember to use it. (comint-delchar-or-maybe-eof arg))) #+END_SRC -**** TODO Do I need multi-term? +*** TODO Do I need multi-term? -** Text editing +* Text editing Emacs has an editor within. @@ -2152,7 +2150,7 @@ Emacs has an editor within. line-move-visual nil) #+END_SRC -*** align +** align =Align= is a useful command to line things up, once given some rules. The most important one for me is JSON property alignment. @@ -2166,7 +2164,7 @@ The most important one for me is JSON property alignment. (modes . '(js2-mode)))))) #+END_SRC -*** Clipboard +** Clipboard I like to use the clipboard more than the primary selection in X11. @@ -2178,7 +2176,7 @@ I like to use the clipboard more than the primary selection in X11. (setq x-select-request-type '(UTF8_STRING COMPOUND_TEXT TEXT STRING))) #+END_SRC -*** Selection +** Selection I’m quite used to deleting text by selecting it and typing. Emacs has a mode for that. @@ -2231,7 +2229,7 @@ from Sublime Text. As always, there’s a mode for that. :bind ("C-M-SPC" . er/expand-region)) #+END_SRC -*** Typography +** Typography I like using typographic symbols, but I don’t always remember (how) to type them. @@ -2310,7 +2308,7 @@ type them. (add-hook 'text-mode-hook #'typopunct-mode))) #+END_SRC -*** avy +** avy Avy is a really nice way to move around files, like ace-jump-mode, but somehow I prefer it. @@ -2326,7 +2324,7 @@ somehow I prefer it. (setq avy-all-windows nil))) #+END_SRC -*** goto-chg +** goto-chg This is like popping the mark, only it filters to only change areas and doesn’t go back to the same place more than once. @@ -2336,7 +2334,7 @@ and doesn’t go back to the same place more than once. :bind ("C-x SPC" . goto-last-change)) #+END_SRC -*** helm-swoop +** helm-swoop This fits somewhere between isearch and grep. For me, I didn’t realise how useful it was until I actually tried it. @@ -2350,7 +2348,7 @@ realise how useful it was until I actually tried it. (bind-key "C-=" #'helm-multi-swoop-all-from-helm-swoop))) #+END_SRC -*** multiple-cursors +** multiple-cursors I mentioned before that I’d used Sublime Text before. Multiple cursors was one of my favourite features, so I was really happy when I @@ -2367,7 +2365,7 @@ saw that multiple-cursors was released for Emacs. (bind-key "C-S-L" #'mc/edit-lines))) #+END_SRC -*** paredit +** paredit Balanced parentheses in lisps are nice, but all the refactoring and movement commands are much more interesting. @@ -2387,7 +2385,7 @@ movement commands are much more interesting. (paredit-mode 1))))) #+END_SRC -*** smartparens +** smartparens I like to use smartparens where paredit isn’t already useful. Somehow I didn’t find smartparens’ implementation of paredit style to be as @@ -2419,7 +2417,7 @@ nice as the real version (add-hook 'lisp-mode-common-hook #'turn-off-smartparens-mode))) #+END_SRC -*** move-text +** move-text Transposing lines, made easier. @@ -2428,7 +2426,7 @@ Transposing lines, made easier. :config (move-text-default-bindings)) #+END_SRC -*** undo-tree +** undo-tree Emacs’ default handling of undo is a bit confusing. Undo-tree makes it much clearer. It’s especially helpful for protoyping and refactoring. @@ -2451,7 +2449,7 @@ it much clearer. It’s especially helpful for protoyping and refactoring. :diminish undo-tree-mode) #+END_SRC -*** visual-regexp +** visual-regexp I don’t always remember exactly how Emacs’ regular expressions work, so this package is pretty useful because it highlights everything in -- cgit 1.4.1