NARF v0.7.0

vcs:
+ +git-gutter to conf-modes; -git-gutter from evil-insert-state-exit
+ switch github-browse-file for browse-at-remote
+ fix <leader>ob; add <leader>d[./sr] vc bindings
+ vc-annotate bindings and initial state

Workgroups2 integration:
+ don't mess with buffers (speeds up emacs a lot!)
+ unicode numbers in display + single display function
+ remember workgroup uid instead (and smarter :tabrename)
+ clean up after wg update

Org-mode
+ give highlight precedence to links in org-mode
+ enable encryption
+ config clean up
+ use different font for org
+ exclude attachments in recentf
+ redo latex and inline-image config
+ add narf/org-open-notes
+ update file templates for org CRM

Mode-line
+ polish mode-line + decouple from spaceline-segments.el
+ refactor narf|spaceline-env-update
+ add macro-recording and buffer-size indicators to mode-line
+ python: '2>&1' in env-command
+ flycheck fringe indicator: change to arrow

Aesthetics
+ update narf-dark-theme
+ add narf-minibuffer-active face
+ change writing indicator in writing-mode

Misc
+ fix whitespace in display-startup-echo-area-message
+ reset fonts for more unicode characters
+ custom imenu entries + helm-imenu fontification
+ enable yascroll-bar in REPLs
+ reorganize my-commands.el
+ force quit iedit on ESC in normal mode
+ update snippets submodule
+ remove ido init (helm handles it all) [EXPERIMENTAL]
+ back to Terminus(TTF) font
+ popwin: update config for git-gutter and vc-diff windows
+ highlight :g[lobal] and :al[ign] matches
+ decouple narf/get-buffers+narf/get-all-buffers from wg-mess-with-buffer-list
+ fix narf/helm-buffers-dwim (add interactive form)
This commit is contained in:
Henrik Lissner 2015-12-11 16:51:04 -05:00
parent 8943bbc79f
commit aa26332d00
29 changed files with 691 additions and 421 deletions

1
Cask
View file

@ -92,6 +92,7 @@
(depends-on "gitconfig-mode") (depends-on "gitconfig-mode")
(depends-on "gitignore-mode") (depends-on "gitignore-mode")
(depends-on "github-browse-file") (depends-on "github-browse-file")
(depends-on "browse-at-remote")
;; Helm -- core/core-helm.el ;; Helm -- core/core-helm.el
(depends-on "helm") (depends-on "helm")

View file

