General cleanup + update caskfile

This commit is contained in:
Henrik Lissner 2016-04-26 02:00:19 -04:00
parent 19dd1a0dd3
commit 07e2a275f6
10 changed files with 61 additions and 81 deletions

View file

@ -138,8 +138,7 @@ enable multiple minor modes for the same regexp.")
;; Smarter electric-indent
(electric-indent-mode -1) ; on by default
(defvar narf-electric-indent-p nil)
(defvar narf-electric-indent-words '())
(make-variable-buffer-local 'narf-electric-indent-words)
(defvar-local narf-electric-indent-words '())
(setq electric-indent-chars '(?\n ?\^?))
(push (lambda (c)
(when (eolp)
@ -269,7 +268,6 @@ enable multiple minor modes for the same regexp.")
(use-package smart-forward :commands (smart-up smart-down smart-left smart-right))
(use-package smartparens
:functions sp-insert-pair
:config
(setq sp-autowrap-region nil ; let evil-surround handle this
sp-highlight-pair-overlay nil

View file

@ -57,8 +57,8 @@
;; https://bitbucket.org/lyro/evil/issue/336/osx-visual-state-copies-the-region-on
;; Most of this code grokked from:
;; http://stackoverflow.com/questions/15873346/elisp-rename-macro
(defadvice evil-visual-update-x-selection (around clobber-x-select-text activate)
(unless (or (featurep 'mac) (featurep 'ns)) ad-do-it)))
(when (or (featurep 'mac) (featurep 'ns))
(advice-add 'evil-visual-update-x-selection :override 'ignore)))
;;

View file

@ -46,6 +46,9 @@ automatically renamed to the project name.")
(add-hook 'emacs-startup-hook 'workgroups-mode)
:config
(unless (file-exists-p wg-workgroup-directory)
(mkdir wg-workgroup-directory))
;; Remember the set names in between sessions
(push 'narf-wg-names savehist-additional-variables)

View file

@ -20,7 +20,7 @@
split-width-threshold nil ; favor horizontal splits
show-help-function nil ; hide :help-echo text
jit-lock-defer-time 0.04
jit-lock-defer-time nil
jit-lock-stealth-nice 0.1
jit-lock-stealth-time 0.2
jit-lock-stealth-verbose nil
@ -59,8 +59,8 @@
(setq frame-title-format '(buffer-file-name "%f" ("%b")))
;; set fonts
(narf/load-font narf-default-font)
(set-face-attribute 'default t :font narf-default-font)
(set-frame-font (setq narf-current-font narf-default-font) t)
(set-face-attribute 'default t :font narf-current-font)
;; standardize fringe width
(fringe-mode narf-fringe-size)
@ -73,31 +73,22 @@
;; Brighter minibuffer when active
(defface narf-minibuffer-active '((t (:inherit mode-line)))
"Face for active minibuffer")
(defun narf|minibuffer-setup ()
(add-hook! minibuffer-setup
(set-window-fringes (selected-window) 0 0 nil)
(make-local-variable 'face-remapping-alist)
(add-to-list 'face-remapping-alist '(default narf-minibuffer-active)))
(add-hook! minibuffer-setup 'narf|minibuffer-setup)
(add-hook! 'after-init-hook (set-window-fringes (minibuffer-window) 0 0 nil)))
;; Try to display unicode characters without upsetting line-hieght (as much as possible)
(mapc (lambda (set)
(let ((font (car set))
(chars (cadr set))
(size (caddr set)))
(mapc (lambda (x) (set-fontset-font
"fontset-default" `(,x . ,x)
(font-spec :name font :size size) nil 'prepend))
chars)))
'(("DejaVu Sans" (?☑ ?☐ ?⚠ ?★ ?♭ ?♯
?➊ ?➋ ?➌ ?➍ ?➎ ?❻ ?➐ ?➑ ?➒ ?➓))
;; File attachment symbols (for org-mode)
("FontAwesome" (? ? ? ? ? ? ? ? ?) 13)
;; Certain math symbols
("Hack" (?× ?∙ ?⌉ ?⌈ ?⌊ ?⌋
?∩ ? ?⊆ ?⊂ ?⊄ ?⊇ ?⊃ ?⊅
?⇒ ?⇐ ?⇔ ?↔ ?→ ?≡ ?∴ ?∵ ?⊕ ?∀ ?∃ ?∄ ?∈ ?∉
? ?∧ ))))
(defun narf-fix-unicode (set)
(let ((font (car set))
(chars (cadr set))
(size (caddr set)))
(mapc (lambda (x) (set-fontset-font
"fontset-default" `(,x . ,x)
(font-spec :name font :size size) nil 'prepend))
chars)))
(mapc 'narf-fix-unicode '(("DejaVu Sans" (?⚠ ?★ ?➊ ?➋ ?➌ ?➍ ?➎ ?❻ ?➐ ?➑ ?➒ ?➓))))
;; on by default in Emacs 25; I prefer to enable on a mode-by-mode basis, so disable it
(when (and (> emacs-major-version 24) (featurep 'eldoc))
@ -128,9 +119,10 @@
(defface narf-note-face '((t (:inherit font-lock-warning-face)))
"Face for NOTEs")
(add-hook! (prog-mode emacs-lisp-mode)
(font-lock-add-keywords nil '(("\\<\\(TODO\\((.+)\\)?:?\\)" 1 'narf-todo-face prepend)
("\\<\\(FIXME\\((.+)\\)?:?\\)" 1 'narf-fixme-face prepend)
("\\<\\(NOTE\\((.+)\\)?:?\\)" 1 'narf-note-face prepend))))
(font-lock-add-keywords
nil '(("\\<\\(TODO\\((.+)\\)?:?\\)" 1 'narf-todo-face prepend)
("\\<\\(FIXME\\((.+)\\)?:?\\)" 1 'narf-fixme-face prepend)
("\\<\\(NOTE\\((.+)\\)?:?\\)" 1 'narf-note-face prepend))))
;; Fade out when unfocused
(add-hook! focus-in (set-frame-parameter nil 'alpha 100))
@ -144,7 +136,10 @@
;; Plugins
;;
(use-package visual-fill-column :defer t)
(use-package visual-fill-column :defer t
:config
(setq-default visual-fill-column-center-text nil
visual-fill-column-width fill-column))
(use-package highlight-indentation
:commands (highlight-indentation-mode highlight-indentation-current-column-mode)
@ -154,9 +149,9 @@
'highlight-indentation-mode)
(after! editorconfig
(defun narf/hl-indent-guess-offset ()
(defun narf*hl-indent-guess-offset ()
(string-to-int (gethash 'indent_size (editorconfig-get-properties))))
(advice-add 'highlight-indentation-guess-offset :override 'narf/hl-indent-guess-offset))
(advice-add 'highlight-indentation-guess-offset :override 'narf*hl-indent-guess-offset))
;; A long-winded method for ensuring whitespace is maintained (so that
;; highlight-indentation-mode can display them consistently)

View file

@ -34,7 +34,6 @@
ediff-split-window-function 'split-window-horizontally ; side-by-side diffs
ediff-window-setup-function 'ediff-setup-windows-plain ; no extra frames
enable-recursive-minibuffers nil ; no minibufferception
history-length 1000
idle-update-delay 2 ; update a little less often
inhibit-startup-echo-area-message "hlissner" ; username shuts up emacs
inhibit-startup-screen t ; don't show emacs start screen
@ -57,6 +56,8 @@
bookmark-default-file (concat narf-temp-dir "/bookmarks")
;; Disable all backups (that's what git/dropbox are for)
history-length 1000
vc-make-backup-files nil
auto-save-default nil
auto-save-list-file-name (concat narf-temp-dir "/autosave")
make-backup-files nil

View file

@ -1,17 +1,24 @@
;;; defuns-ui.el
;; for ../core-ui.el
;;;###autoload
(defun narf:toggle-transparency ()
(interactive)
(let* ((alpha (frame-parameter nil 'alpha))
(alpha-val (if (listp alpha) (car alpha) alpha)))
(if (/= alpha-val 97)
(set-frame-parameter nil 'alpha 100)
(set-frame-parameter nil 'alpha 0))))
;;;###autoload (autoload 'narf:toggle-fullscreen "defuns-ui" nil t)
;;;###autoload (autoload 'narf:set-columns "defuns-ui" nil t)
(after! evil
(evil-define-command narf:set-columns (&optional bang columns)
"Adjusts visual-fill-column-width on the fly."
(interactive "<!><a>")
(if (or (= (length columns) 0) bang)
(progn
(setq visual-fill-column-width 80)
(when visual-fill-column-mode
(visual-fill-column-mode -1)))
(setq columns (string-to-number columns))
(when (> columns 30)
(setq visual-fill-column-width columns)))
(if visual-fill-column-mode
(visual-fill-column--adjust-window)
(visual-fill-column-mode 1)))
(evil-define-command narf:toggle-fullscreen ()
(interactive)
(set-frame-parameter nil 'fullscreen (if (not (frame-parameter nil 'fullscreen)) 'fullboth))))