The ciiiircle of liiiife

This commit is contained in:
Henrik Lissner 2015-11-25 06:00:49 -05:00
parent 0923903e93
commit 03c6c05677
29 changed files with 287 additions and 465 deletions

3
Cask
View file

@ -98,6 +98,7 @@
;; Quickrun -- core/core-quickrun.el ;; Quickrun -- core/core-quickrun.el
(depends-on "quickrun") (depends-on "quickrun")
(depends-on "repl-toggle")
;; Workgroups --- core/core-workgroups.el ;; Workgroups --- core/core-workgroups.el
(depends-on "workgroups2") (depends-on "workgroups2")
@ -144,6 +145,7 @@
(depends-on "tide") (depends-on "tide")
(depends-on "coffee-mode") (depends-on "coffee-mode")
(depends-on "company-tern") (depends-on "company-tern")
(depends-on "nodejs-repl")
;; Lua -- modules/module-lua.el ;; Lua -- modules/module-lua.el
(depends-on "lua-mode") (depends-on "lua-mode")
@ -169,6 +171,7 @@
(depends-on "hack-mode" (depends-on "hack-mode"
:git "https://github.com/facebook/hhvm" :git "https://github.com/facebook/hhvm"
:files ("hphp/hack/editor-plugins/emacs/*.el")) :files ("hphp/hack/editor-plugins/emacs/*.el"))
(depends-on "php-boris")
;; Python -- modules/module-python.el ;; Python -- modules/module-python.el
(depends-on "anaconda-mode") (depends-on "anaconda-mode")

View file