@ -75,6 +75,17 @@
(defmacro $expand (path) (defmacro $expand (path)
`(evil-ex-replace-special-filenames ,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 (progn ; evil hacks
(defadvice evil-force-normal-state (after evil-esc-quit activate) (defadvice evil-force-normal-state (after evil-esc-quit activate)
"Close popups, disable search highlights and quit the minibuffer if open." "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)) (mapcar (lambda (i) (if (numberp i) (truncate i) i)) args))
(advice-add 'evil-move-to-column :filter-args 'narf*evil-move-to-column-fix) (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 ;; Hide keystroke display while isearch is active
(add-hook! isearch-mode (setq echo-keystrokes 0)) (add-hook! isearch-mode (setq echo-keystrokes 0))
(add-hook! isearch-mode-end (setq echo-keystrokes 0.02)) (add-hook! isearch-mode-end (setq echo-keystrokes 0.02))
@ -188,35 +191,45 @@
"\\1" file-name t))) "\\1" file-name t)))
file-name)) file-name))
;; Highlight buffer match interactive codes ;; Make :g[lobal] highlight matches
(defvar narf-buffer-match-global evil-ex-substitute-global (defvar narf-buffer-match-global evil-ex-substitute-global "")
"Whether or not buffer-match ex completion should add the ?g flag to searches.") (defun narf--ex-buffer-match (flag &optional arg)
(evil-ex-define-argument-type buffer-match
:runner
(lambda (flag &optional arg)
(let ((hl-name 'evil-ex-buffer-match)) (let ((hl-name 'evil-ex-buffer-match))
(with-selected-window (minibuffer-selected-window) (with-selected-window (minibuffer-selected-window)
(narf/-ex-match-init hl-name) (narf/-ex-match-init hl-name)
(narf/-ex-buffer-match arg hl-name (list (if narf-buffer-match-global ?g))))))) (narf/-ex-buffer-match arg hl-name (list (if narf-buffer-match-global ?g))))))
(evil-define-interactive-code "<//>" (defun narf--ex-global-match (flag &optional arg)
"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)) (let ((hl-name 'evil-ex-global-match))
(with-selected-window (minibuffer-selected-window) (with-selected-window (minibuffer-selected-window)
(narf/-ex-match-init hl-name) (narf/-ex-match-init hl-name)
(let ((result (car-safe (evil-ex-parse-global arg)))) (let ((result (car-safe (evil-ex-parse-global arg))))
(narf/-ex-buffer-match result hl-name nil (point-min) (point-max))))))) (narf/-ex-buffer-match result hl-name nil (point-min) (point-max))))))
(evil-define-interactive-code "<g/>"
"Ex global argument." (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-arg buffer-match
(list (when (evil-ex-p) evil-ex-argument)))
(evil-define-interactive-code "<g//>"
:ex-arg global-match :ex-arg global-match
(when (evil-ex-p) (when (evil-ex-p) (evil-ex-parse-global evil-ex-argument)))
(evil-ex-parse-global evil-ex-argument))))
(evil-define-operator narf:align (&optional beg end bang pattern)
(interactive "<r><!><//>")
(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 "<r><g//><!>")
(evil-ex-global beg end pattern command invert))
(exmap "g[lobal]" 'narf:evil-ex-global))
;; evil plugins ;; evil plugins
(use-package evil-anzu (use-package evil-anzu
@ -246,6 +259,7 @@
:functions (iedit-current-occurrence-string iedit-restrict-region) :functions (iedit-current-occurrence-string iedit-restrict-region)
:commands (evil-iedit-state evil-iedit-state/iedit-mode) :commands (evil-iedit-state evil-iedit-state/iedit-mode)
:config :config
(advice-add 'evil-force-normal-state :after 'evil-iedit-state/quit-iedit-mode)
(define-key evil-iedit-state-map (kbd "<escape>") 'evil-iedit-state/quit-iedit-mode) (define-key evil-iedit-state-map (kbd "<escape>") 'evil-iedit-state/quit-iedit-mode)
(define-key evil-visual-state-map (kbd "SPC") 'narf:iedit-restrict-to-region) (define-key evil-visual-state-map (kbd "SPC") 'narf:iedit-restrict-to-region)
(let ((map evil-iedit-state-map)) (let ((map evil-iedit-state-map))

View file

@ -22,7 +22,27 @@
;; Check buffer when normal mode is entered ;; Check buffer when normal mode is entered
(add-hook! evil-normal-state-entry 'narf*flycheck-buffer) (add-hook! evil-normal-state-entry 'narf*flycheck-buffer)
;; And on ESC in normal mode. ;; 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) (use-package flyspell :commands flyspell-mode)

View file

@ -2,7 +2,7 @@
(use-package helm (use-package helm
:init :init
(defvar helm-global-prompt "> ") (defvar helm-global-prompt ">>> ")
(setq-default (setq-default
helm-quick-update t helm-quick-update t
helm-reuse-last-window-split-state t helm-reuse-last-window-split-state t

View file

@ -6,18 +6,20 @@
(setq popwin:popup-window-height 0.3) (setq popwin:popup-window-height 0.3)
(mapc (lambda (rule) (push rule popwin:special-display-config)) (mapc (lambda (rule) (push rule popwin:special-display-config))
'(("*Help*" :position bottom :height 0.25 :stick t) '(("*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) ("*evil-registers*" :position bottom :height 0.3 :stick t)
("*scratch*" :position bottom :height 20 :stick t) ("*scratch*" :position bottom :height 20 :stick t)
("*Apropos*" :position bottom :height 40 :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) ("*Flycheck errors*" :position bottom :height 15 :stick t)
("*quickrun*" :position bottom :height 15 :stick t) ("*quickrun*" :position bottom :height 15 :stick t)
("*minor-modes*" :position bottom :height 0.5 :stick t) ("*minor-modes*" :position bottom :height 0.5 :stick t)
("^\\*CPU-Profiler-Report .+\\*$" :regexp t :position bottom :height 0.35) ("^\\*CPU-Profiler-Report .+\\*$" :regexp t :position bottom :height 0.35)
;; vcs ;; 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 ;; Helm
("^\\*[Hh]elm.*?\\*\\'" :regexp t :position bottom :height 0.2) ("^\\*[Hh]elm.*?\\*\\'" :regexp t :position bottom :height 0.2)

View file

@ -22,12 +22,6 @@
(add-to-list 'ido-ignore-files "\\`.DS_Store$") (add-to-list 'ido-ignore-files "\\`.DS_Store$")
(add-to-list 'ido-ignore-files "Icon\\?$") (add-to-list 'ido-ignore-files "Icon\\?$")
(ido-mode 1)
(ido-everywhere 1)
(require 'ido-ubiquitous)
(ido-ubiquitous-mode 1)
(add-hook! ido-setup (add-hook! ido-setup
(require 'ido-vertical-mode) (require 'ido-vertical-mode)
(ido-vertical-mode 1) (ido-vertical-mode 1)

View file

@ -19,6 +19,7 @@
(setq rtog/goto-buffer-fun 'popwin:pop-to-buffer (setq rtog/goto-buffer-fun 'popwin:pop-to-buffer
rtog/mode-repl-alist '()) rtog/mode-repl-alist '())
(add-hook! repl-toggle-mode 'yascroll-bar-mode)
(add-hook! repl-toggle-mode (evil-initialize-state 'emacs))) (add-hook! repl-toggle-mode (evil-initialize-state 'emacs)))
(provide 'core-quickrun) (provide 'core-quickrun)

View file

@ -23,15 +23,18 @@
jit-lock-defer-time nil jit-lock-defer-time nil
jit-lock-stealth-time 1 jit-lock-stealth-time 1
idle-update-delay 1
split-width-threshold nil split-width-threshold nil ; favor horizontal splits
split-height-threshold 30
;; Minibuffer resizing
resize-mini-windows 'grow-only resize-mini-windows 'grow-only
max-mini-window-height 0.3
fringe-indicator-alist (delq (assoc 'continuation fringe-indicator-alist) fringe-indicator-alist (delq (assoc 'continuation fringe-indicator-alist)
fringe-indicator-alist)) fringe-indicator-alist))
(defface narf-minibuffer-active '((t (:inherit mode-line))) "Face for active minibuffer")
(defvar narf-fringe-size 6) (defvar narf-fringe-size 6)
(if window-system (if window-system
(progn (progn
@ -49,12 +52,15 @@
(defun narf|minibuffer-setup () (defun narf|minibuffer-setup ()
(set-window-fringes (selected-window) 0 0 nil) (set-window-fringes (selected-window) 0 0 nil)
(make-local-variable 'face-remapping-alist) (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)) (add-hook! minibuffer-setup 'narf|minibuffer-setup))
(menu-bar-mode -1)) (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 (blink-cursor-mode 1) ; do blink cursor
(tooltip-mode -1) ; show tooltips in echo area (tooltip-mode -1) ; show tooltips in echo area
@ -218,7 +224,7 @@
;; Mode-line ;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Mode-line ;;;;;;;;;;;;;;;;;;;;;;;;;;;
(use-package spaceline-segments (use-package spaceline
:init :init
(defvar narf--env-version nil) (defvar narf--env-version nil)
(defvar narf--env-command nil) (defvar narf--env-command nil)
@ -227,14 +233,14 @@
:config :config
(setq-default (setq-default
powerline-default-separator nil powerline-default-separator nil
powerline-height 19 powerline-height 15
spaceline-highlight-face-func 'spaceline-highlight-face-evil-state) spaceline-highlight-face-func 'spaceline-highlight-face-evil-state)
(defface mode-line-is-modified nil "Face for mode-line modified symbol") (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") (defface mode-line-buffer-file nil "Face for mode-line buffer file path")
;; Custom modeline segments (progn ;; Custom modeline segments
(spaceline-define-segment narf-buffer-path (spaceline-define-segment *buffer-path
(if buffer-file-name (if buffer-file-name
(let* ((project-path (let (projectile-require-project-root) (projectile-project-root))) (let* ((project-path (let (projectile-require-project-root) (projectile-project-root)))
(buffer-path (file-relative-name buffer-file-name project-path)) (buffer-path (file-relative-name buffer-file-name project-path))
@ -252,7 +258,7 @@
:skip-alternate t :skip-alternate t
:tight-right t) :tight-right t)
(spaceline-define-segment narf-buffer-modified (spaceline-define-segment *buffer-modified
(concat (concat
(when buffer-file-name (when buffer-file-name
(concat (concat
@ -264,13 +270,13 @@
:skip-alternate t :skip-alternate t
:tight t) :tight t)
(spaceline-define-segment narf-buffer-encoding-abbrev (spaceline-define-segment *buffer-encoding-abbrev
"The line ending convention used in the buffer." "The line ending convention used in the buffer."
(symbol-name buffer-file-coding-system) (symbol-name buffer-file-coding-system)
:when (not (string-match-p "\\(utf-8\\|undecided\\)" :when (not (string-match-p "\\(utf-8\\|undecided\\)"
(symbol-name buffer-file-coding-system)))) (symbol-name buffer-file-coding-system))))
(spaceline-define-segment narf-buffer-position (spaceline-define-segment *buffer-position
"A more vim-like buffer position." "A more vim-like buffer position."
(let ((start (window-start)) (let ((start (window-start))
(end (window-end)) (end (window-end))
@ -284,7 +290,7 @@
(t (format ":%d%%%%" perc)))))) (t (format ":%d%%%%" perc))))))
:tight t) :tight t)
(spaceline-define-segment narf-vc (spaceline-define-segment *vc
"Version control info" "Version control info"
(powerline-raw (powerline-raw
(concat (replace-regexp-in-string (concat (replace-regexp-in-string
@ -305,14 +311,15 @@
:face other-face :face other-face
:tight-right t) :tight-right t)
(spaceline-define-segment narf-env-version (spaceline-define-segment *env-version
"A HUD that shows which part of the buffer is currently visible." "A HUD that shows which part of the buffer is currently visible."
narf--env-version narf--env-version
:when narf--env-version :when narf--env-version
:face other-face
:skip-alternate t :skip-alternate t
:tight-right t) :tight-right t)
(spaceline-define-segment narf-hud (spaceline-define-segment *hud
"A HUD that shows which part of the buffer is currently visible." "A HUD that shows which part of the buffer is currently visible."
(powerline-hud highlight-face other-face 1) (powerline-hud highlight-face other-face 1)
:face other-face :face other-face
@ -320,7 +327,7 @@
(defface mode-line-count-face nil "") (defface mode-line-count-face nil "")
(make-variable-buffer-local 'anzu--state) (make-variable-buffer-local 'anzu--state)
(spaceline-define-segment narf-anzu (spaceline-define-segment *anzu
"Show the current match number and the total number of matches. Requires "Show the current match number and the total number of matches. Requires
anzu to be enabled." anzu to be enabled."
(let ((here anzu--current-position) (let ((here anzu--current-position)
@ -334,7 +341,7 @@ anzu to be enabled."
:tight t) :tight t)
;; TODO mode-line-iedit-face default face ;; TODO mode-line-iedit-face default face
(spaceline-define-segment narf-iedit (spaceline-define-segment *iedit
"Show the number of matches and what match you're on (or after). Requires "Show the number of matches and what match you're on (or after). Requires
iedit." iedit."
(let ((this-oc (iedit-find-current-occurrence-overlay)) (let ((this-oc (iedit-find-current-occurrence-overlay))
@ -349,14 +356,12 @@ iedit."
(- length (-elem-index this-oc iedit-occurrences-overlays)) (- length (-elem-index this-oc iedit-occurrences-overlays))
"-")) "-"))
length)) length))
:when (bound-and-true-p iedit-mode)
:face (if active 'mode-line-count-face 'mode-line-inactive) :face (if active 'mode-line-count-face 'mode-line-inactive)
:skip-alternate t :skip-alternate t)
:when (bound-and-true-p iedit-mode))
;; TODO mode-line-substitute-face default face
(defface mode-line-substitute-face nil "") (defface mode-line-substitute-face nil "")
;; TODO This is very hackish; refactor? (spaceline-define-segment *evil-substitute
(spaceline-define-segment narf-evil-substitute
"Show number of :s matches in real time." "Show number of :s matches in real time."
(let ((range (if evil-ex-range (let ((range (if evil-ex-range
(cons (car evil-ex-range) (cadr evil-ex-range)) (cons (car evil-ex-range) (cadr evil-ex-range))
@ -367,33 +372,114 @@ iedit."
(count-matches pattern (car range) (cdr range)) (count-matches pattern (car range) (cdr range))
evil-ex-argument) 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) :face (if active 'mode-line-count-face 'mode-line-inactive)
:skip-alternate t :skip-alternate t)
:when (and (evil-ex-p) (evil-ex-hl-active-p 'evil-ex-substitute)))
(spaceline-define-segment narf-major-mode (spaceline-define-segment *macro-recording
(powerline-raw mode-name) "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 :tight-right t
:skip-alternate 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 ;; Initialize modeline
(spaceline-install (spaceline-install
;; Left side ;; Left side
'(narf-anzu narf-iedit narf-evil-substitute '(*macro-recording
(narf-buffer-path remote-host) (*flycheck :fallback *buffer-size)
narf-buffer-modified (*anzu *iedit *evil-substitute)
narf-vc (*buffer-path *remote-host)
((flycheck-error flycheck-warning flycheck-info) :when active)) *buffer-modified
*vc
)
;; Right side ;; Right side
'((selection-info :face highlight-face :skip-alternate t :when active) '(*selection-info
narf-env-version *buffer-encoding-abbrev
narf-buffer-encoding-abbrev *major-mode
(narf-major-mode *env-version
;; (minor-modes :separator " " :tight t)
(process :tight t))
(global :when active) (global :when active)
("%l·%c" narf-buffer-position) ("%l/%c" *buffer-position)
narf-hud *hud
))) )))
(provide 'core-ui) (provide 'core-ui)

View file

@ -9,23 +9,21 @@
"/\\.git/info/exclude$" "/\\.git/info/exclude$"
"/git/ignore$")) "/git/ignore$"))
(use-package github-browse-file (use-package browse-at-remote
:commands (github-browse-file github-browse-file-blame) :defer t
:init :init
(evil-define-command narf:github-browse-file (&optional bang) (evil-define-command narf:github-browse-file (&optional bang)
(interactive "<!>") (interactive "<!>")
(if bang (github-browse-file-blame) (github-browse-file)))) (browse-at-remote bang)))
(use-package git-gutter (use-package git-gutter
:commands (git-gutter-mode narf/vcs-next-hunk narf/vcs-prev-hunk :commands (git-gutter-mode narf/vcs-next-hunk narf/vcs-prev-hunk
narf/vcs-show-hunk narf/vcs-stage-hunk narf/vcs-revert-hunk) narf/vcs-show-hunk narf/vcs-stage-hunk narf/vcs-revert-hunk)
:init :init
(add-hook! (text-mode prog-mode) 'git-gutter-mode) (add-hook! (text-mode prog-mode conf-mode) 'git-gutter-mode)
:config :config
(require 'git-gutter-fringe) (require 'git-gutter-fringe)
(setq git-gutter:update-interval 2)
(defalias 'narf/vcs-next-hunk 'git-gutter:next-hunk) (defalias 'narf/vcs-next-hunk 'git-gutter:next-hunk)
(defalias 'narf/vcs-prev-hunk 'git-gutter:previous-hunk) (defalias 'narf/vcs-prev-hunk 'git-gutter:previous-hunk)
(defalias 'narf/vcs-show-hunk 'git-gutter:popup-hunk) (defalias 'narf/vcs-show-hunk 'git-gutter:popup-hunk)
@ -43,9 +41,7 @@
nil nil 'center) nil nil 'center)
(advice-add 'evil-force-normal-state :after 'git-gutter) (advice-add 'evil-force-normal-state :after 'git-gutter)
(add-hook! focus-in 'git-gutter:update-all-windows))
(add-hook! focus-in 'git-gutter:update-all-windows)
(add-hook! evil-insert-state-exit 'git-gutter))
(use-package diff-hl (use-package diff-hl
:disabled t :disabled t
@ -53,11 +49,11 @@
(setq diff-hl-draw-borders nil (setq diff-hl-draw-borders nil
diff-hl-fringe-bmp-function 'narf-diff-hl-fringe-bmp) diff-hl-fringe-bmp-function 'narf-diff-hl-fringe-bmp)
:config :config
(defalias narf/vcs-next-hunk 'diff-hl-next-hunk) (defalias 'narf/vcs-next-hunk 'diff-hl-next-hunk)
(defalias narf/vcs-prev-hunk 'diff-hl-previous-hunk) (defalias 'narf/vcs-prev-hunk 'diff-hl-previous-hunk)
;; (defalias narf/vcs-show-hunk ;; (defalias 'narf/vcs-show-hunk
;; (defalias narf/vcs-stage-hunk ...) ;; (defalias 'narf/vcs-stage-hunk ...)
(defalias narf/vcs-revert-hunk 'diff-hl-revert-hunk) (defalias 'narf/vcs-revert-hunk 'diff-hl-revert-hunk)
(defun narf-diff-hl-fringe-bmp (type _pos) (defun narf-diff-hl-fringe-bmp (type _pos)
(if (eq type 'delete) (if (eq type 'delete)
@ -76,5 +72,18 @@
(global-diff-hl-mode 1)) (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) (provide 'core-vcs)
;;; core-vcs.el ends here ;;; core-vcs.el ends here

View file

@ -10,14 +10,14 @@
wg-first-wg-name "*untitled*" wg-first-wg-name "*untitled*"
wg-session-load-on-start t wg-session-load-on-start t
wg-mode-line-display-on nil 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-emacs-exit-save-behavior 'save ; Options: 'save 'ask nil
wg-workgroups-mode-exit-save-behavior 'save wg-workgroups-mode-exit-save-behavior 'save
wg-log-level 0 wg-log-level 0
wg-list-display-decor-divider " " wg-list-display-decor-divider " "
wg-list-display-decor-left-brace "" 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-left ""
wg-list-display-decor-current-right "" wg-list-display-decor-current-right ""
wg-list-display-decor-previous-left "" wg-list-display-decor-previous-left ""
@ -31,9 +31,12 @@
(candidates . wg-workgroup-names) (candidates . wg-workgroup-names)
(action . narf/wg-helm-switch-to-workgroup))) (action . narf/wg-helm-switch-to-workgroup)))
(add-to-list 'savehist-additional-variables 'narf-wg-names)
(defvar narf-wg-frames '()) (defvar narf-wg-frames '())
(defvar narf-wg-names '()) (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 (after! projectile
;; Create a new workgroup on switch-project ;; Create a new workgroup on switch-project

View file

@ -138,7 +138,7 @@
(defun display-startup-echo-area-message () (defun display-startup-echo-area-message ()
(after! workgroups2 (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) (require 'server)
(unless (server-running-p) (unless (server-running-p)

View file

@ -39,7 +39,7 @@ Inspired from http://demonastery.org/2013/04/emacs-evil-narrow-region/"
(defun narf/get-all-buffers () (defun narf/get-all-buffers ()
"Get all buffers across all workgroups. Depends on "Get all buffers across all workgroups. Depends on
`wg-mess-with-buffer-list'." `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) (wg-buffer-list-emacs)
(buffer-list))) (buffer-list)))
@ -47,7 +47,7 @@ Inspired from http://demonastery.org/2013/04/emacs-evil-narrow-region/"
(defun narf/get-buffers () (defun narf/get-buffers ()
"Get all buffers in the current workgroup. Depends on "Get all buffers in the current workgroup. Depends on
`wg-mess-with-buffer-list'." `wg-mess-with-buffer-list'."
(buffer-list)) (wg-workgroup-associated-buffers (wg-current-workgroup)))
;;;###autoload ;;;###autoload
(defun narf/get-visible-buffers (&optional buffer-list) (defun narf/get-visible-buffers (&optional buffer-list)

View file

@ -39,16 +39,5 @@
(beginning-of-line)) (beginning-of-line))
(setq *linum-mdown-line* nil)))) (setq *linum-mdown-line* nil))))
;;;###autoload (autoload 'narf:align "defuns-editor" nil t)
(evil-define-operator narf:align (&optional beg end bang pattern)
(interactive "<r><!><//>")
(align-regexp
beg end
(concat "\\(\\s-*\\)"
(if bang
(regexp-quote pattern)
(rxt-pcre-to-elisp pattern)))
1 1))
(provide 'defuns-editor) (provide 'defuns-editor)
;;; defuns-editor.el ends here ;;; defuns-editor.el ends here

