diff options
-rw-r--r-- | README.org | 2 | ||||
-rw-r--r-- | emacs/.emacs.d/Makefile | 1 | ||||
-rw-r--r-- | emacs/.emacs.d/init.org | 100 | ||||
-rw-r--r-- | zsh/.config/zsh/.zshenv | 5 |
4 files changed, 85 insertions, 23 deletions
diff --git a/README.org b/README.org index 3acd8b2..6c85344 100644 --- a/README.org +++ b/README.org @@ -20,7 +20,7 @@ It should work on: ** Installation -Clone the project anywhere, e.g. with =[[https://github.com/motemen/ghq][ghq]]= +Clone the project anywhere, e.g. with [[https://github.com/motemen/ghq][ghq]] #+BEGIN_SRC sh :exports code ghq get git://git.alanpearce.eu/dotfiles diff --git a/emacs/.emacs.d/Makefile b/emacs/.emacs.d/Makefile index 3d965e4..7741ef3 100644 --- a/emacs/.emacs.d/Makefile +++ b/emacs/.emacs.d/Makefile @@ -1,5 +1,6 @@ define EMACS_TANGLE (progn\ + (package-refresh-contents nil)\ (setq vc-follow-symlinks nil)\ (find-file \"init.org\")\ (require 'ob-tangle)\ diff --git a/emacs/.emacs.d/init.org b/emacs/.emacs.d/init.org index e0b928a..dbe38d6 100644 --- a/emacs/.emacs.d/init.org +++ b/emacs/.emacs.d/init.org @@ -76,8 +76,7 @@ the buffer to be empty. (use-package use-package :commands (use-package-autoload-keymap) :defer 5)) -(setq use-package-verbose t - use-package-always-ensure t +(setq use-package-always-ensure t package-enable-at-startup nil) #+END_SRC @@ -173,7 +172,13 @@ Eziam looks nice, too :defines (eziam-scale-headings) :config (progn (setq eziam-scale-headings nil) - (load-theme 'eziam-light t))) + (load-theme 'eziam-light t) + (custom-theme-set-faces 'user + '(js2-function-call ((t (:underline nil)))) + '(font-lock-keyword-face ((t (:weight normal)))) + '(git-gutter-fr:added ((t (:foreground "#96a4ab")))) + '(git-gutter-fr:modified ((t (:foreground "#96a4ab")))) + '(git-gutter-fr:deleted ((t (:foreground "#96a4ab"))))))) #+END_SRC Highlighting quasi-quoted expressions in lisps is quite useful, but I @@ -223,8 +228,8 @@ because I manage those in my [[file:~/projects/dotfiles/tag-xresources/xresource (ap/set-fonts "Monoid" 12 "Helvetica Neue" 12 t 0.1)))) ((and (eq window-system 'x) (not (getenv "windows"))) - (set-fontset-font "fontset-default" 'unicode (font-spec :name "Terminus" :size 14)) - (ap/set-fonts "Fixed" 14 "Lucida" 14 nil)))) + (set-fontset-font "fontset-default" 'unicode (font-spec :name "Terminus" :size 18)) + (ap/set-fonts "Terminus" 18 "Lucida" 14 nil)))) (ap/set-fonts-according-to-system)) #+END_SRC @@ -289,14 +294,11 @@ Sometimes I like to hide clutter. Other times, it's useful. (defun hide-clutter () (interactive) - (fringe-mode '(4 . 8)) (hide-mode-line)) (defun show-clutter () (interactive) - (fringe-mode '(8 . 8)) (show-mode-line)) -(hide-clutter) (when mode-line-default-hidden (call-interactively #'hide-mode-line)) @@ -310,11 +312,11 @@ Sometimes I like to hide clutter. Other times, it's useful. (add-to-list 'default-frame-alist '(border-width . 0)) (add-to-list 'default-frame-alist '(internal-border-width . 0)) -(when (eq window-system 'x) +(when (or (eq window-system 'x) + (eq window-system 'mac)) (setq window-divider-default-bottom-width 1 window-divider-default-right-width 1 window-divider-default-places t) - (setq mode-line-default-hidden t) (window-divider-mode +1)) (add-hook 'after-change-major-mode-hook #'hide-mode-line-if-default-hidden) @@ -386,7 +388,9 @@ variables from whatever my shell configuration is. #+BEGIN_SRC emacs-lisp (use-package exec-path-from-shell :if (eq system-type 'darwin) - :config (exec-path-from-shell-initialize)) + :config (progn + (setq exec-path-from-shell-arguments '("-l")) + (exec-path-from-shell-initialize))) #+END_SRC * Keybindings @@ -511,7 +515,7 @@ based upon some folder conventions I use. :demand t :diminish projectile-mode :config (progn - (projectile-global-mode) + (projectile-mode 1) (add-to-list 'projectile-globally-ignored-directories ".stversions") (defun yarn-install (&optional arg) @@ -572,13 +576,25 @@ changed. This package colours the fringe. I have it set to the right fringe so it doesn’t interfere with flycheck. #+BEGIN_SRC emacs-lisp +(eval-when-compile (require 'fringe-helper)) (use-package git-gutter-fringe :defer 2 :diminish git-gutter-mode :config (progn (global-git-gutter-mode 1) - (set-face-foreground 'git-gutter:modified "grey") - (setq git-gutter-fr:side 'right-fringe))) + ;; places the git gutter outside the margins. + (setq-default fringes-outside-margins t) + ;; thin fringe bitmaps + (fringe-helper-define 'git-gutter-fr:added '(center repeated) + "XXX.....") + (fringe-helper-define 'git-gutter-fr:modified '(center repeated) + "XXX.....") + (fringe-helper-define 'git-gutter-fr:deleted 'bottom + "X......." + "XX......" + "XXX....." + "XXXX....") + (setq git-gutter-fr:side 'left-fringe))) #+END_SRC ** magit @@ -1036,6 +1052,7 @@ seems to work perfectly well for me. #+BEGIN_SRC emacs-lisp (use-package company-nixos-options + :defer 30 :config (progn (add-to-list 'company-backends 'company-nixos-options))) #+END_SRC @@ -1263,7 +1280,7 @@ workplace, so I keep it in a host-specific, GPG-encrypted file. send-mail-function #'smtpmail-send-it message-send-mail-function #'smtpmail-send-it))) -(with-eval-after-load 'gnus-mime +(with-eval-after-load "gnus-mime" (define-key gnus-mime-button-map " " #'gnus-mime-view-part-externally)) (with-eval-after-load "mailcap" @@ -1718,15 +1735,32 @@ On-the-fly error checking in programming modes? Yes please. :defer 5 :config (progn (global-flycheck-mode) - (setq flycheck-check-syntax-automatically '(save new-line mode-enabled)) + (setq flycheck-check-syntax-automatically '(save mode-enabled)) + (setq flycheck-indication-mode 'right-fringe) + (with-eval-after-load 'git-gutter-fringe + (fringe-helper-define 'flycheck-fringe-bitmap-double-arrow '(center repeated) + ".XXXXXXX")) (if (executable-find "eslint_d") (setq flycheck-javascript-eslint-executable "eslint_d")))) #+END_SRC +*** flycheck-pos-tip + +Show flycheck errors in a little popup, so I don't lose my place + +#+BEGIN_SRC emacs-lisp +(use-package flycheck-pos-tip + :after flycheck + :config (progn + (setq flycheck-display-errors-delay 0.5) + (flycheck-pos-tip-mode 1))) +#+END_SRC + *** flycheck-flow #+BEGIN_SRC emacs-lisp (use-package flycheck-flow + :after js2-mode :config (progn (flycheck-add-next-checker 'javascript-eslint 'javascript-flow))) #+END_SRC @@ -1791,6 +1825,15 @@ guess a definition. :config (setq dumb-jump-selector 'ivy)) #+END_SRC +** imenu-anywhere + +This is like imenu, but shows functions (or similar top-level +entities) across buffers in the same project. Neat! + +#+BEGIN_SRC emacs-lisp +(use-package imenu-anywhere + :bind ("C-x C-." . ivy-imenu-anywhere)) +#+END_SRC ** Lisps *** All @@ -2037,6 +2080,15 @@ the project. This will allows emacs to find their executables. (add-hook 'js2-mode-hook #'add-node-modules-path))) #+END_SRC +**** Flow + +#+BEGIN_SRC emacs-lisp +(use-package flow-minor-mode + :after js2-mode + :config (progn + (add-hook 'js2-mode-hook #'flow-minor-enable-automatically))) +#+END_SRC + **** Indium Javascript with an inferior node.js process and a debugger? Awesome. @@ -2265,6 +2317,17 @@ Sometimes I might want to show off my emacs usage. (add-hook 'prog-mode-hook #'flyspell-prog-mode))) #+END_SRC +** Style checking + +[[https://github.com/ValeLint/vale][Vale]] is a linter, but for prose. Neat idea! Salesman is a bad term. + +#+BEGIN_SRC emacs-lisp +(use-package flycheck-vale + :config (progn + (add-to-list 'flycheck-vale-modes 'org-mode) + (flycheck-vale-setup))) +#+END_SRC + * Scripting Make a shell-script buffer executable after saving it, if it has a shebang. @@ -2294,6 +2357,8 @@ nice, when I remember to use it. #+BEGIN_SRC emacs-lisp (use-package eshell :bind ("C-c s" . eshell) + :defer 10 + :functions (eshell/pwd) :config (progn (setq eshell-directory-name "~/.emacs.d/eshell" eshell-prompt-function (lambda () @@ -2354,6 +2419,7 @@ Emacs has an editor within. (put 'downcase-region 'disabled nil) (setq sentence-end-double-space t line-move-visual nil) +(setq-default truncate-lines t) #+END_SRC ** align @@ -2377,7 +2443,7 @@ The most important one for me is JSON property alignment. I like to use the clipboard more than the primary selection in X11. #+BEGIN_SRC emacs-lisp -(setq x-select-enable-clipboard t +(setq select-enable-clipboard t save-interprogram-paste-before-kill t) (if (functionp 'x-cut-buffer-or-selection-value) (setq interprogram-paste-function 'x-cut-buffer-or-selection-value)) diff --git a/zsh/.config/zsh/.zshenv b/zsh/.config/zsh/.zshenv index b42b256..87dda38 100644 --- a/zsh/.config/zsh/.zshenv +++ b/zsh/.config/zsh/.zshenv @@ -54,11 +54,6 @@ then ;; esac - if [[ ${path[(I)$HOME/bin ]} ]] - then - path+=($HOME/bin) - fi - if [[ ${path[(I)$HOME/.local/bin ]} ]] then path+=($HOME/.local/bin) |