@ -4,13 +4,13 @@ all: update
update: autoloads update: autoloads
@echo "Updating repo" @echo "Updating repo"
@git pull | sed 's/^/ /' @git pull 2>&1 | sed 's/^/ /'
@cask install --verbose @cask install --verbose 2>&1 | sed 's/^/ /'
@echo "Updating outdated plugins" @echo "Updating outdated plugins"
@cask outdated | sed 's/^/ /' @cask outdated 2>&1 | sed 's/^/ /'
@cask update --verbose @cask update --verbose 2>&1 | sed 's/^/ /'
@echo "Compiling certain scripts" @echo "Compiling certain scripts"
@emacs -Q --batch -f batch-byte-compile init.el init-load-path.el core/core.el core/core-os-osx.el contrib/*.el @emacs -Q --batch -f batch-byte-compile init.el init-load-path.el core/core.el core/core-os-osx.el contrib/*.el 2>&1 | sed 's/^/ /'
clean: clean-extras clean-elc clean: clean-extras clean-elc

View file

@ -3,85 +3,93 @@
(use-package autoinsert (use-package autoinsert
:defer t :defer t
:init :init
(setq auto-insert-query nil) ; Don't prompt before insertion (setq auto-insert-query nil ; Don't prompt before insertion
(setq auto-insert-alist '()) auto-insert-alist '())
:config :config
(auto-insert-mode 1) (auto-insert-mode 1)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun auto-insert-template (rule)
(define-auto-insert
(nth 0 rule)
(vector `(lambda () (narf/auto-insert-snippet ,(nth 1 rule) ',(nth 2 rule) ,(nth 3 rule))))))
(add-template! "/\\.gitignore$" "__" 'gitignore-mode) (mapc 'auto-insert-template
`(;; General
("/\\.gitignore$" "__" gitignore-mode)
;; C/C++ ;; C/C++
(add-template! "/Makefile$" "__" 'makefile-gmake-mode) ("/Makefile$" "__" makefile-gmake-mode)
(add-template! "/main\\.\\(cc\\|cpp\\)$" "__main.cpp" 'c++-mode) ("/main\\.\\(cc\\|cpp\\)$" "__main.cpp" c++-mode)
(add-template! "/win32_\\.\\(cc\\|cpp\\)$" "__winmain.cpp" 'c++-mode) ("/win32_\\.\\(cc\\|cpp\\)$" "__winmain.cpp" c++-mode)
(add-template! "\\.\\([Hh]\\|hpp\\)$" "__.h" 'c++-mode) ("\\.\\([Hh]\\|hpp\\)$" "__.h" c++-mode)
(add-template! "\\.\\(cc\\|cpp\\)$" "__.cpp" 'c++-mode) ("\\.\\(cc\\|cpp\\)$" "__.cpp" c++-mode)
(add-template! "\\.c$" "__.c" 'c-mode) ("\\.c$" "__.c" c-mode)
;; Elisp ;; Elisp
(add-template! "\\.emacs\\.d/.+\\.el$" "__initfile" 'emacs-lisp-mode) ("\\.emacs\\.d/.+\\.el$" "__initfile" emacs-lisp-mode)
(add-template! "\\.emacs\\.d/private/\\(snippets\\|templates\\)/.+$" "__" 'snippet-mode) ("\\.emacs\\.d/private/\\(snippets\\|templates\\)/.+$" "__" snippet-mode)
;; Go ;; Go
(add-template! "/main\\.go$" "__main.go" 'go-mode t) ("/main\\.go$" "__main.go" go-mode t)
(add-template! "\\.go$" "__.go" 'go-mode) ("\\.go$" "__.go" go-mode)
;; HTML ;; HTML
(add-template! "\\.html$" "__.html" 'web-mode) ("\\.html$" "__.html" web-mode)
;; java ;; java
(add-template! "/src/.+/.+\\.java$" "__" 'java-mode) ("/src/.+/.+\\.java$" "__" java-mode)
(add-template! "/main\\.java$" "__main" 'java-mode) ("/main\\.java$" "__main" java-mode)
(add-template! "/build\\.gradle$" "__build.gradle" 'android-mode) ("/build\\.gradle$" "__build.gradle" android-mode)
;; Javascript ;; Javascript
(add-template! "\\.lbaction/.+/Info.plist$" "__Info.plst" 'lb6-mode) ("\\.lbaction/.+/Info.plist$" "__Info.plst" lb6-mode)
(add-template! "\\.lbaction/.+/\\(default\\|suggestions\\)\\.js$" "__default.js" 'lb6-mode) ("\\.lbaction/.+/\\(default\\|suggestions\\)\\.js$" "__default.js" lb6-mode)
(add-template! "/package\\.json$" "__package.json" 'json-mode) ("/package\\.json$" "__package.json" json-mode)
(add-template! "\\.\\(json\\|jshintrc\\)$" "__" 'json-mode) ("\\.\\(json\\|jshintrc\\)$" "__" json-mode)
;; Lua ;; Lua
(add-template! "/main\\.lua$" "__main.lua" 'love-mode) ("/main\\.lua$" "__main.lua" love-mode)
(add-template! "/conf\\.lua$" "__conf.lua" 'love-mode) ("/conf\\.lua$" "__conf.lua" love-mode)
;; Markdown ;; Markdown
(add-template! "\\.md$" "__" 'markdown-mode) ("\\.md$" "__" markdown-mode)
(add-template! "/_posts/.+\\.md$" "__jekyll-post" 'markdown-mode)
(add-template! "/_layouts/.+\\.html$" "__jekyll-layout.html" 'web-mode) ;; Org
(,(format "%s.+\\.org$" org-directory-contacts) "__contact.org" org-mode)
(,(format "%s.+\\.org$" org-directory-projects) "__projects.org" org-mode)
(,(format "%s.+\\.org$" org-directory-invoices) "__invoices.org" org-mode)
;; PHP ;; PHP
(add-template! "\\.class\\.php$" "__.class.php" 'php-mode) ("\\.class\\.php$" "__.class.php" php-mode)
(add-template! "\\.php$" "__" 'php-mode) ("\\.php$" "__" php-mode)
;; Python ;; Python
;; (add-template! "tests?/test_.+\\.py$" "__" 'nose-mode) ;;"tests?/test_.+\\.py$" "__" nose-mode)
;; (add-template! "/setup\\.py$" "__setup.py" 'python-mode) ;;"/setup\\.py$" "__setup.py" python-mode)
(add-template! "\\.py$" "__" 'python-mode) ("\\.py$" "__" python-mode)
;; Ruby ;; Ruby
(add-template! "/\\.rspec$" "__.rspec" 'rspec-mode) ("/\\.rspec$" "__.rspec" rspec-mode)
(add-template! "/spec_helper\\.rb$" "__helper" 'rspec-mode t) ("/spec_helper\\.rb$" "__helper" rspec-mode t)
(add-template! "_spec\\.rb$" "__" 'rspec-mode t) ("_spec\\.rb$" "__" rspec-mode t)
(add-template! "/Rakefile$" "__Rakefile" 'enh-ruby-mode t) ("/Rakefile$" "__Rakefile" enh-ruby-mode t)
(add-template! "/Gemfile$" "__Gemfile" 'enh-ruby-mode t) ("/Gemfile$" "__Gemfile" enh-ruby-mode t)
(add-template! "\\.gemspec$" "__.gemspec" 'enh-ruby-mode t) ("\\.gemspec$" "__.gemspec" enh-ruby-mode t)
(add-template! "/lib/.+\\.rb$" "__module" 'enh-ruby-mode t) ("/lib/.+\\.rb$" "__module" enh-ruby-mode t)
(add-template! "\\.rb$" "__" 'enh-ruby-mode) ("\\.rb$" "__" enh-ruby-mode)
;; Rust ;; Rust
(add-template! "/Cargo.toml$" "__Cargo.toml" 'rust-mode) ("/Cargo.toml$" "__Cargo.toml" rust-mode)
(add-template! "/main\\.rs$" "__main.rs" 'rust-mode) ("/main\\.rs$" "__main.rs" rust-mode)
;; SCSS ;; SCSS
(add-template! "/master\\.scss$" "__master.scss" 'scss-mode) ("/master\\.scss$" "__master.scss" scss-mode)
(add-template! "/normalize\\.scss$" "__normalize.scss" 'scss-mode) ("/normalize\\.scss$" "__normalize.scss" scss-mode)
(add-template! "\\.scss$" "__" 'scss-mode) ("\\.scss$" "__" scss-mode)
;; Shell scripts ;; Shell scripts
(add-template! "\\.z?sh$" "__" 'sh-mode) ("\\.z?sh$" "__" sh-mode)
) )))
(provide 'core-auto-insert) (provide 'core-auto-insert)
;;; core-auto-insert.el ends here ;;; core-auto-insert.el ends here

View file

@ -243,8 +243,8 @@ to abort the minibuffer."
(let (message-log-max) (let (message-log-max)
(if (and delete-selection-mode transient-mark-mode mark-active) (if (and delete-selection-mode transient-mark-mode mark-active)
(setq deactivate-mark t) (setq deactivate-mark t)
(when (get-buffer "*Completions*") ;; (when (get-buffer "*Completions*")
(delete-windows-on "*Completions*")) ;; (delete-windows-on "*Completions*"))
(abort-recursive-edit)))) (abort-recursive-edit))))
(after! evil (after! evil

View file

@ -23,7 +23,7 @@
hscroll-step 5 hscroll-step 5
hscroll-margin 6 hscroll-margin 6
shift-select-mode nil shift-select-mode t
tabify-regexp "^\t* [ \t]+" tabify-regexp "^\t* [ \t]+"
whitespace-style '(face tabs tab-mark) whitespace-style '(face tabs tab-mark)
whitespace-display-mappings whitespace-display-mappings
@ -219,28 +219,13 @@ details on NORECORD.")
t)) t))
(sp-local-pair 'web-mode "<" nil :when '(sp-web-mode-is-code-context)))) (sp-local-pair 'web-mode "<" nil :when '(sp-web-mode-is-code-context))))
;; (use-package smex
;; :commands (smex smex-major-mode-commands smex-initialize smex-update)
;; :init (setq smex-save-file (concat narf-temp-dir "smex-items"))
;; :config (smex-initialize)
;; ;; Hook up smex to auto-update, rather than update on every run
;; (defun smex-update-after-load (unused)
;; (when (boundp 'smex-cache) (smex-update)))
;; (add-hook 'after-load-functions 'smex-update-after-load))
(use-package help-fns+ ; Improved help commands (use-package help-fns+ ; Improved help commands
:commands (describe-buffer describe-command describe-file :commands (describe-buffer describe-command describe-file
describe-keymap describe-option describe-option-of-type)) describe-keymap describe-option describe-option-of-type))
(use-package saveplace
:defer t
:config (setq save-place-file (concat narf-temp-dir "saveplace"))
:init
;; Save cursor location across sessions. Only save for files that exist.
(add-hook! find-file
(when (file-exists-p (buffer-file-name))
(require 'saveplace) (require 'saveplace)
(setq save-place t)))) (setq save-place-file (concat narf-temp-dir "saveplace"))
(save-place-mode +1)
(provide 'core-editor) (provide 'core-editor)
;;; core-editor.el ends here ;;; core-editor.el ends here

View file

@ -29,10 +29,19 @@
evil-echo-state nil evil-echo-state nil
evil-ex-substitute-global t evil-ex-substitute-global t
evil-normal-state-tag "N"
evil-insert-state-tag "I"
evil-visual-state-tag "V"
evil-emacs-state-tag "E"
evil-operator-state-tag "O"
evil-motion-state-tag "M"
evil-replace-state-tag "R"
evil-iedit-state-tag "R+"
;; Color-coded state cursors ;; Color-coded state cursors
evil-default-cursor "orange" evil-default-cursor "orange"
evil-normal-state-cursor 'box evil-normal-state-cursor 'box
evil-emacs-state-cursor 'bar evil-emacs-state-cursor '("cyan" box)
evil-insert-state-cursor 'bar evil-insert-state-cursor 'bar
evil-visual-state-cursor 'hollow evil-visual-state-cursor 'hollow
evil-iedit-state-cursor 'box) evil-iedit-state-cursor 'box)
@ -53,9 +62,16 @@
(comint-mode . emacs) (comint-mode . emacs)
(term-mode . emacs) (term-mode . emacs)
(Info-mode . emacs) (Info-mode . emacs)
(view-mode . emacs)
(help-mode . normal) (help-mode . normal)
(message-mode . normal) (message-mode . normal)
(compilation-mode . normal))) (compilation-mode . normal)
(inferior-emacs-lisp-mode . emacs)
(calendar-mode . emacs)
(Man-mode . emacs)
(grep-mode . emacs)
(image-mode . emacs)
))
(evil-set-initial-state `,(car mode-map) `,(cdr mode-map))) (evil-set-initial-state `,(car mode-map) `,(cdr mode-map)))
;; Switch to normal mode before switching windows ;; Switch to normal mode before switching windows
@ -232,9 +248,9 @@
(use-package evil-jumper (use-package evil-jumper
:init :init
(setq evil-jumper-file (concat narf-temp-dir "jumplist") (setq evil-jumper-auto-center nil
evil-jumper-auto-center t evil-jumper-auto-save-interval 3600)
evil-jumper-auto-save-interval 3600)) :config (global-evil-jumper-mode +1))
(use-package evil-matchit (use-package evil-matchit
:commands (evilmi-jump-items evilmi-text-object global-evil-matchit-mode) :commands (evilmi-jump-items evilmi-text-object global-evil-matchit-mode)

View file

@ -84,7 +84,10 @@
;; Hide mode-line in helm windows ;; Hide mode-line in helm windows
(advice-add 'helm-display-mode-line :override 'narf*helm-hide-modeline) (advice-add 'helm-display-mode-line :override 'narf*helm-hide-modeline)
(helm-mode 1)) (helm-mode 1)
;; Don't override evil-ex's completion
(setq completion-in-region-function helm--old-completion-in-region-function))
(use-package projectile (use-package projectile
:diminish projectile-mode :diminish projectile-mode

View file

@ -22,6 +22,8 @@
(" *Org todo*" :position bottom :height 5) (" *Org todo*" :position bottom :height 5)
("*Org Links*" :position bottom :height 2) ("*Org Links*" :position bottom :height 2)
("^\\*CPU-Profiler-Report .+\\*$" :regexp t :position bottom :height 0.35) ("^\\*CPU-Profiler-Report .+\\*$" :regexp t :position bottom :height 0.35)
("*ruby*" :position bottom :height 0.3 :stick t)
("*ielm*" :position bottom :height 0.3 :stick t)
)) ))
(popwin-mode 1) (popwin-mode 1)

View file

@ -15,5 +15,18 @@
(add-to-list 'quickrun-file-alist '("\\.gvy$" . "groovy"))) (add-to-list 'quickrun-file-alist '("\\.gvy$" . "groovy")))
(use-package repl-toggle
:commands (rtog/toggle-repl rtog/add-repl)
:config
(setq rtog/goto-buffer-fun 'popwin:pop-to-buffer
rtog/mode-repl-alist
'((php-mode . php-boris)
(python-mode . run-python)
(lua-mode . run-lua)
(emacs-lisp-mode . ielm)
(ruby-mode . inf-ruby)
(js2-mode . nodejs-repl)))
)
(provide 'core-quickrun) (provide 'core-quickrun)
;;; core-quickrun.el ends here ;;; core-quickrun.el ends here

View file

@ -351,7 +351,8 @@ iedit."
;; Initialize modeline ;; Initialize modeline
(spaceline-install (spaceline-install
;; Left side ;; Left side
'(narf-anzu narf-iedit narf-evil-substitute '((evil-state :face highlight-face :when active)
narf-anzu narf-iedit narf-evil-substitute
(narf-buffer-path remote-host) (narf-buffer-path remote-host)
narf-buffer-modified narf-buffer-modified
narf-vc narf-vc

View file

@ -33,6 +33,8 @@
;; Create a new workgroup on switch-project ;; Create a new workgroup on switch-project
(setq projectile-switch-project-action 'narf/wg-projectile-switch-project)) (setq projectile-switch-project-action 'narf/wg-projectile-switch-project))
(add-hook! wg-before-switch-to-workgroup 'popwin:close-popup-window)
;; Initialize! ;; Initialize!
(add-hook! after-init (add-hook! after-init
(workgroups-mode 1) (workgroups-mode 1)

View file

@ -52,6 +52,7 @@
"<S-tab>" 'yas-prev-field "<S-tab>" 'yas-prev-field
"<M-backspace>" 'narf/yas-clear-to-sof "<M-backspace>" 'narf/yas-clear-to-sof
"<escape>" 'evil-normal-state
[backspace] 'narf/yas-backspace [backspace] 'narf/yas-backspace
"<delete>" 'narf/yas-delete) "<delete>" 'narf/yas-delete)
@ -69,7 +70,8 @@
;; right due to an off-by-one issue. ;; right due to an off-by-one issue.
(defadvice yas-expand-snippet (around yas-expand-snippet-visual-line activate) (defadvice yas-expand-snippet (around yas-expand-snippet-visual-line activate)
(when (narf/evil-visual-line-state-p) (when (narf/evil-visual-line-state-p)
(ad-set-arg 2 (1- (ad-get-arg 2)))) ad-do-it)) (ad-set-arg 2 (1- (ad-get-arg 2)))) ad-do-it)
)
(provide 'core-yasnippet) (provide 'core-yasnippet)
;;; core-yasnippet.el ends here ;;; core-yasnippet.el ends here

View file

@ -69,24 +69,25 @@
(cons (format "\\%s{" command) "}"))) (cons (format "\\%s{" command) "}")))
;;;###autoload (autoload 'narf/evil-macro-on-all-lines "defuns-evil" nil t) ;;;###autoload (autoload 'narf/evil-macro-on-all-lines "defuns-evil" nil t)
(evil-define-operator narf/evil-macro-on-all-lines (beg end &optional arg) (evil-define-operator narf/evil-macro-on-all-lines (beg end &optional macro)
"Apply macro to each line. Courtesy of PythonNut/emacs-config" "Apply macro to each line."
(evil-with-state :motion nil
(evil-normal-state) :move-point nil
(goto-char end) (interactive "<r><a>")
(evil-visual-state) (unless (and beg end)
(goto-char beg) (setq beg (region-beginning)
(evil-ex-normal (region-beginning) (region-end) end (region-end)))
(evil-ex-normal beg end
(concat "@" (concat "@"
(single-key-description (single-key-description
(read-char "What macro?")))))) (or macro (read-char "@-"))))))
;;;###autoload ;;;###autoload
(defmacro define-text-object! (key start-regex end-regex) (defmacro define-text-object! (key start-regex end-regex)
(let ((inner-name (make-symbol "narf--inner-name")) (let ((inner-name (make-symbol "narf--inner-name"))
(outer-name (make-symbol "narf--outer-name"))) (outer-name (make-symbol "narf--outer-name")))
`(progn `(progn
(evil-define-text-object ,inner-name (count &optional beg end type) (evil-define-text-object ,"inner"-name (count &optional beg end type)
(evil-select-paren ,start-regex ,end-regex beg end type count nil)) (evil-select-paren ,start-regex ,end-regex beg end type count nil))
(evil-define-text-object ,outer-name (count &optional beg end type) (evil-define-text-object ,outer-name (count &optional beg end type)
(evil-select-paren ,start-regex ,end-regex beg end type count t)) (evil-select-paren ,start-regex ,end-regex beg end type count t))

View file

@ -38,8 +38,8 @@
;; Ex-mode interface for `helm-ag'. If `bang', then `search' is interpreted as ;; Ex-mode interface for `helm-ag'. If `bang', then `search' is interpreted as
;; regexp. ;; regexp.
;;;###autoload (autoload 'narf:helm-search "defuns-helm" nil t) ;;;###autoload (autoload 'narf:helm-ag-search "defuns-helm" nil t)
(evil-define-operator narf:helm-search (beg end &optional search hidden-files-p pwd-p regex-p) (evil-define-operator narf:helm-ag-search (beg end &optional search hidden-files-p pwd-p regex-p)
:type inclusive :type inclusive
:repeat nil :repeat nil
(interactive "<r><a><!>") (interactive "<r><a><!>")
@ -61,25 +61,25 @@
:keymap helm-ag-map :keymap helm-ag-map
:input input))) :input input)))
;;;###autoload (autoload 'narf:helm-regex-search "defuns-helm" nil t) ;;;###autoload (autoload 'narf:helm-ag-regex-search "defuns-helm" nil t)
(evil-define-operator narf:helm-regex-search (beg end &optional search bang) (evil-define-operator narf:helm-ag-regex-search (beg end &optional search bang)
:type inclusive :repeat nil :type inclusive :repeat nil
(interactive "<r><a><!>") (interactive "<r><a><!>")
(narf:helm-search beg end search bang nil t)) (narf:helm-ag-search beg end search bang nil t))
;;;###autoload (autoload 'narf:helm-regex-cwd "defuns-helm" nil t) ;;;###autoload (autoload 'narf:helm-ag-search-cwd "defuns-helm" nil t)
(evil-define-operator narf:helm-search-cwd (beg end &optional search bang) (evil-define-operator narf:helm-ag-search-cwd (beg end &optional search bang)
;; Ex-mode interface for `helm-do-ag'. If `bang', then `search' is interpreted ;; Ex-mode interface for `helm-do-ag'. If `bang', then `search' is interpreted
;; as regexp ;; as regexp
:type inclusive :repeat nil :type inclusive :repeat nil
(interactive "<r><a><!>") (interactive "<r><a><!>")
(narf:helm-search beg end search bang t nil)) (narf:helm-ag-search beg end search bang t nil))
;;;###autoload (autoload 'narf:helm-regex-search-cwd "defuns-helm" nil t) ;;;###autoload (autoload 'narf:helm-ag-regex-search-cwd "defuns-helm" nil t)
(evil-define-operator narf:helm-regex-search-cwd (beg end &optional search bang) (evil-define-operator narf:helm-ag-regex-search-cwd (beg end &optional search bang)
:type inclusive :repeat nil :type inclusive :repeat nil
(interactive "<r><a><!>") (interactive "<r><a><!>")
(narf:helm-search beg end search bang t t)) (narf:helm-ag-search beg end search bang t t))
;; Ex-mode interface for `helm-swoop', `helm-multi-swoop-all' (if `bang'), or ;; Ex-mode interface for `helm-swoop', `helm-multi-swoop-all' (if `bang'), or
;; `helm-css-scss' and `helm-css-scss-multi' (if `bang') if major-mode is ;; `helm-css-scss' and `helm-css-scss-multi' (if `bang') if major-mode is

View file

@ -3,16 +3,14 @@
;;;###autoload ;;;###autoload
(defun narf|yas-before-expand () (defun narf|yas-before-expand ()
"Switch to insert mode when expanding a template via backtab, or go back to "Strip out the shitespace before a line selection."
normal mode if there are no fields."
;; Strip out the shitespace before a line selection.
(when (narf/evil-visual-line-state-p) (when (narf/evil-visual-line-state-p)
(setq yas-selected-text (setq-local
yas-selected-text
(replace-regexp-in-string (replace-regexp-in-string
"\\(^ *\\|\n? $\\)" "" "\\(^ *\\|\n? $\\)" ""
(buffer-substring-no-properties (region-beginning) (buffer-substring-no-properties (region-beginning)
(1- (region-end)))))) (1- (region-end)))))))
(evil-insert-state +1))
;;;###autoload ;;;###autoload
(defun narf|yas-after-expand () (defun narf|yas-after-expand ()
@ -26,7 +24,10 @@ normal mode if there are no fields."
normal mode if there are no fields." normal mode if there are no fields."
(interactive) (interactive)
(yas-insert-snippet) (yas-insert-snippet)
(evil-insert-state +1)) (let* ((snippet (first (yas--snippets-at-point)))
(fields (yas--snippet-fields snippet)))
(evil-insert-state +1)
(when fields (evil-change-state 'normal))))
;;;###autoload ;;;###autoload
(defun narf/yas-goto-start-of-field () (defun narf/yas-goto-start-of-field ()

View file

@ -1,21 +0,0 @@
;;; macros-auto-insert.el
;; for ../core-auto-insert.el
;;;###autoload
(defmacro add-template! (regexp-or-major-mode uuid yas-mode &optional project-only)
`(define-auto-insert ,(if (stringp regexp-or-major-mode)
regexp-or-major-mode
(eval regexp-or-major-mode))
(lambda ()
(unless (or (and ,project-only (not (narf/project-p)))
(not (or (eq major-mode ,yas-mode)
(and (boundp ,yas-mode)
(symbol-value ,yas-mode)))))
(insert ,uuid)
(yas-expand-from-trigger-key)
(if (string-equal ,uuid (s-trim (buffer-string)))
(erase-buffer)
(evil-insert-state 1))))))
(provide 'macros-auto-insert)
;;; macros-auto-insert.el ends here

View file

@ -1,145 +0,0 @@
;;; defuns-org-custom.el -- custom functions, links, etc. for Org-mode
;;; Custom links
(defun narf--org-id-to-file (id dir &optional pattern)
(let* ((glob (f-glob (format (concat "%s" (or pattern "%s-*.org")) dir id)))
(glob-len (length glob)))
(when (zerop glob-len)
(user-error "Could not find file with that ID"))
(car glob)))
;;;###autoload
(defun narf/org-link-contact (id)
(org-open-file (narf--org-id-to-file id org-directory-contacts) t))
;;;###autoload
(defun narf/org-link-project (id)
(org-open-file (narf--org-id-to-file id org-directory-projects) t))
;;;###autoload
(defun narf/org-link-invoice (id)
(org-open-file (narf--org-id-to-file id org-directory-invoices "%s.org") t))
;;;###autoload
(defun narf/org-complete (type)
(let ((default-directory (symbol-value (intern (format "org-directory-%ss" type)))))
(let* ((file (org-iread-file-name ">>> "))
(match (s-match "^\\([0-9]+\\)[-.]" (f-filename file))))
(unless match
(user-error "Invalid file ID"))
(format "%s:%s" type (cadr match)))))
;;;###autoload
(defun org-contact-complete-link ()
(narf/org-complete "contact"))
;;;###autoload
(defun org-project-complete-link ()
(narf/org-complete "project"))
;;;###autoload
(defun org-invoice-complete-link ()
(narf/org-complete "invoice"))
;;; Personal CRM
;; (defvar narf--helm-org-cache '())
(defvar narf--helm-org-files '())
(defun narf--helm-org-init ()
(setq narf--helm-org-files
(mapcar 'narf--helm-org-metadata
(f-entries narf--helm-org-dir (lambda (f) (and (f-ext? f "org") (> (f-size f) 0))) t))))
(defun narf--helm-org-metadata (file &optional params)
(let ((params (or params narf--helm-org-params))
(base (f-base file))
alist content title)
(with-temp-buffer
(insert-file-contents file nil nil nil t)
(setq content (concat (buffer-string))))
(setq title (let ((title (deft-parse-title file content)))
(if (string= title "")
"-"
title)))
(setq alist
(list file
(cons 'id (substring base 0 (string-match "-" base)))
(cons 'path file)
(cons 'title title)
(cons 'summary (truncate-string-to-width
(replace-regexp-in-string
"[\n\t]" " "
(if title
(if (string-match (regexp-quote "#+end_src") content)
(deft-chomp (substring content (match-end 0)
(string-match "^\\* " content (match-end 0))))
"")
content)
content)
(window-width)))))
(mapc (lambda (p)
(let ((value (if (string-match (concat "^" (symbol-name p) ": +\\(.*\\)$") content)
(substring content (match-beginning 1) (match-end 1)))))
(when value
(add-to-list 'alist (cons p value) t))))
params)
alist))
(defvar narf--helm-org-title "Org files")
(defvar narf--helm-org-dir org-directory)
(defvar narf--helm-org-params '(created contact email country issued paid))
(defun narf/helm-org-candidates ()
narf--helm-org-files)
(defun narf/helm-org-real-to-display (alist)
(format "[%s] [%s] %-20s -- (%s) %s"
(cdr-safe (assoc 'id alist))
(cdr-safe (assoc 'created alist))
(cdr-safe (assoc 'title alist))
(or (cdr-safe (assoc 'contact alist))
(cdr-safe (assoc 'email alist))
(cdr-safe (assoc 'country alist))
"")
(cdr-safe (assoc 'summary alist))))
(defun narf/helm-org-action (alist)
(find-file (cdr-safe (assoc 'path alist))))
(defun narf--helm-org ()
(require 'deft)
(helm :sources (helm-build-sync-source narf--helm-org-title
:init 'narf--helm-org-init
:candidates 'narf/helm-org-candidates
:real-to-display 'narf/helm-org-real-to-display
:action 'narf/helm-org-action)
:buffer "*helm-deft*"))
;;;###autoload
(defun narf/helm-org-index ()
(interactive)
(let ((narf--helm-org-dir org-directory)
(narf--helm-org-params '()))
(narf--helm-org)))
;;;###autoload
(defun narf/helm-org-projects ()
(interactive)
(let ((narf--helm-org-dir org-directory-projects))
(narf--helm-org)))
;;;###autoload
(defun narf/helm-org-contacts ()
(interactive)
(let ((narf--helm-org-dir org-directory-contacts))
(narf--helm-org)))
;;;###autoload
(defun narf/helm-org-invoices ()
(interactive)
(let ((narf--helm-org-dir org-directory-invoices))
(narf--helm-org)))
;;;###autoload
(defun narf/helm-org-writing ()
(interactive)
(let ((narf--helm-org-dir (expand-file-name "writing/" org-directory))
(narf--helm-org-params '()))
(narf--helm-org)))
(provide 'defuns-org-custom)
;;; defuns-org-custom.el ends here

View file

@ -113,39 +113,6 @@
(defun narf/org-surround (delim) (defun narf/org-surround (delim)
(insert delim) (save-excursion (insert delim))) (insert delim) (save-excursion (insert delim)))
;;;###autoload (autoload 'narf:org-search-files-or-headers "defuns-org" nil t)
(evil-define-command narf:org-search-files-or-headers (&optional bang)
(interactive "<!>")
(require 'org)
(if bang
(ido-find-file-in-dir org-directory)
(call-interactively 'helm-org-agenda-files-headings)))
;;;###autoload
(defun narf:org-list-attachments ()
"Find files in org-attachment directory"
(interactive)
(let* ((enable-recursive-minibuffers t)
(files (find-lisp-find-files org-attach-directory "."))
(file-assoc-list
(mapcar (lambda (x)
(cons (file-name-nondirectory x)
x))
files))
(filename-list
(remove-duplicates (mapcar #'car file-assoc-list)
:test #'string=))
(filename (ido-completing-read "Org attachments: " filename-list nil t))
(longname (cdr (assoc filename file-assoc-list))))
(ido-set-current-directory
(if (file-directory-p longname)
longname
(file-name-directory longname)))
(setq ido-exit 'refresh
ido-text-init ido-text
ido-rotate-temp t)
(exit-minibuffer)))
;;;###autoload ;;;###autoload
(defun narf/org-word-count (beg end &optional count-footnotes?) (defun narf/org-word-count (beg end &optional count-footnotes?)
"Report the number of words in the Org mode buffer or selected region. "Report the number of words in the Org mode buffer or selected region.
@ -218,22 +185,6 @@ COUNT-FOOTNOTES? is non-nil."
(message (format "%d words in %s." wc (message (format "%d words in %s." wc
(if mark-active "region" "buffer"))))) (if mark-active "region" "buffer")))))
;;;###autoload (autoload 'narf:org-attach "defuns-org" nil t)
(evil-define-command narf:org-attach (&optional link)
(interactive "<a>")
(require 'org-attach)
(let ((path ".attach")
(new-name (concat (int-to-string (truncate (float-time))) "-" (f-filename link)))
new-path)
(unless (file-exists-p path)
(make-directory path))
(when path
(setq new-path (format "%s/%s" path new-name))
(cond ((string-match-p "^https?://" link)
(url-copy-file link new-path))
(t (copy-file link new-path)))
(insert (format "[[./%s]]" (abbreviate-file-name new-path))))))
;;;###autoload (autoload 'narf:org-export "defuns-org" nil t) ;;;###autoload (autoload 'narf:org-export "defuns-org" nil t)
(evil-define-command narf:org-export (dest) (evil-define-command narf:org-export (dest)
(interactive "<a>") (interactive "<a>")
@ -324,16 +275,14 @@ re-align the table if necessary. (Necessary because org-mode has a
(when (org-looking-at-p " ") (forward-char)))) (when (org-looking-at-p " ") (forward-char))))
;;;###autoload ;;;###autoload
(defun narf/org-replace-link-by-link-description () (defun narf/-org-capture-changelog ()
"Replace an org link by its description or if empty its address" ;; TODO
(interactive) )
(if (org-in-regexp org-bracket-link-regexp 1)
(let ((remove (list (match-beginning 0) (match-end 0))) ;;;###autoload
(description (if (match-end 3) (defun narf/-org-capture-choose ()
(org-match-string-no-properties 3) ;; TODO
(org-match-string-no-properties 1)))) )
(apply 'delete-region remove)
(insert description))))
(provide 'defuns-org) (provide 'defuns-org)
;;; defuns-org.el ends here ;;; defuns-org.el ends here

View file

@ -106,5 +106,7 @@
coffee-tab-width 2 coffee-tab-width 2
coffee-indent-like-python-mode t)) coffee-indent-like-python-mode t))
(use-package nodejs-repl :defer t)
(provide 'module-js) (provide 'module-js)
;;; module-js.el ends here ;;; module-js.el ends here

View file

@ -40,6 +40,7 @@
org-footnote-auto-label 'plain org-footnote-auto-label 'plain
org-log-done t org-log-done t
org-agenda-window-setup 'other-window org-agenda-window-setup 'other-window
org-agenda-skip-unavailable-files t
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)")
@ -141,7 +142,7 @@
'org-babel-load-languages 'org-babel-load-languages
'((python . t) (ruby . t) (sh . t) (js . t) (css . t) '((python . t) (ruby . t) (sh . t) (js . t) (css . t)
(plantuml . t) (emacs-lisp . t) (matlab . t) (plantuml . t) (emacs-lisp . t) (matlab . t)
(latex . t) (calc . t) (latex . t) (calc . t) (lisp . t)
(http . t) (rust . t) (go . t))) (http . t) (rust . t) (go . t)))
(setq org-plantuml-jar-path puml-plantuml-jar-path) (setq org-plantuml-jar-path puml-plantuml-jar-path)
@ -272,7 +273,10 @@ will function properly."
(setq line-spacing '0.2) (setq line-spacing '0.2)
(variable-pitch-mode 1) (variable-pitch-mode 1)
(defun narf|org-update-statistics-cookies () (org-update-statistics-cookies t)) (defun narf|org-update-statistics-cookies ()
(when (file-exists-p buffer-file-name)
(org-update-statistics-cookies t)))
(add-hook 'before-save-hook 'narf|org-update-statistics-cookies nil t) (add-hook 'before-save-hook 'narf|org-update-statistics-cookies nil t)
(add-hook 'evil-insert-state-exit-hook 'narf|org-update-statistics-cookies nil t) (add-hook 'evil-insert-state-exit-hook 'narf|org-update-statistics-cookies nil t)
@ -308,9 +312,9 @@ will function properly."
(add-hook 'org-mode-hook 'narf|org-hook) (add-hook 'org-mode-hook 'narf|org-hook)
(org-add-link-type "contact" 'narf/org-link-contact) (org-add-link-type "contact" 'narf/org-crm-link-contact)
(org-add-link-type "project" 'narf/org-link-project) (org-add-link-type "project" 'narf/org-crm-link-project)
(org-add-link-type "invoice" 'narf/org-link-invoice) (org-add-link-type "invoice" 'narf/org-crm-link-invoice)
(add-to-list 'recentf-exclude (expand-file-name "%s.+\\.org$" org-directory)) (add-to-list 'recentf-exclude (expand-file-name "%s.+\\.org$" org-directory))
(after! helm (after! helm
@ -346,18 +350,17 @@ will function properly."
(define-text-object! "=" "=" "=") (define-text-object! "=" "=" "=")
(define-text-object! "~" "~" "~")) (define-text-object! "~" "~" "~"))
;;; File templates
(after! autoinsert
(add-template! (format "%s.+\\.org$" org-directory-contacts) "__contact.org" 'org-mode)
(add-template! (format "%s.+\\.org$" org-directory-projects) "__projects.org" 'org-mode)
(add-template! (format "%s.+\\.org$" org-directory-invoices) "__invoices.org" 'org-mode))
;;; Plugins ;;; Plugins
(require 'org-download) (require 'org-download)
(setq-default (setq-default
org-download-image-dir ".attach/" 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-screenshot-method "screencapture -i %s")
(defun org-download--dir-2 ()
(f-base (buffer-file-name)))
;;; Auto-completion ;;; Auto-completion
(after! company (after! company
(require 'company-math) (require 'company-math)
@ -426,8 +429,7 @@ will function properly."
:n ",f" 'org-sparse-tree :n ",f" 'org-sparse-tree
:n ",?" 'org-tags-view :n ",?" 'org-tags-view
:n ",e" 'org-edit-special :n ",e" 'org-edit-special
:n ",a" 'org-attach :n ",a" 'org-agenda
:n ",A" 'org-agenda
:n ",D" 'org-time-stamp-inactive :n ",D" 'org-time-stamp-inactive
:n ",i" 'narf/org-toggle-inline-images-at-point :n ",i" 'narf/org-toggle-inline-images-at-point
:n ",t" 'org-todo :n ",t" 'org-todo
@ -435,6 +437,7 @@ will function properly."
:n ",d" 'org-time-stamp :n ",d" 'org-time-stamp
:n ",r" 'org-refile :n ",r" 'org-refile
:n ",s" 'org-schedule :n ",s" 'org-schedule
:n ",oa" 'narf/org-reveal-attachments
:n ", SPC" 'narf/org-toggle-checkbox :n ", SPC" 'narf/org-toggle-checkbox
:n ", RET" 'org-archive-subtree :n ", RET" 'org-archive-subtree
@ -462,7 +465,7 @@ will function properly."
:n "go" 'org-open-at-point :n "go" 'org-open-at-point
:n "gO" (λ (let ((org-link-frame-setup (append '((file . find-file-other-window)) org-link-frame-setup)) :n "gO" (λ (let ((org-link-frame-setup (append '((file . find-file-other-window)) org-link-frame-setup))
(org-file-apps '(("\\.org$" . emacs) (org-file-apps '(("\\.org$" . emacs)
(t . "qlmanage -p \"%s\"")))) (t . "open \"%s\""))))
(call-interactively 'org-open-at-point))) (call-interactively 'org-open-at-point)))
:n "gQ" 'org-fill-paragraph :n "gQ" 'org-fill-paragraph

View file

@ -24,6 +24,8 @@
(require 'php-refactor-mode) (require 'php-refactor-mode)
(add-hook! php-mode '(turn-on-eldoc-mode emr-initialize php-refactor-mode))) (add-hook! php-mode '(turn-on-eldoc-mode emr-initialize php-refactor-mode)))
(use-package php-boris :defer t)
(use-package hack-mode :mode "\\.hh$") (use-package hack-mode :mode "\\.hh$")
(provide 'module-php) (provide 'module-php)

View file

@ -29,6 +29,7 @@
"M-t" 'helm-projectile-find-file "M-t" 'helm-projectile-find-file
"A-`" 'narf-switch-to-iterm "A-`" 'narf-switch-to-iterm
"C-`" 'narf/popup-toggle "C-`" 'narf/popup-toggle
"C-~" 'rtog/toggle-repl
"<f9>" 'what-face "<f9>" 'what-face
"M-w" 'evil-window-delete "M-w" 'evil-window-delete
@ -202,7 +203,8 @@
:m "gl" 'avy-goto-line :m "gl" 'avy-goto-line
:m "g]" 'smart-right :m "g]" 'smart-right
:m "g[" 'smart-left :m "g[" 'smart-left
:no "g@" 'narf/evil-macro-on-all-lines :v "@" 'narf/evil-macro-on-all-lines
:n "g@" 'narf/evil-macro-on-all-lines
:v "." 'evil-repeat :v "." 'evil-repeat

View file

@ -5,10 +5,10 @@
(exmap "a" 'helm-projectile-find-other-file) (exmap "a" 'helm-projectile-find-other-file)
(exmap "acomp[ile]" 'narf:compile-autoloads) (exmap "acomp[ile]" 'narf:compile-autoloads)
(exmap "ag" 'narf:helm-search) (exmap "ag" 'narf:helm-ag-search)
(exmap "ag[cw]d" 'narf:helm-search-cwd) (exmap "ag[cw]d" 'narf:helm-ag-search-cwd)
(exmap "agr" 'narf:helm-regex-search) (exmap "agr" 'narf:helm-ag-regex-search)
(exmap "agr[cw]d" 'narf:helm-regex-search-cwd) (exmap "agr[cw]d" 'narf:helm-ag-regex-search-cwd)
(exmap "al[ign]" 'narf:whitespace-align) (exmap "al[ign]" 'narf:whitespace-align)
(exmap "bcomp[ile]" 'narf:compile-el) (exmap "bcomp[ile]" 'narf:compile-el)
(exmap "big" 'narf:toggle-big-mode) (exmap "big" 'narf:toggle-big-mode)
@ -44,6 +44,7 @@
(exmap "fi[nd]" 'narf:helm-swoop) (exmap "fi[nd]" 'narf:helm-swoop)
(exmap "tsnip[pets]" 'narf:yas-file-templates) ; tsnip[!] (exmap "tsnip[pets]" 'narf:yas-file-templates) ; tsnip[!]
(exmap "x" 'narf:scratch-buffer) (exmap "x" 'narf:scratch-buffer)
(exmap "@" 'narf/evil-macro-on-all-lines)
(exmap "t[mux]" 'narf:send-to-tmux) (exmap "t[mux]" 'narf:send-to-tmux)
(exmap "tcd" (λ (narf:send-to-tmux (format "cd '%s'" default-directory)))) (exmap "tcd" (λ (narf:send-to-tmux (format "cd '%s'" default-directory))))

View file

@ -1,7 +0,0 @@
# -*- mode: snippet -*-
# group: file templates
# contributor: Henrik Lissner
# --
#include "`(file-name-nondirectory (file-name-sans-extension (buffer-file-name)))`.h"
$0

View file

@ -1,7 +0,0 @@
# -*- mode: snippet -*-
# group: file templates
# contributor: Henrik Lissner
# --
#include "`(file-name-nondirectory (file-name-sans-extension (buffer-file-name)))`.h"
$0

View file

@ -1,10 +0,0 @@
# -*- mode: snippet -*-
# group: file templates
# contributor: Henrik Lissner
# --
#ifndef ${1:__`(upcase (f-base buffer-file-name))`_H_$(upcase yas-text)}
#define $1
$0
#endif // $1

View file

@ -1,6 +1,3 @@
# -*- mode: snippet -*-
# contributor: Henrik Lissner
# --
## ##
# ${1:Project Title} # ${1:Project Title}
# #

View file

@ -1,7 +1,7 @@
;; NARF Dark ;; NARF Dark
;; By Henrik Lissner <http://github.com/hlissner/emacs.d> ;; By Henrik Lissner <http://github.com/hlissner/emacs.d>
(deftheme narf-dark "A dark theme for narfy emacs, inspired by Molokai.") (deftheme narf-dark "A dark theme for narfy emacs, inspired by Molokai")
(custom-theme-set-variables 'narf-dark) (custom-theme-set-variables 'narf-dark)
@ -40,7 +40,7 @@
(search-rest-fg black) (search-rest-fg black)
(highlight orange) (highlight orange)
(vertical-bar grey-2) (vertical-bar grey-2)
(current-line "#232526") (current-line "#262829")
(selection "#535556") (selection "#535556")
(builtin orange) (builtin orange)
(comments grey-1) (comments grey-1)
@ -49,7 +49,7 @@
(functions cyan) (functions cyan)
(keywords magenta) (keywords magenta)
(methods dark-cyan) (methods dark-cyan)
(operators grey) (operators violet)
(type cyan) (type cyan)
(strings green) (strings green)
(variables orange) (variables orange)
@ -84,17 +84,22 @@
`(hl-line ((,c (:background ,current-line)))) `(hl-line ((,c (:background ,current-line))))
`(region ((,c (:background ,grey-2 :foreground ,white)))) `(region ((,c (:background ,grey-2 :foreground ,white))))
`(highlight ((,c (:foreground ,yellow :inverse-video t)))) `(highlight ((,c (:foreground ,yellow :inverse-video t))))
`(shadow ((,c (:foreground ,cyan)))) `(shadow ((,c (:foreground ,orange))))
;; `(secondary-selection ((,c (:background ,orange)))) ;; `(secondary-selection ((,c (:background ,orange))))
;; `(lazy-highlight ((,c (:background ,orange)))) ;; `(lazy-highlight ((,c (:background ,orange))))
;; `(match ((,c (:background ,magenta)))) ;; `(match ((,c (:background ,magenta))))
`(scroll-bar ((,c (:background ,green))))
`(error ((,c (:foreground ,red :bold t)))) `(error ((,c (:foreground ,red :bold t))))
`(warning ((,c (:foreground ,yellow :bold t)))) `(warning ((,c (:foreground ,yellow :bold t))))
`(success ((,c (:foreground ,green :bold t)))) `(success ((,c (:foreground ,green :bold t))))
`(spaceline-flycheck-error ((,c (:bold t :foreground ,red))))
`(spaceline-flycheck-warning ((,c (:bold t :foreground ,yellow))))
`(spaceline-flycheck-info ((,c (:bold t :foreground ,green))))
`(hs-face ((,c (:foreground ,comments :background ,black)))) `(hs-face ((,c (:foreground ,comments :background ,black))))
`(hs-fringe-face ((,c (:foreground ,grey :background ,current-line)))) `(hs-fringe-face ((,c (:foreground ,orange))))
`(font-lock-builtin-face ((,c (:foreground ,builtin)))) `(font-lock-builtin-face ((,c (:foreground ,builtin))))
`(font-lock-comment-face ((,c (:foreground ,comments)))) `(font-lock-comment-face ((,c (:foreground ,comments))))
@ -104,14 +109,14 @@
`(font-lock-constant-face ((,c (:foreground ,constants)))) `(font-lock-constant-face ((,c (:foreground ,constants))))
`(font-lock-function-name-face ((,c (:foreground ,functions)))) `(font-lock-function-name-face ((,c (:foreground ,functions))))
`(font-lock-keyword-face ((,c (:foreground ,keywords)))) `(font-lock-keyword-face ((,c (:foreground ,keywords))))
;;`(font-lock-negation-char-face ((,class ())))
;;`(font-lock-preprocessor-char-face ((,class ())))
;;`(font-lock-regexp-grouping-backslash ((,class ())))
;;`(font-lock-regexp-grouping-construct ((,class ())))
`(font-lock-string-face ((,c (:foreground ,strings)))) `(font-lock-string-face ((,c (:foreground ,strings))))
`(font-lock-type-face ((,c (:foreground ,type)))) `(font-lock-type-face ((,c (:foreground ,type))))
`(font-lock-variable-name-face ((,c (:foreground ,variables)))) `(font-lock-variable-name-face ((,c (:foreground ,variables))))
`(font-lock-warning-face ((,c (:foreground ,red)))) `(font-lock-warning-face ((,c (:foreground ,red))))
`(font-lock-negation-char-face ((,c (:foreground ,operators))))
`(font-lock-preprocessor-char-face ((,c (:foreground ,operators))))
`(font-lock-regexp-grouping-backslash ((,c (:foreground ,operators))))
`(font-lock-regexp-grouping-construct ((,c (:foreground ,operators))))
`(bold ((,c (:weight bold :foreground ,white)))) `(bold ((,c (:weight bold :foreground ,white))))
`(italic ((,c (:slant italic :foreground ,subtle)))) `(italic ((,c (:slant italic :foreground ,subtle))))
@ -137,9 +142,8 @@
`(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)))) `(spaceline-highlight-face ((,c (:foreground ,black :background ,highlight :bold t))))
`(mode-line-iedit-face ((,c (:foreground ,black :background ,magenta)))) `(mode-line-count-face ((,c (:foreground ,black :background ,magenta :bold t))))
`(mode-line-substitute-face ((,c (:foreground ,black :background ,yellow))))
;; Search ;; Search
`(isearch ((,c (:foreground ,search-fg :background ,search-bg)))) `(isearch ((,c (:foreground ,search-fg :background ,search-bg))))
@ -205,14 +209,22 @@
`(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 ,bg :background ,red)))) `(rainbow-delimiters-unmatched-face ((,c (:foreground ,red :inverse-video t))))
`(flyspell-incorrect ((,c (:underline (:style wave :color ,error-highlight) :inherit unspecified)))) `(flyspell-incorrect ((,c (:underline (:style wave :color ,error-highlight) :inherit unspecified))))
;; Helm ;; Helm
`(helm-source-header ((,c (:background ,bg :foreground ,bg :height 0.1)))) `(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-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))))
;; Avy ;; Avy
`(avy-lead-face-0 ((,c (:background ,orange :foreground ,black)))) `(avy-lead-face-0 ((,c (:background ,orange :foreground ,black))))
@ -252,22 +264,19 @@
`(org-tag ((,c (:foreground ,grey-1)))) `(org-tag ((,c (:foreground ,grey-1))))
;; `(org-ellipsis ((,c (:inherit hs-face)))) ;; `(org-ellipsis ((,c (:inherit hs-face))))
`(org-whitespace ((,c (:inherit fixed-pitch))))
`(org-table ((,c (:inherit fixed-pitch :foreground ,cyan)))) `(org-table ((,c (:inherit fixed-pitch :foreground ,cyan))))
`(org-block ((,c (:inherit fixed-pitch :background ,current-line))))
`(org-quote ((,c (:slant italic :foreground ,grey :background ,current-line)))) `(org-quote ((,c (:slant italic :foreground ,grey :background ,current-line))))
`(org-block-background ((,c (:inherit fixed-pitch :background ,current-line))))
`(org-document-info ((,c (:inherit fixed-pitch :foreground ,orange)))) `(org-document-info ((,c (:inherit fixed-pitch :foreground ,orange))))
`(org-document-info-keyword ((,c (:inherit fixed-pitch :foreground ,grey-1)))) `(org-document-info-keyword ((,c (:inherit fixed-pitch :foreground ,grey-1))))
`(org-meta-line ((,c (:inherit fixed-pitch :background ,current-line :foreground ,vsubtle)))) `(org-meta-line ((,c (:inherit fixed-pitch :background ,current-line :foreground ,vsubtle))))
`(org-block-begin-line ((,c (:inherit fixed-pitch :background ,current-line :foreground ,vsubtle)))) `(org-block-begin-line ((,c (:inherit fixed-pitch :background ,current-line :foreground ,vsubtle))))
`(org-block-end-line ((,c (:inherit org-block-begin-line)))) `(org-block-end-line ((,c (:inherit org-block-begin-line))))
`(org-document-title ((,c (:foreground ,fg :height 1.30 :bold t)))) `(org-document-title ((,c (:foreground ,cyan :height 1.30 :bold t))))
`(org-level-1 ((,c (:foreground ,orange :bold t)))) `(org-level-1 ((,c (:foreground ,orange :bold t))))
`(org-level-2 ((,c (:foreground ,dark-cyan)))) `(org-level-2 ((,c (:foreground ,dark-cyan :bold t))))
`(org-level-3 ((,c (:foreground ,grey)))) `(org-level-3 ((,c (:foreground ,cyan :bold t))))
`(org-level-4 ((,c (:foreground ,green)))) `(org-level-4 ((,c (:foreground ,green :bold t))))
`(org-level-5 ((,c (:foreground ,cyan)))) `(org-level-5 ((,c (:foreground ,cyan))))
`(org-level-6 ((,c (:foreground ,blue+2)))) `(org-level-6 ((,c (:foreground ,blue+2))))
;; `(org-level-7 ((,c ()))) ;; `(org-level-7 ((,c ())))
@ -277,19 +286,26 @@
`(org-code ((,c (:inherit fixed-pitch :foreground ,orange)))) `(org-code ((,c (:inherit fixed-pitch :foreground ,orange))))
`(org-verbatim ((,c (:inherit fixed-pitch :foreground ,green)))) `(org-verbatim ((,c (:inherit fixed-pitch :foreground ,green))))
`(org-formula ((,c (:inherit fixed-pitch :foreground ,cyan)))) `(org-formula ((,c (:inherit fixed-pitch :foreground ,cyan))))
`(org-list-dt ((,c (:foreground ,cyan :bold t))))
`(org-footnote ((,c (:inherit fixed-pitch :foreground ,orange))))
`(org-link ((,c (:inherit variable-pitch :underline t :foreground ,yellow)))) `(org-link ((,c (:underline t :foreground ,yellow :bold inherit))))
`(org-date ((,c (:foreground ,violet)))) `(org-date ((,c (:inherit fixed-pitch :foreground ,violet))))
`(org-item-checkbox ((,c (:inherit variable-pitch)))) `(org-todo ((,c (:foreground ,yellow :bold inherit))))
`(org-item-checkbox-checked ((,c (:inherit org-headline-done)))) `(org-done ((,c (:foreground ,green :bold inherit))))
`(org-todo ((,c (:inherit variable-pitch :foreground ,yellow)))) `(org-headline-done ((,c (:foreground ,grey-.5 :strike-through t :bold nil))))
`(org-todo-high ((,c (:inherit variable-pitch :foreground ,yellow))))
`(org-todo-vhigh ((,c (:inherit variable-pitch :foreground ,magenta))))
`(org-done ((,c (:inherit variable-pitch :foreground ,green))))
`(org-headline-done ((,c (:inherit variable-pitch :foreground ,grey-.5 :strike-through t))))
`(org-special-keyword ((,c (:foreground ,magenta)))) `(org-special-keyword ((,c (:foreground ,magenta))))
`(org-checkbox-statistics-todo ((,c (:inherit org-todo :bold t)))) `(org-checkbox-statistics-todo ((,c (:inherit org-todo))))
`(org-checkbox-statistics-done ((,c (:inherit org-done :bold t)))) `(org-checkbox-statistics-done ((,c (:inherit org-done))))
;; NARF custom org faces
`(org-headline-todo ((,c (:foreground ,dark-cyan :bold nil))))
`(org-block ((,c (:inherit fixed-pitch :background ,current-line))))
`(org-block-background ((,c (:inherit fixed-pitch :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-whitespace ((,c (:inherit fixed-pitch))))
)) ))

View file

@ -7,6 +7,9 @@
(when (f-exists? generated-autoload-file) (when (f-exists? generated-autoload-file)
(delete-file generated-autoload-file)) (delete-file generated-autoload-file))
(apply #'update-directory-autoloads (list (concat narf-core-dir "lib") (let ((dirs (list (concat narf-core-dir "lib")
(concat narf-modules-dir "lib") (concat narf-modules-dir "lib")
narf-contrib-dir)) narf-contrib-dir)))
(apply #'update-directory-autoloads dirs)
(message "Scanned: %s" dirs))