View file

@ -82,6 +82,7 @@
(defun narf/helm-buffers-dwim (&optional all-p) (defun narf/helm-buffers-dwim (&optional all-p)
"Displays open buffers in current project. If ALL-P, then show all open "Displays open buffers in current project. If ALL-P, then show all open
buffers." buffers."
(interactive)
(if (and (not all-p) (narf/project-p)) (if (and (not all-p) (narf/project-p))
(helm-projectile-switch-to-buffer) (helm-projectile-switch-to-buffer)
(helm-buffers-list))) (helm-buffers-list)))

View file

@ -3,11 +3,11 @@
;;;###autoload ;;;###autoload
(defun narf|spaceline-env-update () (defun narf|spaceline-env-update ()
(when narf--env-command (when narf--env-command
(let* ((command (format "cd '%s' && %s" (narf/project-root) narf--env-command)) (let ((default-directory (narf/project-root)))
(s (shell-command-to-string command))) (let ((s (shell-command-to-string narf--env-command)))
(setq narf--env-version (if (string-match "[ \t\n\r]+\\'" s) (setq narf--env-version (if (string-match "[ \t\n\r]+\\'" s)
(replace-match "" t t s) (replace-match "" t t s)
s))))) s))))))
(provide 'defuns-spaceline) (provide 'defuns-spaceline)
;;; defuns-spaceline.el ends here ;;; defuns-spaceline.el ends here

