diff --git a/Cask b/Cask index 3eb3c2d53..aefffbf0b 100644 --- a/Cask +++ b/Cask @@ -92,6 +92,7 @@ (depends-on "gitconfig-mode") (depends-on "gitignore-mode") (depends-on "github-browse-file") +(depends-on "browse-at-remote") ;; Helm -- core/core-helm.el (depends-on "helm") diff --git a/core/core-evil.el b/core/core-evil.el index d40e2fb70..c18e70240 100644 --- a/core/core-evil.el +++ b/core/core-evil.el @@ -75,6 +75,17 @@ (defmacro $expand (path) `(evil-ex-replace-special-filenames ,path)) + ;; buffer-local ex commands, thanks to: + ;; http://emacs.stackexchange.com/questions/13186 + (defun evil-ex-define-cmd-local (cmd function) + "Locally binds the function FUNCTION to the command CMD." + (unless (local-variable-p 'evil-ex-commands) + (setq-local evil-ex-commands (copy-alist evil-ex-commands))) + (evil-ex-define-cmd cmd function)) + ;; Shortcuts for `evil-ex-define-cmd' + (defalias 'exmap 'evil-ex-define-cmd) + (defalias 'exmap! 'evil-ex-define-cmd-local) + (progn ; evil hacks (defadvice evil-force-normal-state (after evil-esc-quit activate) "Close popups, disable search highlights and quit the minibuffer if open." @@ -92,14 +103,6 @@ (mapcar (lambda (i) (if (numberp i) (truncate i) i)) args)) (advice-add 'evil-move-to-column :filter-args 'narf*evil-move-to-column-fix) - ;; buffer-local ex commands, thanks to: - ;; http://emacs.stackexchange.com/questions/13186 - (defun evil-ex-define-cmd-local (cmd function) - "Locally binds the function FUNCTION to the command CMD." - (unless (local-variable-p 'evil-ex-commands) - (setq-local evil-ex-commands (copy-alist evil-ex-commands))) - (evil-ex-define-cmd cmd function)) - ;; Hide keystroke display while isearch is active (add-hook! isearch-mode (setq echo-keystrokes 0)) (add-hook! isearch-mode-end (setq echo-keystrokes 0.02)) @@ -188,35 +191,45 @@ "\\1" file-name t))) file-name)) - ;; Highlight buffer match interactive codes - (defvar narf-buffer-match-global evil-ex-substitute-global - "Whether or not buffer-match ex completion should add the ?g flag to searches.") - (evil-ex-define-argument-type buffer-match - :runner - (lambda (flag &optional arg) - (let ((hl-name 'evil-ex-buffer-match)) - (with-selected-window (minibuffer-selected-window) - (narf/-ex-match-init hl-name) - (narf/-ex-buffer-match arg hl-name (list (if narf-buffer-match-global ?g))))))) + ;; Make :g[lobal] highlight matches + (defvar narf-buffer-match-global evil-ex-substitute-global "") + (defun narf--ex-buffer-match (flag &optional arg) + (let ((hl-name 'evil-ex-buffer-match)) + (with-selected-window (minibuffer-selected-window) + (narf/-ex-match-init hl-name) + (narf/-ex-buffer-match arg hl-name (list (if narf-buffer-match-global ?g)))))) + (defun narf--ex-global-match (flag &optional arg) + (let ((hl-name 'evil-ex-global-match)) + (with-selected-window (minibuffer-selected-window) + (narf/-ex-match-init hl-name) + (let ((result (car-safe (evil-ex-parse-global arg)))) + (narf/-ex-buffer-match result hl-name nil (point-min) (point-max)))))) + + (evil-ex-define-argument-type buffer-match :runner narf--ex-buffer-match) + (evil-ex-define-argument-type global-match :runner narf--ex-global-match) + (evil-define-interactive-code "" - "Ex buffer match argument." :ex-arg buffer-match (list (when (evil-ex-p) evil-ex-argument))) - - ;; Make :g[lobal] highlight matches - (evil-ex-define-argument-type global-match - :runner - (lambda (flag &optional arg) - (let ((hl-name 'evil-ex-global-match)) - (with-selected-window (minibuffer-selected-window) - (narf/-ex-match-init hl-name) - (let ((result (car-safe (evil-ex-parse-global arg)))) - (narf/-ex-buffer-match result hl-name nil (point-min) (point-max))))))) - (evil-define-interactive-code "" - "Ex global argument." + (evil-define-interactive-code "" :ex-arg global-match - (when (evil-ex-p) - (evil-ex-parse-global evil-ex-argument)))) + (when (evil-ex-p) (evil-ex-parse-global evil-ex-argument))) + + (evil-define-operator narf:align (&optional beg end bang pattern) + (interactive "") + (align-regexp + beg end + (concat "\\(\\s-*\\)" + (if bang + (regexp-quote pattern) + (rxt-pcre-to-elisp pattern))) + 1 1)) + (evil-define-operator narf:evil-ex-global (beg end pattern command &optional invert) + :motion mark-whole-buffer + :move-point nil + (interactive "") + (evil-ex-global beg end pattern command invert)) + (exmap "g[lobal]" 'narf:evil-ex-global)) ;; evil plugins (use-package evil-anzu @@ -246,6 +259,7 @@ :functions (iedit-current-occurrence-string iedit-restrict-region) :commands (evil-iedit-state evil-iedit-state/iedit-mode) :config + (advice-add 'evil-force-normal-state :after 'evil-iedit-state/quit-iedit-mode) (define-key evil-iedit-state-map (kbd "") 'evil-iedit-state/quit-iedit-mode) (define-key evil-visual-state-map (kbd "SPC") 'narf:iedit-restrict-to-region) (let ((map evil-iedit-state-map)) diff --git a/core/core-flycheck.el b/core/core-flycheck.el index d3ec612ff..a28491e2b 100644 --- a/core/core-flycheck.el +++ b/core/core-flycheck.el @@ -22,7 +22,27 @@ ;; Check buffer when normal mode is entered (add-hook! evil-normal-state-entry 'narf*flycheck-buffer) ;; And on ESC in normal mode. - (advice-add 'evil-force-normal-state :after 'narf*flycheck-buffer)) + (advice-add 'evil-force-normal-state :after 'narf*flycheck-buffer) + + (define-fringe-bitmap 'flycheck-fringe-bitmap-double-arrow + [0 0 0 0 8 24 56 120 56 24 8 0 0 0 0] + ;; (fringe-helper-convert + ;; "........" + ;; "........" + ;; "........" + ;; "........" + ;; "....X..." + ;; "...XX..." + ;; "..XXX..." + ;; ".XXXX..." + ;; "..XXX..." + ;; "...XX..." + ;; "....X..." + ;; "........" + ;; "........" + ;; "........" + ;; "........") + )) (use-package flyspell :commands flyspell-mode) diff --git a/core/core-helm.el b/core/core-helm.el index f72aaffe3..36d6a3934 100644 --- a/core/core-helm.el +++ b/core/core-helm.el @@ -2,7 +2,7 @@ (use-package helm :init - (defvar helm-global-prompt "> ") + (defvar helm-global-prompt ">>> ") (setq-default helm-quick-update t helm-reuse-last-window-split-state t diff --git a/core/core-popup.el b/core/core-popup.el index 627b7f0ff..be742504b 100644 --- a/core/core-popup.el +++ b/core/core-popup.el @@ -6,18 +6,20 @@ (setq popwin:popup-window-height 0.3) (mapc (lambda (rule) (push rule popwin:special-display-config)) '(("*Help*" :position bottom :height 0.25 :stick t) - (debugger-mode :position bottom :height 15) + (debugger-mode :position bottom :height 15 :dedicated t :stick t) ("*evil-registers*" :position bottom :height 0.3 :stick t) ("*scratch*" :position bottom :height 20 :stick t) ("*Apropos*" :position bottom :height 40 :stick t) - ("*Backtrace*" :position bottom :height 15 :stick t) + ("*Backtrace*" :position bottom :height 15 :dedicated t :stick t) ("*Flycheck errors*" :position bottom :height 15 :stick t) ("*quickrun*" :position bottom :height 15 :stick t) ("*minor-modes*" :position bottom :height 0.5 :stick t) ("^\\*CPU-Profiler-Report .+\\*$" :regexp t :position bottom :height 0.35) ;; vcs - ("\\*git-gutter.+\\*" :regexp t :position bottom :height 30 :stick t) + ("^\\*git-gutter.+\\*$" :regexp t :position bottom :height 0.4 :stick t) + ("*vc-diff*" :position bottom :height 0.4 :stick t) + ("*vc-change-log*" :position bottom :stick t :noselect t) ;; Helm ("^\\*[Hh]elm.*?\\*\\'" :regexp t :position bottom :height 0.2) diff --git a/core/core-project.el b/core/core-project.el index d1b25f3a3..848f8b5a4 100644 --- a/core/core-project.el +++ b/core/core-project.el @@ -22,12 +22,6 @@ (add-to-list 'ido-ignore-files "\\`.DS_Store$") (add-to-list 'ido-ignore-files "Icon\\?$") - (ido-mode 1) - (ido-everywhere 1) - - (require 'ido-ubiquitous) - (ido-ubiquitous-mode 1) - (add-hook! ido-setup (require 'ido-vertical-mode) (ido-vertical-mode 1) diff --git a/core/core-quickrun.el b/core/core-quickrun.el index fa2d41b3e..6aef65487 100644 --- a/core/core-quickrun.el +++ b/core/core-quickrun.el @@ -19,6 +19,7 @@ (setq rtog/goto-buffer-fun 'popwin:pop-to-buffer rtog/mode-repl-alist '()) + (add-hook! repl-toggle-mode 'yascroll-bar-mode) (add-hook! repl-toggle-mode (evil-initialize-state 'emacs))) (provide 'core-quickrun) diff --git a/core/core-ui.el b/core/core-ui.el index 44816cf16..65d3dd21e 100644 --- a/core/core-ui.el +++ b/core/core-ui.el @@ -23,15 +23,18 @@ jit-lock-defer-time nil jit-lock-stealth-time 1 + idle-update-delay 1 - split-width-threshold nil - split-height-threshold 30 + split-width-threshold nil ; favor horizontal splits + ;; Minibuffer resizing resize-mini-windows 'grow-only + max-mini-window-height 0.3 fringe-indicator-alist (delq (assoc 'continuation fringe-indicator-alist) fringe-indicator-alist)) +(defface narf-minibuffer-active '((t (:inherit mode-line))) "Face for active minibuffer") (defvar narf-fringe-size 6) (if window-system (progn @@ -49,12 +52,15 @@ (defun narf|minibuffer-setup () (set-window-fringes (selected-window) 0 0 nil) (make-local-variable 'face-remapping-alist) - (add-to-list 'face-remapping-alist '(default mode-line-inactive))) + (add-to-list 'face-remapping-alist '(default narf-minibuffer-active))) (add-hook! minibuffer-setup 'narf|minibuffer-setup)) (menu-bar-mode -1)) -(mapc (lambda (x) (set-fontset-font "fontset-default" `(,x . ,x) "DejaVu Sans" nil 'prepend)) - '(?☑ ?☐)) +(mapc (lambda (x) (set-fontset-font "fontset-default" `(,x . ,x) (font-spec :name "DejaVu Sans") nil 'prepend)) + '(?☑ ?☐ ?✍ ?⚠)) + +(mapc (lambda (x) (set-fontset-font "fontset-default" `(,x . ,x) (font-spec :name "DejaVu Sans" :size 10) nil)) + '(?➊ ?➋ ?➌ ?➍ ?➎ ?❻ ?➐ ?➑ ?➒ ?➓)) (blink-cursor-mode 1) ; do blink cursor (tooltip-mode -1) ; show tooltips in echo area @@ -218,7 +224,7 @@ ;; Mode-line ;;;;;;;;;;;;;;;;;;;;;;;;;;; -(use-package spaceline-segments +(use-package spaceline :init (defvar narf--env-version nil) (defvar narf--env-command nil) @@ -227,173 +233,253 @@ :config (setq-default powerline-default-separator nil - powerline-height 19 + powerline-height 15 spaceline-highlight-face-func 'spaceline-highlight-face-evil-state) (defface mode-line-is-modified nil "Face for mode-line modified symbol") (defface mode-line-buffer-file nil "Face for mode-line buffer file path") - ;; Custom modeline segments - (spaceline-define-segment narf-buffer-path - (if buffer-file-name - (let* ((project-path (let (projectile-require-project-root) (projectile-project-root))) - (buffer-path (file-relative-name buffer-file-name project-path)) - (max-length (/ (window-width) 2)) - (path-len (length buffer-path))) - (concat (file-name-nondirectory (directory-file-name project-path)) - "/" - (if (> path-len max-length) - (concat "…" (replace-regexp-in-string - "^.*?/" "/" - (substring buffer-path (- path-len max-length) path-len))) - buffer-path))) - "%b") - :face (if active 'mode-line-buffer-file 'mode-line-inactive) - :skip-alternate t - :tight-right t) + (progn ;; Custom modeline segments + (spaceline-define-segment *buffer-path + (if buffer-file-name + (let* ((project-path (let (projectile-require-project-root) (projectile-project-root))) + (buffer-path (file-relative-name buffer-file-name project-path)) + (max-length (/ (window-width) 2)) + (path-len (length buffer-path))) + (concat (file-name-nondirectory (directory-file-name project-path)) + "/" + (if (> path-len max-length) + (concat "…" (replace-regexp-in-string + "^.*?/" "/" + (substring buffer-path (- path-len max-length) path-len))) + buffer-path))) + "%b") + :face (if active 'mode-line-buffer-file 'mode-line-inactive) + :skip-alternate t + :tight-right t) - (spaceline-define-segment narf-buffer-modified - (concat - (when buffer-file-name - (concat - (when (buffer-modified-p) "[+]") - (unless (file-exists-p buffer-file-name) "[!]"))) - (if buffer-read-only "[RO]")) - :face mode-line-is-modified - :when (not (string-prefix-p "*" (buffer-name))) - :skip-alternate t - :tight t) + (spaceline-define-segment *buffer-modified + (concat + (when buffer-file-name + (concat + (when (buffer-modified-p) "[+]") + (unless (file-exists-p buffer-file-name) "[!]"))) + (if buffer-read-only "[RO]")) + :face mode-line-is-modified + :when (not (string-prefix-p "*" (buffer-name))) + :skip-alternate t + :tight t) - (spaceline-define-segment narf-buffer-encoding-abbrev - "The line ending convention used in the buffer." - (symbol-name buffer-file-coding-system) - :when (not (string-match-p "\\(utf-8\\|undecided\\)" - (symbol-name buffer-file-coding-system)))) + (spaceline-define-segment *buffer-encoding-abbrev + "The line ending convention used in the buffer." + (symbol-name buffer-file-coding-system) + :when (not (string-match-p "\\(utf-8\\|undecided\\)" + (symbol-name buffer-file-coding-system)))) - (spaceline-define-segment narf-buffer-position - "A more vim-like buffer position." - (let ((start (window-start)) - (end (window-end)) - (pend (point-max))) - (if (and (eq start 1) - (eq end pend)) - ":All" - (let ((perc (/ end 0.01 pend))) - (cond ((eq start 1) ":Top") - ((>= perc 100) ":Bot") - (t (format ":%d%%%%" perc)))))) - :tight t) + (spaceline-define-segment *buffer-position + "A more vim-like buffer position." + (let ((start (window-start)) + (end (window-end)) + (pend (point-max))) + (if (and (eq start 1) + (eq end pend)) + ":All" + (let ((perc (/ end 0.01 pend))) + (cond ((eq start 1) ":Top") + ((>= perc 100) ":Bot") + (t (format ":%d%%%%" perc)))))) + :tight t) - (spaceline-define-segment narf-vc - "Version control info" - (powerline-raw - (concat (replace-regexp-in-string - (format "^ %s" (vc-backend buffer-file-name)) - "" vc-mode) - (when buffer-file-name - (pcase (vc-state (buffer-file-name)) - (`up-to-date "") - (`edited "*") - (`added "+") - (`unregistered "?") - (`removed "-") - (`needs-merge "%") - (`needs-update "^") - (`ignored "#") - (_ "_"))))) - :when (and active vc-mode) - :face other-face - :tight-right t) + (spaceline-define-segment *vc + "Version control info" + (powerline-raw + (concat (replace-regexp-in-string + (format "^ %s" (vc-backend buffer-file-name)) + "" vc-mode) + (when buffer-file-name + (pcase (vc-state (buffer-file-name)) + (`up-to-date "") + (`edited "*") + (`added "+") + (`unregistered "?") + (`removed "-") + (`needs-merge "%") + (`needs-update "^") + (`ignored "#") + (_ "_"))))) + :when (and active vc-mode) + :face other-face + :tight-right t) - (spaceline-define-segment narf-env-version - "A HUD that shows which part of the buffer is currently visible." - narf--env-version - :when narf--env-version - :skip-alternate t - :tight-right t) + (spaceline-define-segment *env-version + "A HUD that shows which part of the buffer is currently visible." + narf--env-version + :when narf--env-version + :face other-face + :skip-alternate t + :tight-right t) - (spaceline-define-segment narf-hud - "A HUD that shows which part of the buffer is currently visible." - (powerline-hud highlight-face other-face 1) - :face other-face - :tight-right t) + (spaceline-define-segment *hud + "A HUD that shows which part of the buffer is currently visible." + (powerline-hud highlight-face other-face 1) + :face other-face + :tight-right t) - (defface mode-line-count-face nil "") - (make-variable-buffer-local 'anzu--state) - (spaceline-define-segment narf-anzu - "Show the current match number and the total number of matches. Requires + (defface mode-line-count-face nil "") + (make-variable-buffer-local 'anzu--state) + (spaceline-define-segment *anzu + "Show the current match number and the total number of matches. Requires anzu to be enabled." - (let ((here anzu--current-position) - (total anzu--total-matched)) - (format " %s/%d%s " - (anzu--format-here-position here total) - total (if anzu--overflow-p "+" ""))) - :face (if active 'mode-line-count-face 'mode-line-inactive) - :when (and (> anzu--total-matched 0) (evil-ex-hl-active-p 'evil-ex-search)) - :skip-alternate t - :tight t) + (let ((here anzu--current-position) + (total anzu--total-matched)) + (format " %s/%d%s " + (anzu--format-here-position here total) + total (if anzu--overflow-p "+" ""))) + :face (if active 'mode-line-count-face 'mode-line-inactive) + :when (and (> anzu--total-matched 0) (evil-ex-hl-active-p 'evil-ex-search)) + :skip-alternate t + :tight t) - ;; TODO mode-line-iedit-face default face - (spaceline-define-segment narf-iedit - "Show the number of matches and what match you're on (or after). Requires + ;; TODO mode-line-iedit-face default face + (spaceline-define-segment *iedit + "Show the number of matches and what match you're on (or after). Requires iedit." - (let ((this-oc (iedit-find-current-occurrence-overlay)) - (length (or (ignore-errors (length iedit-occurrences-overlays)) 0))) - (format "%s/%s" - (save-excursion - (unless this-oc - (iedit-prev-occurrence) - (setq this-oc (iedit-find-current-occurrence-overlay))) - (if this-oc - ;; NOTE: Not terribly reliable - (- length (-elem-index this-oc iedit-occurrences-overlays)) - "-")) - length)) - :face (if active 'mode-line-count-face 'mode-line-inactive) - :skip-alternate t - :when (bound-and-true-p iedit-mode)) + (let ((this-oc (iedit-find-current-occurrence-overlay)) + (length (or (ignore-errors (length iedit-occurrences-overlays)) 0))) + (format "%s/%s" + (save-excursion + (unless this-oc + (iedit-prev-occurrence) + (setq this-oc (iedit-find-current-occurrence-overlay))) + (if this-oc + ;; NOTE: Not terribly reliable + (- length (-elem-index this-oc iedit-occurrences-overlays)) + "-")) + length)) + :when (bound-and-true-p iedit-mode) + :face (if active 'mode-line-count-face 'mode-line-inactive) + :skip-alternate t) - ;; TODO mode-line-substitute-face default face - (defface mode-line-substitute-face nil "") - ;; TODO This is very hackish; refactor? - (spaceline-define-segment narf-evil-substitute - "Show number of :s matches in real time." - (let ((range (if evil-ex-range - (cons (car evil-ex-range) (cadr evil-ex-range)) - (cons (line-beginning-position) (line-end-position)))) - (pattern (car-safe (evil-delimited-arguments evil-ex-argument 2)))) - (if pattern - (format "%s matches" - (count-matches pattern (car range) (cdr range)) - evil-ex-argument) - " ... ")) - :face (if active 'mode-line-count-face 'mode-line-inactive) - :skip-alternate t - :when (and (evil-ex-p) (evil-ex-hl-active-p 'evil-ex-substitute))) + (defface mode-line-substitute-face nil "") + (spaceline-define-segment *evil-substitute + "Show number of :s matches in real time." + (let ((range (if evil-ex-range + (cons (car evil-ex-range) (cadr evil-ex-range)) + (cons (line-beginning-position) (line-end-position)))) + (pattern (car-safe (evil-delimited-arguments evil-ex-argument 2)))) + (if pattern + (format "%s matches" + (count-matches pattern (car range) (cdr range)) + evil-ex-argument) + " ... ")) + :when (and (evil-ex-p) (evil-ex-hl-active-p 'evil-ex-substitute)) + :face (if active 'mode-line-count-face 'mode-line-inactive) + :skip-alternate t) - (spaceline-define-segment narf-major-mode - (powerline-raw mode-name) - :tight-right t - :skip-alternate t) + (spaceline-define-segment *macro-recording + "Show when recording macro" + (format "%s ▶" (char-to-string evil-this-macro)) + :when (and active defining-kbd-macro) + :face highlight-face + :skip-alternate t) + + (spaceline-define-segment *major-mode + (powerline-raw + (concat + mode-name + mode-line-process)) + :tight-right t) + + (spaceline-define-segment *buffer-size + (powerline-buffer-size) + :tight-right t + :skip-alternate t) + + (spaceline-define-segment *remote-host + "Hostname for remote buffers." + (concat "@" (file-remote-p default-directory 'host)) + :when (file-remote-p default-directory 'host)) + + (defun narf--col-at-pos (pos) + (save-excursion (goto-char pos) (current-column))) + (spaceline-define-segment *selection-info + "Information about the size of the current selection, when applicable. +Supports both Emacs and Evil cursor conventions." + (let ((reg-beg (region-beginning)) + (reg-end (region-end))) + (let* ((lines (count-lines reg-beg (min (1+ reg-end) (point-max)))) + (chars (- (1+ reg-end) reg-beg)) + (cols (1+ (abs (- (narf--col-at-pos reg-end) + (narf--col-at-pos reg-beg))))) + (evil (eq 'visual evil-state)) + (rect (or (bound-and-true-p rectangle-mark-mode) + (and evil (eq 'block evil-visual-selection)))) + (multi-line (or (> lines 1) (eq 'line evil-visual-selection)))) + (cond + (rect (format "%dx%d block" lines (if evil cols (1- cols)))) + (multi-line (format "%d lines" lines)) + (t (format "%d chars" (if evil chars (1- chars))))))) + :when (or mark-active (eq 'visual evil-state)) + :face highlight-face + :skip-alternate t) + + (defun narf--flycheck-count (state) + "Return flycheck information for the given error type STATE." + (let* ((counts (flycheck-count-errors flycheck-current-errors)) + (errorp (flycheck-has-current-errors-p state)) + (running (eq 'running flycheck-last-status-change)) + (err (cdr (assq state counts)))) + (when errorp (if running "?" err)))) + + (defface spaceline-flycheck-error + '((t (:foreground "#FC5C94" :distant-foreground "#A20C41"))) + "Face for flycheck error feedback in the modeline.") + (defface spaceline-flycheck-warning + '((t (:foreground "#F3EA98" :distant-foreground "#968B26"))) + "Face for flycheck warning feedback in the modeline.") + (defface spaceline-flycheck-info + '((t (:foreground "#8DE6F7" :distant-foreground "#21889B"))) + "Face for flycheck info feedback in the modeline.") + + (defvar narf--flycheck-err-cache nil "") + (defvar narf--flycheck-cache nil "") + (spaceline-define-segment *flycheck + "Persistent and cached flycheck indicators in the mode-line." + (or (and (or (eq narf--flycheck-err-cache narf--flycheck-cache) + (memq flycheck-last-status-change '(running not-checked))) + narf--flycheck-cache) + (and (setq narf--flycheck-err-cache flycheck-current-errors) + (setq narf--flycheck-cache + (let ((fe (narf--flycheck-count 'error)) + (fw (narf--flycheck-count 'warning)) + (fi (narf--flycheck-count 'info))) + (concat + (when fe (powerline-raw (format " ⚠%s " fe) 'spaceline-flycheck-error)) + (when fw (powerline-raw (format " ⚠%s " fw) 'spaceline-flycheck-warning)) + (when fi (powerline-raw (format " ⚠%s " fi) 'spaceline-flycheck-info))))))) + :when (and (bound-and-true-p flycheck-mode) + (or flycheck-current-errors + (eq 'running flycheck-last-status-change))) + :tight-left t)) ;; Initialize modeline (spaceline-install ;; Left side - '(narf-anzu narf-iedit narf-evil-substitute - (narf-buffer-path remote-host) - narf-buffer-modified - narf-vc - ((flycheck-error flycheck-warning flycheck-info) :when active)) + '(*macro-recording + (*flycheck :fallback *buffer-size) + (*anzu *iedit *evil-substitute) + (*buffer-path *remote-host) + *buffer-modified + *vc + ) ;; Right side - '((selection-info :face highlight-face :skip-alternate t :when active) - narf-env-version - narf-buffer-encoding-abbrev - (narf-major-mode - ;; (minor-modes :separator " " :tight t) - (process :tight t)) + '(*selection-info + *buffer-encoding-abbrev + *major-mode + *env-version (global :when active) - ("%l·%c" narf-buffer-position) - narf-hud + ("%l/%c" *buffer-position) + *hud ))) (provide 'core-ui) diff --git a/core/core-vcs.el b/core/core-vcs.el index 23500e699..2870225e1 100644 --- a/core/core-vcs.el +++ b/core/core-vcs.el @@ -9,23 +9,21 @@ "/\\.git/info/exclude$" "/git/ignore$")) -(use-package github-browse-file - :commands (github-browse-file github-browse-file-blame) +(use-package browse-at-remote + :defer t :init (evil-define-command narf:github-browse-file (&optional bang) (interactive "") - (if bang (github-browse-file-blame) (github-browse-file)))) + (browse-at-remote bang))) (use-package git-gutter :commands (git-gutter-mode narf/vcs-next-hunk narf/vcs-prev-hunk narf/vcs-show-hunk narf/vcs-stage-hunk narf/vcs-revert-hunk) :init - (add-hook! (text-mode prog-mode) 'git-gutter-mode) + (add-hook! (text-mode prog-mode conf-mode) 'git-gutter-mode) :config (require 'git-gutter-fringe) - (setq git-gutter:update-interval 2) - (defalias 'narf/vcs-next-hunk 'git-gutter:next-hunk) (defalias 'narf/vcs-prev-hunk 'git-gutter:previous-hunk) (defalias 'narf/vcs-show-hunk 'git-gutter:popup-hunk) @@ -43,9 +41,7 @@ nil nil 'center) (advice-add 'evil-force-normal-state :after 'git-gutter) - - (add-hook! focus-in 'git-gutter:update-all-windows) - (add-hook! evil-insert-state-exit 'git-gutter)) + (add-hook! focus-in 'git-gutter:update-all-windows)) (use-package diff-hl :disabled t @@ -53,11 +49,11 @@ (setq diff-hl-draw-borders nil diff-hl-fringe-bmp-function 'narf-diff-hl-fringe-bmp) :config - (defalias narf/vcs-next-hunk 'diff-hl-next-hunk) - (defalias narf/vcs-prev-hunk 'diff-hl-previous-hunk) - ;; (defalias narf/vcs-show-hunk - ;; (defalias narf/vcs-stage-hunk ...) - (defalias narf/vcs-revert-hunk 'diff-hl-revert-hunk) + (defalias 'narf/vcs-next-hunk 'diff-hl-next-hunk) + (defalias 'narf/vcs-prev-hunk 'diff-hl-previous-hunk) + ;; (defalias 'narf/vcs-show-hunk + ;; (defalias 'narf/vcs-stage-hunk ...) + (defalias 'narf/vcs-revert-hunk 'diff-hl-revert-hunk) (defun narf-diff-hl-fringe-bmp (type _pos) (if (eq type 'delete) @@ -76,5 +72,18 @@ (global-diff-hl-mode 1)) +(after! vc-annotate + (evil-set-initial-state 'vc-annotate-mode 'normal) + (evil-set-initial-state 'vc-git-log-view-mode 'normal) + (map! :map vc-annotate-mode-map + :n "q" 'kill-this-buffer + :n "d" 'vc-annotate-show-diff-revision-at-line + :n "D" 'vc-annotate-show-changeset-diff-revision-at-line + :n "SPC" 'vc-annotate-show-log-revision-at-line + :n "]]" 'vc-annotate-next-revision + :n "[[" 'vc-annotate-prev-revision + :n [tab] 'vc-annotate-toggle-annotation-visibility + :n "RET" 'vc-annotate-find-revision-at-line)) + (provide 'core-vcs) ;;; core-vcs.el ends here diff --git a/core/core-workgroups.el b/core/core-workgroups.el index ed1a76d68..5e1fc4bc9 100644 --- a/core/core-workgroups.el +++ b/core/core-workgroups.el @@ -10,14 +10,14 @@ wg-first-wg-name "*untitled*" wg-session-load-on-start t wg-mode-line-display-on nil - wg-mess-with-buffer-list t + wg-mess-with-buffer-list nil wg-emacs-exit-save-behavior 'save ; Options: 'save 'ask nil wg-workgroups-mode-exit-save-behavior 'save wg-log-level 0 wg-list-display-decor-divider " " wg-list-display-decor-left-brace "" - wg-list-display-decor-right-brace "" + wg-list-display-decor-right-brace "| " wg-list-display-decor-current-left "" wg-list-display-decor-current-right "" wg-list-display-decor-previous-left "" @@ -31,9 +31,12 @@ (candidates . wg-workgroup-names) (action . narf/wg-helm-switch-to-workgroup))) + (add-to-list 'savehist-additional-variables 'narf-wg-names) (defvar narf-wg-frames '()) (defvar narf-wg-names '()) - (add-to-list 'savehist-additional-variables 'narf-wg-names) + + (unless (file-exists-p wg-workgroup-directory) + (mkdir wg-workgroup-directory)) (after! projectile ;; Create a new workgroup on switch-project diff --git a/core/core.el b/core/core.el index dba72ffb4..b862945d5 100644 --- a/core/core.el +++ b/core/core.el @@ -138,7 +138,7 @@ (defun display-startup-echo-area-message () (after! workgroups2 - (message "%s Loaded in %s" (narf/workgroup-display t t) (emacs-init-time)))) + (message "%sLoaded in %s" (narf/workgroup-display t t) (emacs-init-time)))) (require 'server) (unless (server-running-p) diff --git a/core/lib/defuns-buffers.el b/core/lib/defuns-buffers.el index b057a5fcf..42dcd1361 100644 --- a/core/lib/defuns-buffers.el +++ b/core/lib/defuns-buffers.el @@ -39,7 +39,7 @@ Inspired from http://demonastery.org/2013/04/emacs-evil-narrow-region/" (defun narf/get-all-buffers () "Get all buffers across all workgroups. Depends on `wg-mess-with-buffer-list'." - (if (and (featurep 'workgroups2) workgroups-mode) + (if (and (featurep 'workgroups2) workgroups-mode wg-mess-with-buffer-list) (wg-buffer-list-emacs) (buffer-list))) @@ -47,7 +47,7 @@ Inspired from http://demonastery.org/2013/04/emacs-evil-narrow-region/" (defun narf/get-buffers () "Get all buffers in the current workgroup. Depends on `wg-mess-with-buffer-list'." - (buffer-list)) + (wg-workgroup-associated-buffers (wg-current-workgroup))) ;;;###autoload (defun narf/get-visible-buffers (&optional buffer-list) diff --git a/core/lib/defuns-editor.el b/core/lib/defuns-editor.el index a39ab6250..1c03dc360 100644 --- a/core/lib/defuns-editor.el +++ b/core/lib/defuns-editor.el @@ -39,16 +39,5 @@ (beginning-of-line)) (setq *linum-mdown-line* nil)))) -;;;###autoload (autoload 'narf:align "defuns-editor" nil t) -(evil-define-operator narf:align (&optional beg end bang pattern) - (interactive "") - (align-regexp - beg end - (concat "\\(\\s-*\\)" - (if bang - (regexp-quote pattern) - (rxt-pcre-to-elisp pattern))) - 1 1)) - (provide 'defuns-editor) ;;; defuns-editor.el ends here diff --git a/core/lib/defuns-helm.el b/core/lib/defuns-helm.el index 0e5a5116e..373301256 100644 --- a/core/lib/defuns-helm.el +++ b/core/lib/defuns-helm.el @@ -82,6 +82,7 @@ (defun narf/helm-buffers-dwim (&optional all-p) "Displays open buffers in current project. If ALL-P, then show all open buffers." + (interactive) (if (and (not all-p) (narf/project-p)) (helm-projectile-switch-to-buffer) (helm-buffers-list))) diff --git a/core/lib/defuns-spaceline.el b/core/lib/defuns-spaceline.el index ea54f14e4..8a5acfd03 100644 --- a/core/lib/defuns-spaceline.el +++ b/core/lib/defuns-spaceline.el @@ -3,11 +3,11 @@ ;;;###autoload (defun narf|spaceline-env-update () (when narf--env-command - (let* ((command (format "cd '%s' && %s" (narf/project-root) narf--env-command)) - (s (shell-command-to-string command))) - (setq narf--env-version (if (string-match "[ \t\n\r]+\\'" s) - (replace-match "" t t s) - s))))) + (let ((default-directory (narf/project-root))) + (let ((s (shell-command-to-string narf--env-command))) + (setq narf--env-version (if (string-match "[ \t\n\r]+\\'" s) + (replace-match "" t t s) + s)))))) (provide 'defuns-spaceline) ;;; defuns-spaceline.el ends here diff --git a/core/lib/defuns-workgroup.el b/core/lib/defuns-workgroup.el index 5cb1391e7..020228017 100644 --- a/core/lib/defuns-workgroup.el +++ b/core/lib/defuns-workgroup.el @@ -14,7 +14,9 @@ (defun narf/wg-projectile-switch-project () (let ((workgroup-name (file-name-nondirectory (directory-file-name (narf/project-root))))) (wg-create-workgroup workgroup-name t) - (helm-projectile-find-file))) + (helm-projectile-find-file) + ;; TODO narf/workgroup-display? + )) ;;;###autoload (autoload 'narf:save-session "defuns-workgroup" nil t) (evil-define-command narf:save-session (&optional bang session-name) @@ -41,14 +43,23 @@ (wg-clone-workgroup (wg-current-workgroup) name) (wg-create-workgroup name t)) (unless silent - (narf/workgroup-display (wg-previous-workgroup)))) + (narf--workgroup-display (wg-previous-workgroup) + (format "Created %s" name) + 'success))) ;;;###autoload (autoload 'narf:workgroup-rename "defuns-workgroup" nil t) -(evil-define-command narf:workgroup-rename (new-name) - (interactive "") - (let ((wg (wg-current-workgroup))) - (wg-rename-workgroup new-name wg) - (add-to-list 'narf-wg-names wg))) +(evil-define-command narf:workgroup-rename (bang &optional new-name) + (interactive "") + (let* ((wg (wg-current-workgroup)) + (wg-uid (wg-workgroup-uid wg)) + (old-name (wg-workgroup-name wg))) + (if bang + (setq narf-wg-names (delete wg-uid narf-wg-names)) + (unless new-name + (user-error "You didn't enter in a name")) + (wg-rename-workgroup new-name wg) + (add-to-list 'narf-wg-names wg-uid) + (narf--workgroup-display wg (format "Renamed '%s'->'%s'" old-name new-name) 'success)))) ;;;###autoload (autoload 'narf:workgroup-delete "defuns-workgroup" nil t) (evil-define-command narf:workgroup-delete (&optional bang name) @@ -61,7 +72,7 @@ (if (eq wg current-wg) (wg-kill-workgroup) (wg-delete-workgroup wg)) - (message "%s [Deleted %s]" (narf/workgroup-display nil t) wg-name)))) + (narf--workgroup-display nil (format "Deleted %s" wg-name) 'success)))) ;;;###autoload (defun narf:kill-other-workgroups () @@ -72,6 +83,24 @@ (unless (wg-current-workgroup-p w) (wg-kill-workgroup w))))) +(defun narf--num-to-unicode (num) + "Return a nice unicode representation of a single-digit number STR." + (cl-case num + (1 "➊") + (2 "➋") + (3 "➌") + (4 "➍") + (5 "➎") + (6 "❻") + (7 "➐") + (8 "➑") + (9 "➒") + (0 "➓"))) + +(defun narf--workgroup-display (&optional suppress-update message message-face) + (message "%s%s" (narf/workgroup-display suppress-update t) + (propertize message 'face message-face))) + ;;;###autoload (defun narf/workgroup-display (&optional suppress-update return-p) (interactive) @@ -83,7 +112,7 @@ (if (not workgroup) wg-nowg-string (wg-element-display workgroup - (format " (%d) %s " (1+ index) (wg-workgroup-name workgroup)) + (format " %s %s " (narf--num-to-unicode (1+ index)) (wg-workgroup-name workgroup)) 'wg-current-workgroup-p))) (wg-workgroup-list)))) (if return-p @@ -99,23 +128,24 @@ (base (f-filename (buffer-file-name)))) (unless (string= base old-name) (wg-rename-workgroup base wg))))))) -;; (advice-add 'select-window :after 'narf|workgroup-update-name) ;;;###autoload (autoload 'narf:switch-to-workgroup-left "defuns-workgroup" nil t) (evil-define-command narf:switch-to-workgroup-left (count) (interactive "") + (narf/workgroup-update-names) (if count (wg-switch-to-workgroup-at-index (1- count)) (wg-switch-to-workgroup-left)) - (narf/workgroup-display (wg-previous-workgroup))) + (narf/workgroup-display t)) ;;;###autoload (autoload 'narf:switch-to-workgroup-right "defuns-workgroup" nil t) (evil-define-command narf:switch-to-workgroup-right (count) (interactive "") + (narf/workgroup-update-names) (if count (wg-switch-to-workgroup-at-index (1- count)) (wg-switch-to-workgroup-right)) - (narf/workgroup-display (wg-previous-workgroup))) + (narf/workgroup-display t)) ;;;###autoload (defun narf:switch-to-workgroup-at-index (index) diff --git a/init.el b/init.el index 259856ae1..34b195b27 100644 --- a/init.el +++ b/init.el @@ -2,7 +2,7 @@ ;; ;; Author: Henrik Lissner ;; URL: https://github.com/hlissner/emacs.d -;; Version: 0.6.0 +;; Version: 0.7.0 ;; ;;; Are you pondering what I'm pondering, Pinky? ;; @@ -41,7 +41,7 @@ ;;; License: GPLv3 (defconst narf-theme 'narf-dark) -(defconst narf-default-font (font-spec :family "Hack" :size 12)) +(defconst narf-default-font (font-spec :family "Terminus (TTF)" :size 12 :antialias nil)) (defconst narf-writing-font (font-spec :family "Hack" :size 14)) (defconst narf-big-font (font-spec :family "Inconsolata" :size 20)) diff --git a/modules/lib/defuns-org.el b/modules/lib/defuns-org.el index 295980753..0c8d5c721 100644 --- a/modules/lib/defuns-org.el +++ b/modules/lib/defuns-org.el @@ -1,5 +1,10 @@ ;;; defuns-org.el +;;;###autoload +(defun narf/org-open-notes () + (interactive) + (find-file org-default-notes-file)) + ;;;###autoload (defun narf/org-insert-item (direction) "Inserts a new heading or item, depending on the context." diff --git a/modules/module-lisp.el b/modules/module-lisp.el index 5277dc5dd..29760a55d 100644 --- a/modules/module-lisp.el +++ b/modules/module-lisp.el @@ -17,9 +17,36 @@ (add-hook 'before-save-hook 'delete-trailing-whitespace nil t) (add-hook 'after-save-hook 'narf-elisp-auto-compile nil t) - (add-to-list 'imenu-generic-expression - '("Package" - "\\(^\\s-*(use-package +\\)\\(\\_<.+\\_>\\)" 2))) + (let ((header-face 'font-lock-constant-face)) + (add-to-list 'imenu-generic-expression + `("Package" "\\(^\\s-*(use-package +\\)\\(\\_<.+\\_>\\)" 2)) + (add-to-list 'imenu-generic-expression + `("Spaceline Segment" "\\(^\\s-*(spaceline-define-segment +\\)\\(\\_<.+\\_>\\)" 2)))) + +;; Add new colors to helm-imenu +(after! helm-imenu + (defun helm-imenu-transformer (candidates) + (cl-loop for (k . v) in candidates + for types = (or (helm-imenu--get-prop k) + (list "Function" k)) + for bufname = (buffer-name (marker-buffer v)) + for disp1 = (mapconcat + (lambda (x) + (propertize + x 'face (cond ((string= x "Variables") + 'font-lock-variable-name-face) + ((string= x "Function") + 'font-lock-function-name-face) + ((string= x "Types") + 'font-lock-type-face) + ((string= x "Package") + 'font-lock-negation-char-face) + ((string= x "Spaceline Segment") + 'font-lock-string-face)))) + types helm-imenu-delimiter) + for disp = (propertize disp1 'help-echo bufname) + collect + (cons disp (cons k v))))) (font-lock-add-keywords 'emacs-lisp-mode `(("\\(lambda\\)" (0 (narf/show-as ?λ))))) diff --git a/modules/module-org.el b/modules/module-org.el index da1e9ed38..9e47e0d4c 100644 --- a/modules/module-org.el +++ b/modules/module-org.el @@ -12,25 +12,32 @@ (defvar org-directory-projects (expand-file-name "my/projects/" org-directory)) (defvar org-directory-invoices (expand-file-name "my/invoices/" org-directory)) +(defvar org-default-notes-file (concat org-directory "notes.org")) + (add-hook! org-load 'narf|org-init) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun narf@org-vars () - (setq org-default-notes-file (concat org-directory "notes.org") - org-agenda-files - (f-entries org-directory (lambda (path) (f-ext? path "org")) t) + (setq org-agenda-files + (f-entries org-directory (lambda (path) (string-suffix-p ".org" path)) t) org-archive-location (concat org-directory "/archive/%s::") org-attach-directory ".attach/" - ;; org-mobile-inbox-for-pull (concat org-directory "inbox.org") + ;; org-mobile-inbox-for-pull (concat org-directory "notes.org") ;; org-mobile-directory "~/Dropbox/Apps/MobileOrg" + ;; Use helm for refiling + org-completion-use-ido nil + org-refile-targets '((nil . (:maxlevel . 2))) + ;; display full path in refile completion + org-refile-use-outline-path t + org-outline-path-complete-in-steps nil + org-default-priority ?C org-catch-invisible-edits nil org-confirm-elisp-link-function nil - org-completion-use-ido t org-hidden-keywords '(title) org-special-ctrl-a/e t org-hierarchical-todo-statistics t @@ -44,7 +51,8 @@ org-src-window-setup 'current-window org-startup-folded 'content org-todo-keywords '((sequence "TODO(t)" "|" "DONE(d)") - (sequence "LEAD(l)" "NEXT(n)" "ACTIVE(a)" "PENDING(p)" "|" "CANCELLED(c)")) + (sequence "IDEA(i)" "NEXT(n)" "ACTIVE(a)" "WAITING(w)" "LATER(l)" "|" "CANCELLED(c)") + (sequence "UNSENT(u)" "UNPAID(U)" "|" "PAID(p)")) org-blank-before-new-entry '((heading . nil) (plain-list-item . auto)) @@ -54,8 +62,8 @@ org-capture-templates '(("t" "TODO" entry - (file+headline (concat org-directory "todo.org") "Inbox") - "** TODO %? %u") + (file+headline (concat org-directory "notes.org") "Unsorted") + "*** TODO %? %u") ;; TODO Select file from org files ;; ("T" "Specific TODO" entry @@ -72,7 +80,7 @@ ;; TODO Select file from notes folder ("n" "Notes" entry - (file+headline (concat org-directory "notes.org") "Inbox") + (file+headline (concat org-directory "notes.org") "Unsorted") "* %u %?\n%i" :prepend t) ("s" "Writing Scraps" entry @@ -85,11 +93,11 @@ "** %i%?\n") ("e" "Excerpt" entry - (file+headline (concat org-directory "notes/excerpts.org") "Unsorted") + (file+headline (concat org-directory "notes/excerpts.org") "Excerpts") "** %u %?\n%i" :prepend t) ("q" "Quote" item - (file (concat org-directory "notes/quotes.org")) + (file+headline (concat org-directory "notes/excerpts.org") "Quotes") "+ %i\n *Source: ...*\n : @tags" :prepend t) )) @@ -199,16 +207,18 @@ will function properly." org-latex-preview-ltxpng-directory (concat narf-temp-dir "ltxpng/") org-latex-remove-logfiles t org-latex-create-formula-image-program 'dvipng - org-startup-with-latex-preview t + org-startup-with-latex-preview nil org-highlight-latex-and-related '(latex) + org-format-latex-options (plist-put org-format-latex-options :scale 1.4) + org-latex-image-default-width nil org-latex-packages-alist - '(("" "gauss" t))) - - (plist-put org-format-latex-options :scale 1.1)) + '(("" "gauss" t) + ;; ("" "physics" t) TODO Install this + ))) (defun narf@org-looks () (setq org-image-actual-width nil - org-startup-with-inline-images t + org-startup-with-inline-images nil org-startup-indented t org-pretty-entities t org-pretty-entities-include-sub-superscripts t @@ -221,7 +231,7 @@ will function properly." org-cycle-separator-lines 2 org-hide-emphasis-markers t org-hide-leading-stars t - org-bullets-bullet-list '("✸" "•" "◦" "•" "◦" "•" "◦") + org-bullets-bullet-list '("•" "◦" "•" "◦" "•" "◦") org-entities-user '(("flat" "\\flat" nil "" "" "266D" "♭") ("sharp" "\\sharp" nil "" "" "266F" "♯")) @@ -230,6 +240,8 @@ will function properly." '((?A . org-todo-vhigh) (?B . org-todo-high))) + (add-hook! org-mode + (highlight-regexp org-any-link-re 'org-link)) ;; Restore org-block-background face (removed in official org) (defface org-block-background '((t ())) @@ -258,46 +270,32 @@ will function properly." ("^ *\\(#\\+end_src\\>\\)" (1 (narf/show-as ?#))) ("^ *\\(#\\+begin_quote\\>\\)" - (1 (narf/show-as ?\"))) + (1 (narf/show-as ?>))) ("^ *\\(#\\+end_quote\\>\\)" - (1 (narf/show-as ?\"))) + (1 (narf/show-as ?>))) ;; Hide TODO tags ("^\\**\\(\\* DONE\\) \\([^$\n\r]+\\)" (1 (narf/show-as ?☑)) - (1 'org-todo-checkbox) (2 'org-headline-done)) - ("^\\**\\(\\* TODO\\) \\([^$\n\r]+\\)?" - (1 (narf/show-as ?☐)) - (1 'org-todo-checkbox)) + ("^\\**\\(\\* \\(TODO\\|PAID\\)\\) " + (1 (narf/show-as ?☐))) - ;; Unbold-ify todos - (,(concat "^\\**\\(\\* " - (regexp-opt '("TODO" "LEAD" "NEXT" "ACTIVE" "PENDING" "CANCELLED")) - "\\)\\( [^$\n\r]*\\)?") - (2 'org-headline-todo)) + ;; ("[-+*] \\(\\[X\\]\\) \\([^$\n\r]+\\)" + ;; (2 'org-headline-done)) - ;; ("[-+*] \\(\\[ \\]\\) " - ;; (1 'org-whitespace)) - ;; ("[-+*] \\(\\[-\\]\\) " - ;; (1 'org-whitespace)) - ("[-+*] \\(\\[X\\]\\) \\([^$\n\r]+\\)" - ;; (1 'org-whitespace) - (2 'org-headline-done)) + ("[-+*] \\[X\\] \\([^$\n\r]+\\)" + (1 'org-headline-done)) ;; Show checkbox for other todo states (but don't hide the label) (,(concat "\\(\\*\\) " - (regexp-opt '("LEAD" "NEXT" "ACTIVE" "PENDING" "CANCELLED") t) + (regexp-opt '("IDEA" "NEXT" "ACTIVE" "WAITING" "LATER" "CANCELLED" "UNPAID" "UNSENT") t) " ") (1 (narf/show-as ?☐))) - ("^ *\\([-+]\\|[0-9]+[).]\\)\\( \\)+[^$\n\r]+" + ("^ *\\([-+]\\|[0-9]+[).]\\)\\( \\)+[^$\n\r]" (1 'org-list-bullet)) - ("^ +\\(\\*\\) " - (1 (narf/show-as ?◦))) - ;; ("^ +" - ;; (0 'org-whitespace)) ))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -306,11 +304,15 @@ will function properly." (evil-org-mode +1) (org-bullets-mode +1) (org-indent-mode +1) - (text-scale-set 1) + ;; (text-scale-set 1) + + ;; Org-specific font. See `narf-writing-font' + (setq buffer-face-mode-face `(:family ,(symbol-name (font-get narf-writing-font :family)))) + (buffer-face-mode +1) (narf|enable-tab-width-2) (setq truncate-lines nil) - (setq line-spacing '0.2) + (setq line-spacing '2) (defun narf|org-update-statistics-cookies () (when (file-exists-p buffer-file-name) @@ -347,11 +349,23 @@ will function properly." (add-hook 'org-mode-hook 'narf|org-hook) + ;; Don't track attachments + (push (format "/%s.+$" (regexp-quote org-attach-directory)) recentf-exclude) + + ;; Enable encryption + (require 'epa-file) + (epa-file-enable) + (require 'org-crypt) + (org-crypt-use-before-save-magic) + (setq org-tags-exclude-from-inheritance '("crypt")) + (setq org-crypt-key user-mail-address) + (setq epa-file-encrypt-to user-mail-address) + + ;; Custom links (org-add-link-type "contact" 'narf/org-crm-link-contact) (org-add-link-type "project" 'narf/org-crm-link-project) (org-add-link-type "invoice" 'narf/org-crm-link-invoice) - (add-to-list 'recentf-exclude (expand-file-name "%s.+\\.org$" org-directory)) (after! helm (mapc (lambda (r) (add-to-list 'helm-boring-file-regexp-list r)) (list "\\.attach$" "\\.Rhistory$"))) @@ -364,7 +378,7 @@ will function properly." (make-variable-buffer-local 'yas-trigger-key) (setq yas/trigger-key [tab]) (add-to-list 'org-tab-first-hook 'yas/org-very-safe-expand) - (define-key yas/keymap [tab] 'yas-next-field)) + (define-key yas-keymap [tab] 'yas-next-field)) ;;; Evil integration (progn @@ -383,8 +397,10 @@ will function properly." (setq-default org-download-image-dir ".attach" org-download-heading-lvl nil - org-download-timestamp "_%Y%m%d_%H%M%S" - org-download-screenshot-method "screencapture -i %s") + org-download-timestamp "_%Y%m%d_%H%M%S") + + (when IS-MAC + (setq org-download-screenshot-method "screencapture -i %s")) (defun org-download--dir-2 () (f-base (buffer-file-name))) @@ -465,6 +481,7 @@ will function properly." :n "L" 'org-store-link :n "x" 'narf/org-remove-link :n "w" 'writing-mode + :n "v" 'variable-pitch-mode :n "SPC" 'narf/org-toggle-checkbox :n "RET" 'org-archive-subtree @@ -476,22 +493,25 @@ will function properly." :n "i" 'narf/org-toggle-inline-images-at-point :n "t" (λ (org-todo (if (org-entry-is-todo-p) 'none 'todo))) :n "T" 'org-todo - :n "r" 'org-refile :n "s" 'org-schedule + :n "r" 'org-refile + :n "R" (λ (org-metaleft) (org-archive-to-archive-sibling)) ; archive to parent sibling :n "op" 'narf/org-open-project-at-pt :n "oc" 'narf/org-open-contact-at-pt :n "oi" 'narf/org-open-invoice-at-pt ) + ;; TODO Improve folding bindings :n "za" 'org-cycle :n "zA" 'org-shifttab - :n "zm" 'hide-body - :n "zr" 'show-all - :n "zo" 'show-subtree - :n "zO" 'show-all - :n "zc" 'hide-subtree - :n "zC" 'hide-all + :n "zm" (λ (outline-hide-sublevels 1)) + :n "zr" 'outline-show-all + :n "zo" 'outline-show-subtree + :n "zO" 'outline-show-all + :n "zc" 'outline-hide-subtree + :n "zC" (λ (outline-hide-sublevels 1)) + :n "zd" (lambda (&optional arg) (interactive "p") (outline-hide-sublevels (or arg 3))) :m "]]" (λ (call-interactively 'org-forward-heading-same-level) (org-beginning-of-line)) :m "[[" (λ (call-interactively 'org-backward-heading-same-level) (org-beginning-of-line)) @@ -577,6 +597,7 @@ will function properly." (cond ((and lang (not (string= lang "")) org-src-fontify-natively) (org-src-font-lock-fontify-block lang block-start block-end) + ;;;;;;; EDIT ;; remove old background overlays (mapc (lambda (ov) (if (eq (overlay-get ov 'face) 'org-block-background) @@ -587,6 +608,7 @@ will function properly." (overlay-put ovl 'face 'org-block-background) (overlay-put ovl 'evaporate t)) ; make it go away when empty ;; (add-text-properties beg1 block-end '(src-block t))) + ;;;;;;; /EDIT (quoting (add-text-properties beg1 (min (point-max) (1+ end1)) '(face org-block))) ; end of source block diff --git a/modules/module-python.el b/modules/module-python.el index 6a2cc2587..a7bbc9404 100644 --- a/modules/module-python.el +++ b/modules/module-python.el @@ -11,7 +11,7 @@ python-environment-directory narf-temp-dir python-shell-interpreter "ipython") :config - (define-env-command! python-mode "python --version | cut -d' ' -f2") + (define-env-command! python-mode "python --version 2>&1 | cut -d' ' -f2") (define-repl! python-mode narf-inf-python) (defun narf-inf-python () diff --git a/modules/module-writing.el b/modules/module-writing.el index f74b56c6f..d3a65b959 100644 --- a/modules/module-writing.el +++ b/modules/module-writing.el @@ -35,10 +35,9 @@ (setq mode-line-format (if mode-p '("%e" (:eval (spaceline--prepare - '(narf-anzu narf-iedit narf-evil-substitute + '("[W]" narf-anzu narf-iedit narf-evil-substitute (narf-buffer-path remote-host) - narf-buffer-modified - "✎") + narf-buffer-modified) '((selection-info :face highlight-face :skip-alternate t) narf-hud )))) diff --git a/private/my-bindings.el b/private/my-bindings.el index 6f8f679f9..395f14d8f 100644 --- a/private/my-bindings.el +++ b/private/my-bindings.el @@ -29,6 +29,7 @@ "M-b" 'narf:build "M-t" 'narf:workgroup-new + "M-T" 'narf/workgroup-display "A-`" 'narf-switch-to-iterm "C-`" 'popwin:messages "C-~" 'rtog/toggle-repl @@ -117,7 +118,12 @@ :n "e" 'narf/flycheck-errors :n "s" 'yas-visit-snippet-file :n "S" 'narf/yas-find-file - :n "d" 'narf/vcs-show-hunk + :n "D" 'vc-annotate + (:prefix "d" + :n "." 'narf/vcs-show-hunk + :n "/" 'vc-diff + :n "s" 'narf/vcs-stage-hunk + :n "r" 'narf/vcs-revert-hunk) :n "b" 'helm-bookmarks :n "w" 'narf/workgroup-display @@ -147,7 +153,7 @@ (:prefix "o" :n "o" 'os-open-in-default-program :n "p" 'os-reveal-project - :n "b" 'os-open-in-chrome + :n "b" 'os-open-in-browser :n "u" 'os-upload :n "U" 'os-upload-folder :n "l" 'os-send-to-launchbar diff --git a/private/my-commands.el b/private/my-commands.el index 55d14ba9e..e97d3e243 100644 --- a/private/my-commands.el +++ b/private/my-commands.el @@ -1,64 +1,72 @@ ;;; my-commands.el -(defalias 'exmap 'evil-ex-define-cmd) -(defalias 'exmap! 'evil-ex-define-cmd-local) - -(exmap "a" 'helm-projectile-find-other-file) +;; Emacs utilities (exmap "acomp[ile]" 'narf:compile-autoloads) -(exmap "ag" 'narf:helm-ag-search) -(exmap "ag[cw]d" 'narf:helm-ag-search-cwd) -(exmap "agr" 'narf:helm-ag-regex-search) -(exmap "agr[cw]d" 'narf:helm-ag-regex-search-cwd) -(exmap "al[ign]" 'narf:align) -(exmap "wal[ign]" 'narf:whitespace-align) (exmap "bcomp[ile]" 'narf:compile-el) -(exmap "big" 'narf:toggle-big-mode) -(exmap "cap[ture]" 'helm-org-capture-templates) -(exmap "cd" 'narf:cd) -(exmap "dash" 'dash-at-point) (exmap "echo" 'narf:echo) + +;; Editing +(exmap "@" 'narf/evil-macro-on-all-lines) +(exmap "al[ign]" 'narf:align) (exmap "en[ew]" 'narf:file-create) -(exmap "fi[nd]" 'narf:helm-swoop) -(exmap "full[scr]" 'narf:toggle-fullscreen) -(exmap "fullw[rite]" 'narf:toggle-write-mode) +(exmap "na[rrow]" 'narf:narrow) ; Narrow buffer to selection +(exmap "ref[actor]" 'emr-show-refactor-menu) +(exmap "retab" 'narf:whitespace-retab) +(exmap "settr[im]" 'narf:toggle-delete-trailing-whitespace) +(exmap "snip[pets]" 'narf:yas-snippets) ; snip[!] +(exmap "tsnip[pets]" 'narf:yas-file-templates) ; tsnip[!] +(exmap "wal[ign]" 'narf:whitespace-align) +(exmap "rec[ent]" 'narf:helm-recentf) + +;; External resources +(exmap "dash" 'dash-at-point) (exmap "http" 'httpd-start) -(exmap "ini" 'narf:ido-find-file-in-emacsd) +(exmap "re[gex]" 'narf:regex) +(exmap "repl" 'narf:repl) +(exmap "t[mux]" 'narf:send-to-tmux) +(exmap "t[mux]s" 'narf/tmux-split-window) +(exmap "t[mux]v" (λ (narf/tmux-split-window t))) +(exmap "t[mux]w" 'narf/tmux-new-window) +(exmap "tcd" 'narf:tmux-cd) +(exmap "x" 'narf:scratch-buffer) +;; GIT +(exmap "git[hub]" 'narf:github-browse-file) + +;; Dealing with buffers (exmap "k[ill]" 'kill-this-buffer) ; Kill current buffer (exmap "k[ill]all" 'narf:kill-all-buffers) ; Kill all buffers (bang = in project) (exmap "k[ill]buried" 'narf:kill-buried-buffers) ; Kill all buried buffers (bang = in project) (exmap "k[ill]o" 'narf:kill-unreal-buffers) (exmap "l[ast]" 'narf:popup-last-buffer) (exmap "m[sg]" 'narf:popup-messages) + +;; Project navigation +(exmap "a" 'helm-projectile-find-other-file) +(exmap "ag" 'narf:helm-ag-search) +(exmap "ag[cw]d" 'narf:helm-ag-search-cwd) +(exmap "agr" 'narf:helm-ag-regex-search) +(exmap "agr[cw]d" 'narf:helm-ag-regex-search-cwd) +(exmap "cd" 'narf:cd) +(exmap "fi[nd]" 'narf:helm-swoop) +;; Project tools (exmap "ma[ke]" 'narf:build) +;; File operations (exmap "mv" 'narf:file-move) -(exmap "na[rrow]" 'narf:narrow) ; Narrow buffer to selection -(exmap "org" 'narf/helm-org) -(exmap "repl" 'narf:repl) -(exmap "proj[ect]" 'helm-projectile-switch-project) -(exmap "rec[ent]" 'narf:helm-recentf) -(exmap "re[gex]" 'narf:regex) -(exmap "ref[actor]" 'emr-show-refactor-menu) -(exmap "retab" 'narf:whitespace-retab) (exmap "rm" 'narf:file-delete) ; rm[!] -(exmap "settr[im]" 'narf:toggle-delete-trailing-whitespace) -(exmap "snip[pets]" 'narf:yas-snippets) ; snip[!] -(exmap "tsnip[pets]" 'narf:yas-file-templates) ; tsnip[!] -(exmap "x" 'narf:scratch-buffer) -(exmap "@" 'narf/evil-macro-on-all-lines) -(exmap "t[mux]" 'narf:send-to-tmux) -(exmap "t[mux]w" 'narf/tmux-new-window) -(exmap "t[mux]s" 'narf/tmux-split-window) -(exmap "t[mux]v" (λ (narf/tmux-split-window t))) -(exmap "tcd" 'narf:tmux-cd) +;; Presentation/demo +(exmap "big" 'narf:toggle-big-mode) +(exmap "full[scr]" 'narf:toggle-fullscreen) +(exmap "fullw[rite]" 'narf:toggle-write-mode) +;; Org-mode +(exmap "cap[ture]" 'helm-org-capture-templates) +(exmap "org" 'narf/helm-org) (exmap "cont[act]" 'narf:org-crm-contact) (exmap "proj[ect]" 'narf:org-crm-project) (exmap "invo[ice]" 'narf:org-crm-invoice) -;; GIT -(exmap "bl[ame]" 'narf:github-browse-file) - +;; Plugins (after! flycheck (exmap "er[rors]" (λ (flycheck-buffer) (flycheck-list-errors)))) diff --git a/private/snippets b/private/snippets index 26750d3e7..de19d3918 160000 --- a/private/snippets +++ b/private/snippets @@ -1 +1 @@ -Subproject commit 26750d3e73761e7b418f3038236c46359cc05735 +Subproject commit de19d3918bbdccb00fa2dc900b80cd3c47c502b4 diff --git a/private/templates/org-mode/__contact.org b/private/templates/org-mode/__contact.org index 4637a52fd..b34624778 100644 --- a/private/templates/org-mode/__contact.org +++ b/private/templates/org-mode/__contact.org @@ -1,12 +1,11 @@ -#+TITLE:${1:Contact Name}${2: 🏢} -#+begin_src yaml -created: `(format-time-string "%Y-%m-%d")` +#+TITLE:${1:Contact Name} +#+DATE: `(format-time-string "%Y-%m-%d")` +#+EMAIL: ${2:email@address.com} +#+ADDRESS: $3 +#+CITY: $4 +#+COUNTRY: $5 -email: ${3:email@address.com} -address: $4 -city: $5 -country: $6 -#+end_src +${0:...} * Associates + Associate's name :: associates@email.com diff --git a/private/templates/org-mode/__invoice.org b/private/templates/org-mode/__invoice.org index d7f3102e5..f0241c66c 100644 --- a/private/templates/org-mode/__invoice.org +++ b/private/templates/org-mode/__invoice.org @@ -1,18 +1,21 @@ #+TITLE:${1:1234-5678} -#+begin_src yaml -created: `(format-time-string "%Y-%m-%d")` -issued: `(format-time-string "%Y-%m-%d")` -currency: ${2:CAD|USD|GBP|DKK} -contact: ${3:email address} +#+DATE: `(format-time-string "%Y-%m-%d")` +#+ISSUED: ${2:`(format-time-string "%Y-%m-%d")`} +#+PAID: ${3:`(format-time-string "%Y-%m-%d")`} +#+CURRENCY: ${4:CAD|USD|DKK|GBP} +#+CONTACT: ${5:Contact ID} +#+PROJECT: ${6:Project ID} -items: - - title: "$4" - body: "$5" - qty: ${6:1} - amount: ${7:1200.00} +| *Description* | *qty* | *rate* | *total* | +|----------------------------------------------+-----+--------+-------| +| $0 [1] | | | | +|----------------------------------------------+-----+--------+-------| +| | | | | +#+TBLFM: $4=$2+$3::@>$4=vsum(@2..@-1) -comments: "$0" -#+end_src +[1] ... +* Comments +... * Notes -* Attachments [0/0] \ No newline at end of file +** Attachments [0/0] \ No newline at end of file diff --git a/private/templates/org-mode/__project.org b/private/templates/org-mode/__project.org index 8139d5548..195aa7a52 100644 --- a/private/templates/org-mode/__project.org +++ b/private/templates/org-mode/__project.org @@ -1,8 +1,6 @@ #+TITLE:${1:Project Name} -#+begin_src yaml -created: `(format-time-string "%Y-%m-%d")` -contact: ${2:Contact id} -#+end_src +#+DATE: `(format-time-string "%Y-%m-%d")` +#+CONTACT: ${2:Contact name/id} ${3:Summary of project.} diff --git a/private/themes/narf/narf-dark-theme.el b/private/themes/narf/narf-dark-theme.el index ce10ba6a2..9ec1052e9 100644 --- a/private/themes/narf/narf-dark-theme.el +++ b/private/themes/narf/narf-dark-theme.el @@ -5,8 +5,30 @@ (custom-theme-set-variables 'narf-dark) +;; Color helper functions +;; Shamelessly *borrowed* from solarized +(defun --color-name-to-rgb (color &optional frame) + (let ((valmax (float (car (color-values "#ffffff"))))) + (mapcar (lambda (x) (/ x valmax)) (color-values color frame)))) + +(defun --color-rgb-to-hex (red green blue) + (format "#%02x%02x%02x" + (* red 255) (* green 255) (* blue 255))) + +(defun --color-blend (color1 color2 alpha) + (apply '--color-rgb-to-hex + (-zip-with '(lambda (it other) + (+ (* alpha it) (* other (- 1 alpha)))) + (--color-name-to-rgb color1) + (--color-name-to-rgb color2)))) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + (let* ((c '((class color))) + ;; Global bold flag + (bold t) + (bg "#1E2021") (fg "#D6D6D4") (subtle "#aab6c7") @@ -57,10 +79,11 @@ (error-highlight red) (linum-bg current-line) - (linum-fg grey-1) + (linum-fg "#383840") (linum-hl-fg orange) (linum-hl-bg current-line) + (active-minibuffer "#404046") (modeline-fg white) (modeline-fg-2 orange) (modeline-fg-3 orange) @@ -90,13 +113,15 @@ ;; `(match ((,c (:background ,magenta)))) `(minibuffer-prompt ((,c (:foreground ,orange)))) - `(error ((,c (:foreground ,red :bold t)))) - `(warning ((,c (:foreground ,yellow :bold t)))) - `(success ((,c (:foreground ,green :bold t)))) + `(error ((,c (:foreground ,red )))) + `(warning ((,c (:foreground ,yellow)))) + `(success ((,c (:foreground ,green )))) - `(spaceline-flycheck-error ((,c (:bold t :foreground ,red)))) - `(spaceline-flycheck-warning ((,c (:bold t :foreground ,yellow)))) - `(spaceline-flycheck-info ((,c (:bold t :foreground ,green)))) + `(spaceline-flycheck-error ((,c (:underline nil :foreground ,black :background ,red)))) + `(spaceline-flycheck-warning ((,c (:underline nil :foreground ,black :background ,yellow)))) + `(spaceline-flycheck-info ((,c (:underline nil :foreground ,black :background ,green)))) + `(flyspell-incorrect ((,c (:underline (:style wave :color ,error-highlight) + :inherit unspecified)))) `(hs-face ((,c (:foreground ,comments :background ,black)))) `(hs-fringe-face ((,c (:foreground ,orange)))) @@ -129,47 +154,50 @@ `(vertical-border ((,c (:foreground ,vertical-bar :background ,vertical-bar)))) - ;; `(linum ((,c (:foreground ,linum-fg :bold nil :height 0.9)))) - `(linum ((,c (:foreground ,linum-fg :bold nil :height 0.8)))) - `(linum-highlight-face ((,c (:inherit linum :bold t :foreground ,linum-hl-fg)))) - `(show-paren-match ((,c (:foreground ,magenta :bold t :inverse-video t)))) + ;; `(linum ((,c (:foreground ,linum-fg :bold nil :height 0.8)))) + `(linum ((,c (:foreground ,linum-fg :bold nil)))) + `(linum-highlight-face ((,c (:inherit linum :foreground ,linum-hl-fg)))) + `(show-paren-match ((,c (:foreground ,magenta :bold ,bold :inverse-video t)))) ;; Modeline - `(mode-line ((,c (:foreground ,modeline-fg :background ,modeline-bg)))) - `(mode-line-inactive ((,c (:foreground ,modeline-fg-inactive :background ,modeline-bg-inactive)))) - `(mode-line-is-modified ((,c (:foreground ,magenta :bold t)))) + `(narf-minibuffer-active ((,c (:background ,active-minibuffer)))) + `(mode-line ((,c (:foreground ,modeline-fg :background ,modeline-bg + :box (:line-width 2 :color ,modeline-bg))))) + `(mode-line-inactive ((,c (:foreground ,modeline-fg-inactive :background ,modeline-bg-inactive + :box (:line-width 2 :color ,modeline-bg-inactive))))) + + `(mode-line-is-modified ((,c (:foreground ,magenta)))) `(mode-line-buffer-file ((,c (:foreground ,modeline-fg)))) `(powerline-active1 ((,c (:foreground ,modeline-fg-2 :background ,modeline-bg-2)))) `(powerline-active2 ((,c (:foreground ,modeline-fg-3 :background ,modeline-bg-3)))) `(powerline-inactive1 ((,c (:foreground ,modeline-fg-inactive)))) `(powerline-inactive2 ((,c (:foreground ,modeline-fg-inactive)))) - `(spaceline-highlight-face ((,c (:foreground ,black :background ,highlight :bold t)))) - `(mode-line-count-face ((,c (:foreground ,black :background ,magenta :bold t)))) + `(spaceline-highlight-face ((,c (:foreground ,black :background ,highlight :bold ,bold)))) + `(mode-line-count-face ((,c (:foreground ,black :background ,magenta :bold ,bold)))) ;; Search `(isearch ((,c (:foreground ,search-fg :background ,search-bg)))) `(isearch-lazy-highlight-face ((,c (:foreground ,search-rest-fg :background ,search-rest-bg)))) - `(narf-todo-face ((,c (:foreground ,yellow :bold t)))) - `(narf-fixme-face ((,c (:foreground ,red :bold t)))) - `(narf-note-face ((,c (:foreground ,cyan :bold t)))) + `(narf-todo-face ((,c (:foreground ,yellow)))) + `(narf-fixme-face ((,c (:foreground ,red)))) + `(narf-note-face ((,c (:foreground ,cyan)))) - `(evil-ex-substitute-replacement ((,c (:foreground ,magenta :background ,black :bold t)))) + `(evil-ex-substitute-replacement ((,c (:foreground ,magenta :background ,black :bold ,bold)))) `(evil-search-highlight-persist-highlight-face ((,c (:background ,search-rest-bg)))) - ;; plugin-specific ;; ***************************************************************************************** `(yascroll:thumb-fringe ((,c (:background ,grey-1 :foreground ,grey-1)))) - `(reb-match-0 ((,c (:foreground ,orange :inverse-video t)))) - `(reb-match-1 ((,c (:foreground ,magenta :inverse-video t)))) - `(reb-match-2 ((,c (:foreground ,green :inverse-video t)))) - `(reb-match-3 ((,c (:foreground ,yellow :inverse-video t)))) + `(reb-match-0 ((,c (:foreground ,orange :inverse-video t)))) + `(reb-match-1 ((,c (:foreground ,magenta :inverse-video t)))) + `(reb-match-2 ((,c (:foreground ,green :inverse-video t)))) + `(reb-match-3 ((,c (:foreground ,yellow :inverse-video t)))) ;; workgroups2 - `(wg-current-workgroup-face ((,c (:foreground ,black :background ,orange)))) + `(wg-current-workgroup-face ((,c (:foreground ,black :background ,orange)))) `(wg-other-workgroup-face ((,c (:foreground ,grey-.5 :background ,current-line)))) ;; neotree @@ -204,32 +232,32 @@ `(diff-hl-change ((,c (:foreground ,vc-modified)))) `(diff-hl-delete ((,c (:foreground ,vc-deleted)))) `(diff-hl-insert ((,c (:foreground ,vc-added)))) + `(git-gutter:modified ((,c (:foreground ,vc-modified)))) + `(git-gutter:added ((,c (:foreground ,vc-added)))) + `(git-gutter:deleted ((,c (:foreground ,vc-deleted)))) `(git-gutter+-modified ((,c (:foreground ,vc-modified :background nil)))) `(git-gutter+-added ((,c (:foreground ,vc-added :background nil)))) `(git-gutter+-deleted ((,c (:foreground ,vc-deleted :background nil)))) ;; Rainbow delimiters - `(rainbow-delimiters-depth-1-face ((,c (:foreground ,magenta :bold t)))) + `(rainbow-delimiters-depth-1-face ((,c (:foreground ,magenta)))) `(rainbow-delimiters-depth-2-face ((,c (:foreground ,orange)))) `(rainbow-delimiters-depth-3-face ((,c (:foreground ,yellow)))) `(rainbow-delimiters-depth-4-face ((,c (:foreground ,green)))) `(rainbow-delimiters-depth-5-face ((,c (:foreground ,cyan)))) `(rainbow-delimiters-unmatched-face ((,c (:foreground ,red :inverse-video t)))) - `(flyspell-incorrect ((,c (:underline (:style wave :color ,error-highlight) :inherit unspecified)))) - ;; Helm - `(helm-source-header ((,c (:background ,current-line :foreground ,grey-1)))) `(helm-selection ((,c (:background ,selection)))) + `(helm-match ((,c (:foreground ,magenta)))) + `(helm-source-header ((,c (:background ,current-line :foreground ,grey-1)))) `(helm-swoop-target-line-face ((,c (:foreground ,highlight :inverse-video t)))) - `(helm-match ((,c (:foreground ,magenta)))) - - `(helm-ff-file ((,c (:foreground ,grey)))) - `(helm-ff-prefix ((,c (:foreground ,magenta)))) - `(helm-ff-dotted-directory ((,c (:foreground ,grey-1)))) - `(helm-ff-directory ((,c (:foreground ,orange :bold t)))) - `(helm-ff-executable ((,c (:foreground ,white :slant italic)))) + `(helm-ff-file ((,c (:foreground ,grey)))) + `(helm-ff-prefix ((,c (:foreground ,magenta)))) + `(helm-ff-dotted-directory ((,c (:foreground ,grey-1)))) + `(helm-ff-directory ((,c (:foreground ,orange)))) + `(helm-ff-executable ((,c (:foreground ,white :slant italic)))) ;; Avy `(avy-lead-face-0 ((,c (:background ,orange :foreground ,black)))) @@ -241,11 +269,11 @@ ;; ***************************************************************************************** ;; js2-mode `(js2-function-param ((,c (:foreground ,variables)))) - `(js2-jsdoc-tag ((,c (:foreground ,comments :bold t)))) + `(js2-jsdoc-tag ((,c (:foreground ,comments)))) ;; markdown-mode - `(markdown-header-face ((,c (:foreground ,orange :bold t)))) - `(markdown-header-delimiter-face ((,c (:foreground ,orange :bold t)))) + `(markdown-header-face ((,c (:foreground ,orange :bold ,bold)))) + `(markdown-header-delimiter-face ((,c (:foreground ,orange :bold ,bold)))) `(markdown-blockquote-face ((,c (:foreground ,blue+2)))) `(markdown-markup-face ((,c (:foreground ,cyan)))) `(markdown-inline-face ((,c (:foreground ,cyan)))) @@ -276,13 +304,13 @@ `(org-meta-line ((,c (:foreground ,vsubtle)))) `(org-block-begin-line ((,c (:background ,current-line :foreground ,vsubtle)))) `(org-block-end-line ((,c (:inherit org-block-begin-line)))) - `(org-archived ((,c (:foreground ,grey-.5)))) + `(org-archived ((,c (:foreground ,grey-.5)))) - `(org-document-title ((,c (:foreground ,cyan :height 1.30 :bold t)))) - `(org-level-1 ((,c (:foreground ,orange :bold t)))) - `(org-level-2 ((,c (:foreground ,dark-cyan :bold t)))) - `(org-level-3 ((,c (:foreground ,violet :bold t)))) - `(org-level-4 ((,c (:foreground ,green :bold t)))) + `(org-document-title ((,c (:inherit variable-pitch :foreground ,cyan :height 1.30 :bold ,bold)))) + `(org-level-1 ((,c (:foreground ,orange :bold ,bold)))) + `(org-level-2 ((,c (:foreground ,dark-cyan :bold ,bold)))) + `(org-level-3 ((,c (:foreground ,violet :bold ,bold)))) + `(org-level-4 ((,c (:foreground ,green :bold ,bold)))) `(org-level-5 ((,c (:foreground ,yellow)))) `(org-level-6 ((,c (:foreground ,blue+2)))) ;;`(org-level-7 ((,c ()))) @@ -292,7 +320,7 @@ `(org-code ((,c (:foreground ,orange)))) `(org-verbatim ((,c (:foreground ,green)))) `(org-formula ((,c (:foreground ,cyan)))) - `(org-list-dt ((,c (:foreground ,cyan :bold t)))) + `(org-list-dt ((,c (:foreground ,cyan :bold ,bold)))) `(org-footnote ((,c (:foreground ,orange)))) `(org-link ((,c (:underline t :foreground ,yellow :bold inherit)))) @@ -310,12 +338,37 @@ `(org-block-background ((,c (:background ,current-line)))) `(org-todo-high ((,c (:foreground ,orange :bold inherit)))) `(org-todo-vhigh ((,c (:foreground ,magenta :bold inherit)))) - `(org-list-bullet ((,c (:foreground ,orange :bold t)))) + `(org-list-bullet ((,c (:foreground ,orange :bold ,bold)))) `(org-whitespace ((,c (:inherit fixed-pitch)))) `(org-todo-checkbox ((,c (:inherit variable-pitch)))) + ) - )) +;; ***************************************************************************************** + (custom-theme-set-variables + 'narf-dark + `(vc-annotate-color-map + '((20 . ,green) + (40 . ,(--color-blend yellow green (/ 1.0 3))) + (60 . ,(--color-blend yellow green (/ 2.0 3))) + (80 . ,yellow) + (100 . ,(--color-blend orange yellow (/ 1.0 3))) + (120 . ,(--color-blend orange yellow (/ 2.0 3))) + (140 . ,orange) + (160 . ,(--color-blend magenta orange (/ 1.0 3))) + (180 . ,(--color-blend magenta orange (/ 2.0 3))) + (200 . ,magenta) + (220 . ,(--color-blend red magenta (/ 1.0 3))) + (240 . ,(--color-blend red magenta (/ 2.0 3))) + (260 . ,red) + (280 . ,(--color-blend grey-2 red (/ 1.0 4))) + (300 . ,(--color-blend grey-2 red (/ 2.0 4))) + (320 . ,(--color-blend grey-2 red (/ 3.0 4))) + (340 . ,grey-2) + (360 . ,grey-2))) + `(vc-annotate-very-old-color nil) + `(vc-annotate-background ,black)) + ) ;; *****************************************************************************************