View file

@ -14,7 +14,9 @@
(defun narf/wg-projectile-switch-project () (defun narf/wg-projectile-switch-project ()
(let ((workgroup-name (file-name-nondirectory (directory-file-name (narf/project-root))))) (let ((workgroup-name (file-name-nondirectory (directory-file-name (narf/project-root)))))
(wg-create-workgroup workgroup-name t) (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) ;;;###autoload (autoload 'narf:save-session "defuns-workgroup" nil t)
(evil-define-command narf:save-session (&optional bang session-name) (evil-define-command narf:save-session (&optional bang session-name)
@ -41,14 +43,23 @@
(wg-clone-workgroup (wg-current-workgroup) name) (wg-clone-workgroup (wg-current-workgroup) name)
(wg-create-workgroup name t)) (wg-create-workgroup name t))
(unless silent (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) ;;;###autoload (autoload 'narf:workgroup-rename "defuns-workgroup" nil t)
(evil-define-command narf:workgroup-rename (new-name) (evil-define-command narf:workgroup-rename (bang &optional new-name)
(interactive "<a>") (interactive "<!><a>")
(let ((wg (wg-current-workgroup))) (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) (wg-rename-workgroup new-name wg)
(add-to-list 'narf-wg-names 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) ;;;###autoload (autoload 'narf:workgroup-delete "defuns-workgroup" nil t)
(evil-define-command narf:workgroup-delete (&optional bang name) (evil-define-command narf:workgroup-delete (&optional bang name)
@ -61,7 +72,7 @@
(if (eq wg current-wg) (if (eq wg current-wg)
(wg-kill-workgroup) (wg-kill-workgroup)
(wg-delete-workgroup wg)) (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 ;;;###autoload
(defun narf:kill-other-workgroups () (defun narf:kill-other-workgroups ()
@ -72,6 +83,24 @@
(unless (wg-current-workgroup-p w) (unless (wg-current-workgroup-p w)
(wg-kill-workgroup 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 ;;;###autoload
(defun narf/workgroup-display (&optional suppress-update return-p) (defun narf/workgroup-display (&optional suppress-update return-p)
(interactive) (interactive)
@ -83,7 +112,7 @@
(if (not workgroup) wg-nowg-string (if (not workgroup) wg-nowg-string
(wg-element-display (wg-element-display
workgroup 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-current-workgroup-p)))
(wg-workgroup-list)))) (wg-workgroup-list))))
(if return-p (if return-p
@ -99,23 +128,24 @@
(base (f-filename (buffer-file-name)))) (base (f-filename (buffer-file-name))))
(unless (string= base old-name) (unless (string= base old-name)
(wg-rename-workgroup base wg))))))) (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) ;;;###autoload (autoload 'narf:switch-to-workgroup-left "defuns-workgroup" nil t)
(evil-define-command narf:switch-to-workgroup-left (count) (evil-define-command narf:switch-to-workgroup-left (count)
(interactive "<c>") (interactive "<c>")
(narf/workgroup-update-names)
(if count (if count
(wg-switch-to-workgroup-at-index (1- count)) (wg-switch-to-workgroup-at-index (1- count))
(wg-switch-to-workgroup-left)) (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) ;;;###autoload (autoload 'narf:switch-to-workgroup-right "defuns-workgroup" nil t)
(evil-define-command narf:switch-to-workgroup-right (count) (evil-define-command narf:switch-to-workgroup-right (count)
(interactive "<c>") (interactive "<c>")
(narf/workgroup-update-names)
(if count (if count
(wg-switch-to-workgroup-at-index (1- count)) (wg-switch-to-workgroup-at-index (1- count))
(wg-switch-to-workgroup-right)) (wg-switch-to-workgroup-right))
(narf/workgroup-display (wg-previous-workgroup))) (narf/workgroup-display t))
;;;###autoload ;;;###autoload
(defun narf:switch-to-workgroup-at-index (index) (defun narf:switch-to-workgroup-at-index (index)

View file

@ -2,7 +2,7 @@
;; ;;
;; Author: Henrik Lissner <henrik@lissner.net> ;; Author: Henrik Lissner <henrik@lissner.net>
;; URL: https://github.com/hlissner/emacs.d ;; URL: https://github.com/hlissner/emacs.d
;; Version: 0.6.0 ;; Version: 0.7.0
;; ;;
;;; Are you pondering what I'm pondering, Pinky? ;;; Are you pondering what I'm pondering, Pinky?
;; ;;
@ -41,7 +41,7 @@
;;; License: GPLv3 ;;; License: GPLv3
(defconst narf-theme 'narf-dark) (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-writing-font (font-spec :family "Hack" :size 14))
(defconst narf-big-font (font-spec :family "Inconsolata" :size 20)) (defconst narf-big-font (font-spec :family "Inconsolata" :size 20))

View file

@ -1,5 +1,10 @@
;;; defuns-org.el ;;; defuns-org.el
;;;###autoload
(defun narf/org-open-notes ()
(interactive)
(find-file org-default-notes-file))
;;;###autoload ;;;###autoload
(defun narf/org-insert-item (direction) (defun narf/org-insert-item (direction)
"Inserts a new heading or item, depending on the context." "Inserts a new heading or item, depending on the context."

View file

@ -17,9 +17,36 @@
(add-hook 'before-save-hook 'delete-trailing-whitespace nil t) (add-hook 'before-save-hook 'delete-trailing-whitespace nil t)
(add-hook 'after-save-hook 'narf-elisp-auto-compile nil t) (add-hook 'after-save-hook 'narf-elisp-auto-compile nil t)
(let ((header-face 'font-lock-constant-face))
(add-to-list 'imenu-generic-expression (add-to-list 'imenu-generic-expression
'("Package" `("Package" "\\(^\\s-*(use-package +\\)\\(\\_<.+\\_>\\)" 2))
"\\(^\\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 (font-lock-add-keywords
'emacs-lisp-mode `(("\\(lambda\\)" (0 (narf/show-as ))))) 'emacs-lisp-mode `(("\\(lambda\\)" (0 (narf/show-as )))))

View file

@ -12,25 +12,32 @@
(defvar org-directory-projects (expand-file-name "my/projects/" org-directory)) (defvar org-directory-projects (expand-file-name "my/projects/" org-directory))
(defvar org-directory-invoices (expand-file-name "my/invoices/" 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) (add-hook! org-load 'narf|org-init)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun narf@org-vars () (defun narf@org-vars ()
(setq org-default-notes-file (concat org-directory "notes.org") (setq org-agenda-files
org-agenda-files (f-entries org-directory (lambda (path) (string-suffix-p ".org" path)) t)
(f-entries org-directory (lambda (path) (f-ext? path "org")) t)
org-archive-location (concat org-directory "/archive/%s::") org-archive-location (concat org-directory "/archive/%s::")
org-attach-directory ".attach/" 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" ;; 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-default-priority ?C
org-catch-invisible-edits nil org-catch-invisible-edits nil
org-confirm-elisp-link-function nil org-confirm-elisp-link-function nil
org-completion-use-ido t
org-hidden-keywords '(title) org-hidden-keywords '(title)
org-special-ctrl-a/e t org-special-ctrl-a/e t
org-hierarchical-todo-statistics t org-hierarchical-todo-statistics t
@ -44,7 +51,8 @@
org-src-window-setup 'current-window org-src-window-setup 'current-window
org-startup-folded 'content org-startup-folded 'content
org-todo-keywords '((sequence "TODO(t)" "|" "DONE(d)") 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) org-blank-before-new-entry '((heading . nil)
(plain-list-item . auto)) (plain-list-item . auto))
@ -54,8 +62,8 @@
org-capture-templates org-capture-templates
'(("t" "TODO" entry '(("t" "TODO" entry
(file+headline (concat org-directory "todo.org") "Inbox") (file+headline (concat org-directory "notes.org") "Unsorted")
"** TODO %? %u") "*** TODO %? %u")
;; TODO Select file from org files ;; TODO Select file from org files
;; ("T" "Specific TODO" entry ;; ("T" "Specific TODO" entry
@ -72,7 +80,7 @@
;; TODO Select file from notes folder ;; TODO Select file from notes folder
("n" "Notes" entry ("n" "Notes" entry
(file+headline (concat org-directory "notes.org") "Inbox") (file+headline (concat org-directory "notes.org") "Unsorted")
"* %u %?\n%i" :prepend t) "* %u %?\n%i" :prepend t)
("s" "Writing Scraps" entry ("s" "Writing Scraps" entry
@ -85,11 +93,11 @@
"** %i%?\n") "** %i%?\n")
("e" "Excerpt" entry ("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) "** %u %?\n%i" :prepend t)
("q" "Quote" item ("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) "+ %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-preview-ltxpng-directory (concat narf-temp-dir "ltxpng/")
org-latex-remove-logfiles t org-latex-remove-logfiles t
org-latex-create-formula-image-program 'dvipng 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-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 org-latex-packages-alist
'(("" "gauss" t))) '(("" "gauss" t)
;; ("" "physics" t) TODO Install this
(plist-put org-format-latex-options :scale 1.1)) )))
(defun narf@org-looks () (defun narf@org-looks ()
(setq org-image-actual-width nil (setq org-image-actual-width nil
org-startup-with-inline-images t org-startup-with-inline-images nil
org-startup-indented t org-startup-indented t
org-pretty-entities t org-pretty-entities t
org-pretty-entities-include-sub-superscripts t org-pretty-entities-include-sub-superscripts t
@ -221,7 +231,7 @@ will function properly."
org-cycle-separator-lines 2 org-cycle-separator-lines 2
org-hide-emphasis-markers t org-hide-emphasis-markers t
org-hide-leading-stars t org-hide-leading-stars t
org-bullets-bullet-list '("" "" "" "" "" "" "") org-bullets-bullet-list '("" "" "" "" "" "")
org-entities-user org-entities-user
'(("flat" "\\flat" nil "" "" "266D" "") '(("flat" "\\flat" nil "" "" "266D" "")
("sharp" "\\sharp" nil "" "" "266F" "")) ("sharp" "\\sharp" nil "" "" "266F" ""))
@ -230,6 +240,8 @@ will function properly."
'((?A . org-todo-vhigh) '((?A . org-todo-vhigh)
(?B . org-todo-high))) (?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) ;; Restore org-block-background face (removed in official org)
(defface org-block-background '((t ())) (defface org-block-background '((t ()))
@ -258,46 +270,32 @@ will function properly."
("^ *\\(#\\+end_src\\>\\)" ("^ *\\(#\\+end_src\\>\\)"
(1 (narf/show-as ?#))) (1 (narf/show-as ?#)))
("^ *\\(#\\+begin_quote\\>\\)" ("^ *\\(#\\+begin_quote\\>\\)"
(1 (narf/show-as ?\"))) (1 (narf/show-as ?>)))
("^ *\\(#\\+end_quote\\>\\)" ("^ *\\(#\\+end_quote\\>\\)"
(1 (narf/show-as ?\"))) (1 (narf/show-as ?>)))
;; Hide TODO tags ;; Hide TODO tags
("^\\**\\(\\* DONE\\) \\([^$\n\r]+\\)" ("^\\**\\(\\* DONE\\) \\([^$\n\r]+\\)"
(1 (narf/show-as ?☑)) (1 (narf/show-as ?☑))
(1 'org-todo-checkbox)
(2 'org-headline-done)) (2 'org-headline-done))
("^\\**\\(\\* TODO\\) \\([^$\n\r]+\\)?" ("^\\**\\(\\* \\(TODO\\|PAID\\)\\) "
(1 (narf/show-as ?☐)) (1 (narf/show-as ?☐)))
(1 'org-todo-checkbox))
;; Unbold-ify todos ;; ("[-+*] \\(\\[X\\]\\) \\([^$\n\r]+\\)"
(,(concat "^\\**\\(\\* " ;; (2 'org-headline-done))
(regexp-opt '("TODO" "LEAD" "NEXT" "ACTIVE" "PENDING" "CANCELLED"))
"\\)\\( [^$\n\r]*\\)?")
(2 'org-headline-todo))
;; ("[-+*] \\(\\[ \\]\\) " ("[-+*] \\[X\\] \\([^$\n\r]+\\)"
;; (1 'org-whitespace)) (1 'org-headline-done))
;; ("[-+*] \\(\\[-\\]\\) "
;; (1 'org-whitespace))
("[-+*] \\(\\[X\\]\\) \\([^$\n\r]+\\)"
;; (1 'org-whitespace)
(2 'org-headline-done))
;; Show checkbox for other todo states (but don't hide the label) ;; Show checkbox for other todo states (but don't hide the label)
(,(concat (,(concat
"\\(\\*\\) " "\\(\\*\\) "
(regexp-opt '("LEAD" "NEXT" "ACTIVE" "PENDING" "CANCELLED") t) (regexp-opt '("IDEA" "NEXT" "ACTIVE" "WAITING" "LATER" "CANCELLED" "UNPAID" "UNSENT") t)
" ") " ")
(1 (narf/show-as ?☐))) (1 (narf/show-as ?☐)))
("^ *\\([-+]\\|[0-9]+[).]\\)\\( \\)+[^$\n\r]+" ("^ *\\([-+]\\|[0-9]+[).]\\)\\( \\)+[^$\n\r]"
(1 'org-list-bullet)) (1 'org-list-bullet))
("^ +\\(\\*\\) "
(1 (narf/show-as ?◦)))
;; ("^ +"
;; (0 'org-whitespace))
))) )))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@ -306,11 +304,15 @@ will function properly."
(evil-org-mode +1) (evil-org-mode +1)
(org-bullets-mode +1) (org-bullets-mode +1)
(org-indent-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) (narf|enable-tab-width-2)
(setq truncate-lines nil) (setq truncate-lines nil)
(setq line-spacing '0.2) (setq line-spacing '2)
(defun narf|org-update-statistics-cookies () (defun narf|org-update-statistics-cookies ()
(when (file-exists-p buffer-file-name) (when (file-exists-p buffer-file-name)
@ -347,11 +349,23 @@ will function properly."
(add-hook 'org-mode-hook 'narf|org-hook) (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 "contact" 'narf/org-crm-link-contact)
(org-add-link-type "project" 'narf/org-crm-link-project) (org-add-link-type "project" 'narf/org-crm-link-project)
(org-add-link-type "invoice" 'narf/org-crm-link-invoice) (org-add-link-type "invoice" 'narf/org-crm-link-invoice)
(add-to-list 'recentf-exclude (expand-file-name "%s.+\\.org$" org-directory))
(after! helm (after! helm
(mapc (lambda (r) (add-to-list 'helm-boring-file-regexp-list r)) (mapc (lambda (r) (add-to-list 'helm-boring-file-regexp-list r))
(list "\\.attach$" "\\.Rhistory$"))) (list "\\.attach$" "\\.Rhistory$")))
@ -364,7 +378,7 @@ will function properly."
(make-variable-buffer-local 'yas-trigger-key) (make-variable-buffer-local 'yas-trigger-key)
(setq yas/trigger-key [tab]) (setq yas/trigger-key [tab])
(add-to-list 'org-tab-first-hook 'yas/org-very-safe-expand) (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 ;;; Evil integration
(progn (progn
@ -383,8 +397,10 @@ will function properly."
(setq-default (setq-default
org-download-image-dir ".attach" org-download-image-dir ".attach"
org-download-heading-lvl nil org-download-heading-lvl nil
org-download-timestamp "_%Y%m%d_%H%M%S" org-download-timestamp "_%Y%m%d_%H%M%S")
org-download-screenshot-method "screencapture -i %s")
(when IS-MAC
(setq org-download-screenshot-method "screencapture -i %s"))
(defun org-download--dir-2 () (defun org-download--dir-2 ()
(f-base (buffer-file-name))) (f-base (buffer-file-name)))
@ -465,6 +481,7 @@ will function properly."
:n "L" 'org-store-link :n "L" 'org-store-link
:n "x" 'narf/org-remove-link :n "x" 'narf/org-remove-link
:n "w" 'writing-mode :n "w" 'writing-mode
:n "v" 'variable-pitch-mode
:n "SPC" 'narf/org-toggle-checkbox :n "SPC" 'narf/org-toggle-checkbox
:n "RET" 'org-archive-subtree :n "RET" 'org-archive-subtree
@ -476,22 +493,25 @@ will function properly."
:n "i" 'narf/org-toggle-inline-images-at-point :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 (if (org-entry-is-todo-p) 'none 'todo)))
:n "T" 'org-todo :n "T" 'org-todo
:n "r" 'org-refile
:n "s" 'org-schedule :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 "op" 'narf/org-open-project-at-pt
:n "oc" 'narf/org-open-contact-at-pt :n "oc" 'narf/org-open-contact-at-pt
:n "oi" 'narf/org-open-invoice-at-pt :n "oi" 'narf/org-open-invoice-at-pt
) )
;; TODO Improve folding bindings
:n "za" 'org-cycle :n "za" 'org-cycle
:n "zA" 'org-shifttab :n "zA" 'org-shifttab
:n "zm" 'hide-body :n "zm" (λ (outline-hide-sublevels 1))
:n "zr" 'show-all :n "zr" 'outline-show-all
:n "zo" 'show-subtree :n "zo" 'outline-show-subtree
:n "zO" 'show-all :n "zO" 'outline-show-all
:n "zc" 'hide-subtree :n "zc" 'outline-hide-subtree
:n "zC" 'hide-all :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-forward-heading-same-level) (org-beginning-of-line))
:m "[[" (λ (call-interactively 'org-backward-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 (cond
((and lang (not (string= lang "")) org-src-fontify-natively) ((and lang (not (string= lang "")) org-src-fontify-natively)
(org-src-font-lock-fontify-block lang block-start block-end) (org-src-font-lock-fontify-block lang block-start block-end)
;;;;;;; EDIT
;; remove old background overlays ;; remove old background overlays
(mapc (lambda (ov) (mapc (lambda (ov)
(if (eq (overlay-get ov 'face) 'org-block-background) (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 'face 'org-block-background)
(overlay-put ovl 'evaporate t)) ; make it go away when empty (overlay-put ovl 'evaporate t)) ; make it go away when empty
;; (add-text-properties beg1 block-end '(src-block t))) ;; (add-text-properties beg1 block-end '(src-block t)))
;;;;;;; /EDIT
(quoting (quoting
(add-text-properties beg1 (min (point-max) (1+ end1)) (add-text-properties beg1 (min (point-max) (1+ end1))
'(face org-block))) ; end of source block '(face org-block))) ; end of source block

View file

@ -11,7 +11,7 @@
python-environment-directory narf-temp-dir python-environment-directory narf-temp-dir
python-shell-interpreter "ipython") python-shell-interpreter "ipython")
:config :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) (define-repl! python-mode narf-inf-python)
(defun narf-inf-python () (defun narf-inf-python ()

View file

@ -35,10 +35,9 @@
(setq mode-line-format (setq mode-line-format
(if mode-p (if mode-p
'("%e" (:eval (spaceline--prepare '("%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-path remote-host)
narf-buffer-modified narf-buffer-modified)
"")
'((selection-info :face highlight-face :skip-alternate t) '((selection-info :face highlight-face :skip-alternate t)
narf-hud narf-hud
)))) ))))

View file

@ -29,6 +29,7 @@
"M-b" 'narf:build "M-b" 'narf:build
"M-t" 'narf:workgroup-new "M-t" 'narf:workgroup-new
"M-T" 'narf/workgroup-display
"A-`" 'narf-switch-to-iterm "A-`" 'narf-switch-to-iterm
"C-`" 'popwin:messages "C-`" 'popwin:messages
"C-~" 'rtog/toggle-repl "C-~" 'rtog/toggle-repl
@ -117,7 +118,12 @@
:n "e" 'narf/flycheck-errors :n "e" 'narf/flycheck-errors
:n "s" 'yas-visit-snippet-file :n "s" 'yas-visit-snippet-file
:n "S" 'narf/yas-find-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 "b" 'helm-bookmarks
:n "w" 'narf/workgroup-display :n "w" 'narf/workgroup-display
@ -147,7 +153,7 @@
(:prefix "o" (:prefix "o"
:n "o" 'os-open-in-default-program :n "o" 'os-open-in-default-program
:n "p" 'os-reveal-project :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
:n "U" 'os-upload-folder :n "U" 'os-upload-folder
:n "l" 'os-send-to-launchbar :n "l" 'os-send-to-launchbar

View file

@ -1,64 +1,72 @@
;;; my-commands.el ;;; my-commands.el
(defalias 'exmap 'evil-ex-define-cmd) ;; Emacs utilities
(defalias 'exmap! 'evil-ex-define-cmd-local)
(exmap "a" 'helm-projectile-find-other-file)
(exmap "acomp[ile]" 'narf:compile-autoloads) (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 "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) (exmap "echo" 'narf:echo)
;; Editing
(exmap "@" 'narf/evil-macro-on-all-lines)
(exmap "al[ign]" 'narf:align)
(exmap "en[ew]" 'narf:file-create) (exmap "en[ew]" 'narf:file-create)
(exmap "fi[nd]" 'narf:helm-swoop) (exmap "na[rrow]" 'narf:narrow) ; Narrow buffer to selection
(exmap "full[scr]" 'narf:toggle-fullscreen) (exmap "ref[actor]" 'emr-show-refactor-menu)
(exmap "fullw[rite]" 'narf:toggle-write-mode) (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 "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]" 'kill-this-buffer) ; Kill current buffer
(exmap "k[ill]all" 'narf:kill-all-buffers) ; Kill all buffers (bang = in project) (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]buried" 'narf:kill-buried-buffers) ; Kill all buried buffers (bang = in project)
(exmap "k[ill]o" 'narf:kill-unreal-buffers) (exmap "k[ill]o" 'narf:kill-unreal-buffers)
(exmap "l[ast]" 'narf:popup-last-buffer) (exmap "l[ast]" 'narf:popup-last-buffer)
(exmap "m[sg]" 'narf:popup-messages) (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) (exmap "ma[ke]" 'narf:build)
;; File operations
(exmap "mv" 'narf:file-move) (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 "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) ;; Presentation/demo
(exmap "t[mux]w" 'narf/tmux-new-window) (exmap "big" 'narf:toggle-big-mode)
(exmap "t[mux]s" 'narf/tmux-split-window) (exmap "full[scr]" 'narf:toggle-fullscreen)
(exmap "t[mux]v" (λ (narf/tmux-split-window t))) (exmap "fullw[rite]" 'narf:toggle-write-mode)
(exmap "tcd" 'narf:tmux-cd)
;; Org-mode
(exmap "cap[ture]" 'helm-org-capture-templates)
(exmap "org" 'narf/helm-org)
(exmap "cont[act]" 'narf:org-crm-contact) (exmap "cont[act]" 'narf:org-crm-contact)
(exmap "proj[ect]" 'narf:org-crm-project) (exmap "proj[ect]" 'narf:org-crm-project)
(exmap "invo[ice]" 'narf:org-crm-invoice) (exmap "invo[ice]" 'narf:org-crm-invoice)
;; GIT ;; Plugins
(exmap "bl[ame]" 'narf:github-browse-file)
(after! flycheck (after! flycheck
(exmap "er[rors]" (λ (flycheck-buffer) (flycheck-list-errors)))) (exmap "er[rors]" (λ (flycheck-buffer) (flycheck-list-errors))))

@ -1 +1 @@
Subproject commit 26750d3e73761e7b418f3038236c46359cc05735 Subproject commit de19d3918bbdccb00fa2dc900b80cd3c47c502b4

View file

@ -1,12 +1,11 @@
#+TITLE:${1:Contact Name}${2: 🏢} #+TITLE:${1:Contact Name}
#+begin_src yaml #+DATE: `(format-time-string "%Y-%m-%d")`
created: `(format-time-string "%Y-%m-%d")` #+EMAIL: ${2:email@address.com}
#+ADDRESS: $3
#+CITY: $4
#+COUNTRY: $5
email: ${3:email@address.com} ${0:...}
address: $4
city: $5
country: $6
#+end_src
* Associates * Associates
+ Associate's name :: associates@email.com + Associate's name :: associates@email.com

View file

@ -1,18 +1,21 @@
#+TITLE:${1:1234-5678} #+TITLE:${1:1234-5678}
#+begin_src yaml #+DATE: `(format-time-string "%Y-%m-%d")`
created: `(format-time-string "%Y-%m-%d")` #+ISSUED: ${2:`(format-time-string "%Y-%m-%d")`}
issued: `(format-time-string "%Y-%m-%d")` #+PAID: ${3:`(format-time-string "%Y-%m-%d")`}
currency: ${2:CAD|USD|GBP|DKK} #+CURRENCY: ${4:CAD|USD|DKK|GBP}
contact: ${3:email address} #+CONTACT: ${5:Contact ID}
#+PROJECT: ${6:Project ID}
items: | *Description* | *qty* | *rate* | *total* |
- title: "$4" |----------------------------------------------+-----+--------+-------|
body: "$5" | $0 [1] | | | |
qty: ${6:1} |----------------------------------------------+-----+--------+-------|
amount: ${7:1200.00} | | | | |
#+TBLFM: $4=$2+$3::@>$4=vsum(@2..@-1)
comments: "$0" [1] ...
#+end_src
* Comments
...
* Notes * Notes
* Attachments [0/0] ** Attachments [0/0]

View file

@ -1,8 +1,6 @@
#+TITLE:${1:Project Name} #+TITLE:${1:Project Name}
#+begin_src yaml #+DATE: `(format-time-string "%Y-%m-%d")`
created: `(format-time-string "%Y-%m-%d")` #+CONTACT: ${2:Contact name/id}
contact: ${2:Contact id}
#+end_src
${3:Summary of project.} ${3:Summary of project.}

View file

@ -5,8 +5,30 @@
(custom-theme-set-variables 'narf-dark) (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))) (let* ((c '((class color)))
;; Global bold flag
(bold t)
(bg "#1E2021") (bg "#1E2021")
(fg "#D6D6D4") (fg "#D6D6D4")
(subtle "#aab6c7") (subtle "#aab6c7")
@ -57,10 +79,11 @@
(error-highlight red) (error-highlight red)
(linum-bg current-line) (linum-bg current-line)
(linum-fg grey-1) (linum-fg "#383840")
(linum-hl-fg orange) (linum-hl-fg orange)
(linum-hl-bg current-line) (linum-hl-bg current-line)
(active-minibuffer "#404046")
(modeline-fg white) (modeline-fg white)
(modeline-fg-2 orange) (modeline-fg-2 orange)
(modeline-fg-3 orange) (modeline-fg-3 orange)
@ -90,13 +113,15 @@
;; `(match ((,c (:background ,magenta)))) ;; `(match ((,c (:background ,magenta))))
`(minibuffer-prompt ((,c (:foreground ,orange)))) `(minibuffer-prompt ((,c (:foreground ,orange))))
`(error ((,c (:foreground ,red :bold t)))) `(error ((,c (:foreground ,red ))))
`(warning ((,c (:foreground ,yellow :bold t)))) `(warning ((,c (:foreground ,yellow))))
`(success ((,c (:foreground ,green :bold t)))) `(success ((,c (:foreground ,green ))))
`(spaceline-flycheck-error ((,c (:bold t :foreground ,red)))) `(spaceline-flycheck-error ((,c (:underline nil :foreground ,black :background ,red))))
`(spaceline-flycheck-warning ((,c (:bold t :foreground ,yellow)))) `(spaceline-flycheck-warning ((,c (:underline nil :foreground ,black :background ,yellow))))
`(spaceline-flycheck-info ((,c (:bold t :foreground ,green)))) `(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-face ((,c (:foreground ,comments :background ,black))))
`(hs-fringe-face ((,c (:foreground ,orange)))) `(hs-fringe-face ((,c (:foreground ,orange))))
@ -129,35 +154,38 @@
`(vertical-border ((,c (:foreground ,vertical-bar :background ,vertical-bar)))) `(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 ((,c (:foreground ,linum-fg :bold nil :height 0.8)))) `(linum ((,c (:foreground ,linum-fg :bold nil))))
`(linum-highlight-face ((,c (:inherit linum :bold t :foreground ,linum-hl-fg)))) `(linum-highlight-face ((,c (:inherit linum :foreground ,linum-hl-fg))))
`(show-paren-match ((,c (:foreground ,magenta :bold t :inverse-video t)))) `(show-paren-match ((,c (:foreground ,magenta :bold ,bold :inverse-video t))))
;; Modeline ;; Modeline
`(mode-line ((,c (:foreground ,modeline-fg :background ,modeline-bg)))) `(narf-minibuffer-active ((,c (:background ,active-minibuffer))))
`(mode-line-inactive ((,c (:foreground ,modeline-fg-inactive :background ,modeline-bg-inactive)))) `(mode-line ((,c (:foreground ,modeline-fg :background ,modeline-bg
`(mode-line-is-modified ((,c (:foreground ,magenta :bold t)))) :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)))) `(mode-line-buffer-file ((,c (:foreground ,modeline-fg))))
`(powerline-active1 ((,c (:foreground ,modeline-fg-2 :background ,modeline-bg-2)))) `(powerline-active1 ((,c (:foreground ,modeline-fg-2 :background ,modeline-bg-2))))
`(powerline-active2 ((,c (:foreground ,modeline-fg-3 :background ,modeline-bg-3)))) `(powerline-active2 ((,c (:foreground ,modeline-fg-3 :background ,modeline-bg-3))))
`(powerline-inactive1 ((,c (:foreground ,modeline-fg-inactive)))) `(powerline-inactive1 ((,c (:foreground ,modeline-fg-inactive))))
`(powerline-inactive2 ((,c (:foreground ,modeline-fg-inactive)))) `(powerline-inactive2 ((,c (:foreground ,modeline-fg-inactive))))
`(spaceline-highlight-face ((,c (:foreground ,black :background ,highlight :bold t)))) `(spaceline-highlight-face ((,c (:foreground ,black :background ,highlight :bold ,bold))))
`(mode-line-count-face ((,c (:foreground ,black :background ,magenta :bold t)))) `(mode-line-count-face ((,c (:foreground ,black :background ,magenta :bold ,bold))))
;; Search ;; Search
`(isearch ((,c (:foreground ,search-fg :background ,search-bg)))) `(isearch ((,c (:foreground ,search-fg :background ,search-bg))))
`(isearch-lazy-highlight-face ((,c (:foreground ,search-rest-fg :background ,search-rest-bg)))) `(isearch-lazy-highlight-face ((,c (:foreground ,search-rest-fg :background ,search-rest-bg))))
`(narf-todo-face ((,c (:foreground ,yellow :bold t)))) `(narf-todo-face ((,c (:foreground ,yellow))))
`(narf-fixme-face ((,c (:foreground ,red :bold t)))) `(narf-fixme-face ((,c (:foreground ,red))))
`(narf-note-face ((,c (:foreground ,cyan :bold t)))) `(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)))) `(evil-search-highlight-persist-highlight-face ((,c (:background ,search-rest-bg))))
;; plugin-specific ;; plugin-specific
;; ***************************************************************************************** ;; *****************************************************************************************
@ -204,33 +232,33 @@
`(diff-hl-change ((,c (:foreground ,vc-modified)))) `(diff-hl-change ((,c (:foreground ,vc-modified))))
`(diff-hl-delete ((,c (:foreground ,vc-deleted)))) `(diff-hl-delete ((,c (:foreground ,vc-deleted))))
`(diff-hl-insert ((,c (:foreground ,vc-added)))) `(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+-modified ((,c (:foreground ,vc-modified :background nil))))
`(git-gutter+-added ((,c (:foreground ,vc-added :background nil)))) `(git-gutter+-added ((,c (:foreground ,vc-added :background nil))))
`(git-gutter+-deleted ((,c (:foreground ,vc-deleted :background nil)))) `(git-gutter+-deleted ((,c (:foreground ,vc-deleted :background nil))))
;; Rainbow delimiters ;; 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-2-face ((,c (:foreground ,orange))))
`(rainbow-delimiters-depth-3-face ((,c (:foreground ,yellow)))) `(rainbow-delimiters-depth-3-face ((,c (:foreground ,yellow))))
`(rainbow-delimiters-depth-4-face ((,c (:foreground ,green)))) `(rainbow-delimiters-depth-4-face ((,c (:foreground ,green))))
`(rainbow-delimiters-depth-5-face ((,c (:foreground ,cyan)))) `(rainbow-delimiters-depth-5-face ((,c (:foreground ,cyan))))
`(rainbow-delimiters-unmatched-face ((,c (:foreground ,red :inverse-video t)))) `(rainbow-delimiters-unmatched-face ((,c (:foreground ,red :inverse-video t))))
`(flyspell-incorrect ((,c (:underline (:style wave :color ,error-highlight) :inherit unspecified))))
;; Helm ;; Helm
`(helm-source-header ((,c (:background ,current-line :foreground ,grey-1))))
`(helm-selection ((,c (:background ,selection)))) `(helm-selection ((,c (:background ,selection))))
`(helm-swoop-target-line-face ((,c (:foreground ,highlight :inverse-video t))))
`(helm-match ((,c (:foreground ,magenta)))) `(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-ff-file ((,c (:foreground ,grey)))) `(helm-ff-file ((,c (:foreground ,grey))))
`(helm-ff-prefix ((,c (:foreground ,magenta)))) `(helm-ff-prefix ((,c (:foreground ,magenta))))
`(helm-ff-dotted-directory ((,c (:foreground ,grey-1)))) `(helm-ff-dotted-directory ((,c (:foreground ,grey-1))))
`(helm-ff-directory ((,c (:foreground ,orange :bold t)))) `(helm-ff-directory ((,c (:foreground ,orange))))
`(helm-ff-executable ((,c (:foreground ,white :slant italic)))) `(helm-ff-executable ((,c (:foreground ,white :slant italic))))
;; Avy ;; Avy
`(avy-lead-face-0 ((,c (:background ,orange :foreground ,black)))) `(avy-lead-face-0 ((,c (:background ,orange :foreground ,black))))
`(avy-lead-face-1 ((,c (:background ,orange :foreground ,black)))) `(avy-lead-face-1 ((,c (:background ,orange :foreground ,black))))
@ -241,11 +269,11 @@
;; ***************************************************************************************** ;; *****************************************************************************************
;; js2-mode ;; js2-mode
`(js2-function-param ((,c (:foreground ,variables)))) `(js2-function-param ((,c (:foreground ,variables))))
`(js2-jsdoc-tag ((,c (:foreground ,comments :bold t)))) `(js2-jsdoc-tag ((,c (:foreground ,comments))))
;; markdown-mode ;; markdown-mode
`(markdown-header-face ((,c (:foreground ,orange :bold t)))) `(markdown-header-face ((,c (:foreground ,orange :bold ,bold))))
`(markdown-header-delimiter-face ((,c (:foreground ,orange :bold t)))) `(markdown-header-delimiter-face ((,c (:foreground ,orange :bold ,bold))))
`(markdown-blockquote-face ((,c (:foreground ,blue+2)))) `(markdown-blockquote-face ((,c (:foreground ,blue+2))))
`(markdown-markup-face ((,c (:foreground ,cyan)))) `(markdown-markup-face ((,c (:foreground ,cyan))))
`(markdown-inline-face ((,c (:foreground ,cyan)))) `(markdown-inline-face ((,c (:foreground ,cyan))))
@ -278,11 +306,11 @@
`(org-block-end-line ((,c (:inherit org-block-begin-line)))) `(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-document-title ((,c (:inherit variable-pitch :foreground ,cyan :height 1.30 :bold ,bold))))
`(org-level-1 ((,c (:foreground ,orange :bold t)))) `(org-level-1 ((,c (:foreground ,orange :bold ,bold))))
`(org-level-2 ((,c (:foreground ,dark-cyan :bold t)))) `(org-level-2 ((,c (:foreground ,dark-cyan :bold ,bold))))
`(org-level-3 ((,c (:foreground ,violet :bold t)))) `(org-level-3 ((,c (:foreground ,violet :bold ,bold))))
`(org-level-4 ((,c (:foreground ,green :bold t)))) `(org-level-4 ((,c (:foreground ,green :bold ,bold))))
`(org-level-5 ((,c (:foreground ,yellow)))) `(org-level-5 ((,c (:foreground ,yellow))))
`(org-level-6 ((,c (:foreground ,blue+2)))) `(org-level-6 ((,c (:foreground ,blue+2))))
;;`(org-level-7 ((,c ()))) ;;`(org-level-7 ((,c ())))
@ -292,7 +320,7 @@
`(org-code ((,c (:foreground ,orange)))) `(org-code ((,c (:foreground ,orange))))
`(org-verbatim ((,c (:foreground ,green)))) `(org-verbatim ((,c (:foreground ,green))))
`(org-formula ((,c (:foreground ,cyan)))) `(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-footnote ((,c (:foreground ,orange))))
`(org-link ((,c (:underline t :foreground ,yellow :bold inherit)))) `(org-link ((,c (:underline t :foreground ,yellow :bold inherit))))
@ -310,12 +338,37 @@
`(org-block-background ((,c (:background ,current-line)))) `(org-block-background ((,c (:background ,current-line))))
`(org-todo-high ((,c (:foreground ,orange :bold inherit)))) `(org-todo-high ((,c (:foreground ,orange :bold inherit))))
`(org-todo-vhigh ((,c (:foreground ,magenta :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-whitespace ((,c (:inherit fixed-pitch))))
`(org-todo-checkbox ((,c (:inherit variable-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))
)
;; ***************************************************************************************** ;; *****************************************************************************************