diff --git a/Cask b/Cask index 5633d31d1..f8931555e 100644 --- a/Cask +++ b/Cask @@ -98,6 +98,7 @@ ;; Quickrun -- core/core-quickrun.el (depends-on "quickrun") +(depends-on "repl-toggle") ;; Workgroups --- core/core-workgroups.el (depends-on "workgroups2") @@ -144,6 +145,7 @@ (depends-on "tide") (depends-on "coffee-mode") (depends-on "company-tern") +(depends-on "nodejs-repl") ;; Lua -- modules/module-lua.el (depends-on "lua-mode") @@ -169,6 +171,7 @@ (depends-on "hack-mode" :git "https://github.com/facebook/hhvm" :files ("hphp/hack/editor-plugins/emacs/*.el")) +(depends-on "php-boris") ;; Python -- modules/module-python.el (depends-on "anaconda-mode") diff --git a/Makefile b/Makefile index 6433b6719..2ff041b62 100644 --- a/Makefile +++ b/Makefile @@ -4,13 +4,13 @@ all: update update: autoloads @echo "Updating repo" - @git pull | sed 's/^/ /' - @cask install --verbose + @git pull 2>&1 | sed 's/^/ /' + @cask install --verbose 2>&1 | sed 's/^/ /' @echo "Updating outdated plugins" - @cask outdated | sed 's/^/ /' - @cask update --verbose + @cask outdated 2>&1 | sed 's/^/ /' + @cask update --verbose 2>&1 | sed 's/^/ /' @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 diff --git a/core/core-auto-insert.el b/core/core-auto-insert.el index 3b1fe3559..adc883fc2 100644 --- a/core/core-auto-insert.el +++ b/core/core-auto-insert.el @@ -3,85 +3,93 @@ (use-package autoinsert :defer t :init - (setq auto-insert-query nil) ; Don't prompt before insertion - (setq auto-insert-alist '()) + (setq auto-insert-query nil ; Don't prompt before insertion + auto-insert-alist '()) :config (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++ - (add-template! "/Makefile$" "__" 'makefile-gmake-mode) - (add-template! "/main\\.\\(cc\\|cpp\\)$" "__main.cpp" 'c++-mode) - (add-template! "/win32_\\.\\(cc\\|cpp\\)$" "__winmain.cpp" 'c++-mode) - (add-template! "\\.\\([Hh]\\|hpp\\)$" "__.h" 'c++-mode) - (add-template! "\\.\\(cc\\|cpp\\)$" "__.cpp" 'c++-mode) - (add-template! "\\.c$" "__.c" 'c-mode) + ;; C/C++ + ("/Makefile$" "__" makefile-gmake-mode) + ("/main\\.\\(cc\\|cpp\\)$" "__main.cpp" c++-mode) + ("/win32_\\.\\(cc\\|cpp\\)$" "__winmain.cpp" c++-mode) + ("\\.\\([Hh]\\|hpp\\)$" "__.h" c++-mode) + ("\\.\\(cc\\|cpp\\)$" "__.cpp" c++-mode) + ("\\.c$" "__.c" c-mode) - ;; Elisp - (add-template! "\\.emacs\\.d/.+\\.el$" "__initfile" 'emacs-lisp-mode) - (add-template! "\\.emacs\\.d/private/\\(snippets\\|templates\\)/.+$" "__" 'snippet-mode) + ;; Elisp + ("\\.emacs\\.d/.+\\.el$" "__initfile" emacs-lisp-mode) + ("\\.emacs\\.d/private/\\(snippets\\|templates\\)/.+$" "__" snippet-mode) - ;; Go - (add-template! "/main\\.go$" "__main.go" 'go-mode t) - (add-template! "\\.go$" "__.go" 'go-mode) + ;; Go + ("/main\\.go$" "__main.go" go-mode t) + ("\\.go$" "__.go" go-mode) - ;; HTML - (add-template! "\\.html$" "__.html" 'web-mode) + ;; HTML + ("\\.html$" "__.html" web-mode) - ;; java - (add-template! "/src/.+/.+\\.java$" "__" 'java-mode) - (add-template! "/main\\.java$" "__main" 'java-mode) - (add-template! "/build\\.gradle$" "__build.gradle" 'android-mode) + ;; java + ("/src/.+/.+\\.java$" "__" java-mode) + ("/main\\.java$" "__main" java-mode) + ("/build\\.gradle$" "__build.gradle" android-mode) - ;; Javascript - (add-template! "\\.lbaction/.+/Info.plist$" "__Info.plst" 'lb6-mode) - (add-template! "\\.lbaction/.+/\\(default\\|suggestions\\)\\.js$" "__default.js" 'lb6-mode) - (add-template! "/package\\.json$" "__package.json" 'json-mode) - (add-template! "\\.\\(json\\|jshintrc\\)$" "__" 'json-mode) + ;; Javascript + ("\\.lbaction/.+/Info.plist$" "__Info.plst" lb6-mode) + ("\\.lbaction/.+/\\(default\\|suggestions\\)\\.js$" "__default.js" lb6-mode) + ("/package\\.json$" "__package.json" json-mode) + ("\\.\\(json\\|jshintrc\\)$" "__" json-mode) - ;; Lua - (add-template! "/main\\.lua$" "__main.lua" 'love-mode) - (add-template! "/conf\\.lua$" "__conf.lua" 'love-mode) + ;; Lua + ("/main\\.lua$" "__main.lua" love-mode) + ("/conf\\.lua$" "__conf.lua" love-mode) - ;; Markdown - (add-template! "\\.md$" "__" 'markdown-mode) - (add-template! "/_posts/.+\\.md$" "__jekyll-post" 'markdown-mode) - (add-template! "/_layouts/.+\\.html$" "__jekyll-layout.html" 'web-mode) + ;; Markdown + ("\\.md$" "__" markdown-mode) - ;; PHP - (add-template! "\\.class\\.php$" "__.class.php" 'php-mode) - (add-template! "\\.php$" "__" 'php-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) - ;; Python - ;; (add-template! "tests?/test_.+\\.py$" "__" 'nose-mode) - ;; (add-template! "/setup\\.py$" "__setup.py" 'python-mode) - (add-template! "\\.py$" "__" 'python-mode) + ;; PHP + ("\\.class\\.php$" "__.class.php" php-mode) + ("\\.php$" "__" php-mode) - ;; Ruby - (add-template! "/\\.rspec$" "__.rspec" 'rspec-mode) - (add-template! "/spec_helper\\.rb$" "__helper" 'rspec-mode t) - (add-template! "_spec\\.rb$" "__" 'rspec-mode t) - (add-template! "/Rakefile$" "__Rakefile" 'enh-ruby-mode t) - (add-template! "/Gemfile$" "__Gemfile" 'enh-ruby-mode t) - (add-template! "\\.gemspec$" "__.gemspec" 'enh-ruby-mode t) - (add-template! "/lib/.+\\.rb$" "__module" 'enh-ruby-mode t) - (add-template! "\\.rb$" "__" 'enh-ruby-mode) + ;; Python + ;;"tests?/test_.+\\.py$" "__" nose-mode) + ;;"/setup\\.py$" "__setup.py" python-mode) + ("\\.py$" "__" python-mode) - ;; Rust - (add-template! "/Cargo.toml$" "__Cargo.toml" 'rust-mode) - (add-template! "/main\\.rs$" "__main.rs" 'rust-mode) + ;; Ruby + ("/\\.rspec$" "__.rspec" rspec-mode) + ("/spec_helper\\.rb$" "__helper" rspec-mode t) + ("_spec\\.rb$" "__" rspec-mode t) + ("/Rakefile$" "__Rakefile" enh-ruby-mode t) + ("/Gemfile$" "__Gemfile" enh-ruby-mode t) + ("\\.gemspec$" "__.gemspec" enh-ruby-mode t) + ("/lib/.+\\.rb$" "__module" enh-ruby-mode t) + ("\\.rb$" "__" enh-ruby-mode) - ;; SCSS - (add-template! "/master\\.scss$" "__master.scss" 'scss-mode) - (add-template! "/normalize\\.scss$" "__normalize.scss" 'scss-mode) - (add-template! "\\.scss$" "__" 'scss-mode) + ;; Rust + ("/Cargo.toml$" "__Cargo.toml" rust-mode) + ("/main\\.rs$" "__main.rs" rust-mode) - ;; Shell scripts - (add-template! "\\.z?sh$" "__" 'sh-mode) - ) + ;; SCSS + ("/master\\.scss$" "__master.scss" scss-mode) + ("/normalize\\.scss$" "__normalize.scss" scss-mode) + ("\\.scss$" "__" scss-mode) + + ;; Shell scripts + ("\\.z?sh$" "__" sh-mode) + ))) (provide 'core-auto-insert) ;;; core-auto-insert.el ends here diff --git a/core/core-defuns.el b/core/core-defuns.el index 742299dcd..17465e8ac 100644 --- a/core/core-defuns.el +++ b/core/core-defuns.el @@ -243,8 +243,8 @@ to abort the minibuffer." (let (message-log-max) (if (and delete-selection-mode transient-mark-mode mark-active) (setq deactivate-mark t) - (when (get-buffer "*Completions*") - (delete-windows-on "*Completions*")) + ;; (when (get-buffer "*Completions*") + ;; (delete-windows-on "*Completions*")) (abort-recursive-edit)))) (after! evil diff --git a/core/core-editor.el b/core/core-editor.el index 60d783607..ba02be0eb 100644 --- a/core/core-editor.el +++ b/core/core-editor.el @@ -23,7 +23,7 @@ hscroll-step 5 hscroll-margin 6 - shift-select-mode nil + shift-select-mode t tabify-regexp "^\t* [ \t]+" whitespace-style '(face tabs tab-mark) whitespace-display-mappings @@ -219,28 +219,13 @@ details on NORECORD.") t)) (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 :commands (describe-buffer describe-command describe-file 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) - (setq save-place t)))) +(require 'saveplace) +(setq save-place-file (concat narf-temp-dir "saveplace")) +(save-place-mode +1) (provide 'core-editor) ;;; core-editor.el ends here diff --git a/core/core-evil.el b/core/core-evil.el index 9ee5a50f5..244a54073 100644 --- a/core/core-evil.el +++ b/core/core-evil.el @@ -29,10 +29,19 @@ evil-echo-state nil 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 evil-default-cursor "orange" evil-normal-state-cursor 'box - evil-emacs-state-cursor 'bar + evil-emacs-state-cursor '("cyan" box) evil-insert-state-cursor 'bar evil-visual-state-cursor 'hollow evil-iedit-state-cursor 'box) @@ -49,13 +58,20 @@ (advice-add 'extract-rectangle-line :filter-args 'narf*evil-extract-rectangle-line-fix) ;; modes to map to different default states - (dolist (mode-map '((cider-repl-mode . emacs) - (comint-mode . emacs) - (term-mode . emacs) - (Info-mode . emacs) - (help-mode . normal) - (message-mode . normal) - (compilation-mode . normal))) + (dolist (mode-map '((cider-repl-mode . emacs) + (comint-mode . emacs) + (term-mode . emacs) + (Info-mode . emacs) + (view-mode . emacs) + (help-mode . normal) + (message-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))) ;; Switch to normal mode before switching windows @@ -232,9 +248,9 @@ (use-package evil-jumper :init - (setq evil-jumper-file (concat narf-temp-dir "jumplist") - evil-jumper-auto-center t - evil-jumper-auto-save-interval 3600)) + (setq evil-jumper-auto-center nil + evil-jumper-auto-save-interval 3600) + :config (global-evil-jumper-mode +1)) (use-package evil-matchit :commands (evilmi-jump-items evilmi-text-object global-evil-matchit-mode) diff --git a/core/core-helm.el b/core/core-helm.el index 627130eb1..098cf2662 100644 --- a/core/core-helm.el +++ b/core/core-helm.el @@ -84,7 +84,10 @@ ;; Hide mode-line in helm windows (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 :diminish projectile-mode diff --git a/core/core-popup.el b/core/core-popup.el index bbe06915b..be3f18397 100644 --- a/core/core-popup.el +++ b/core/core-popup.el @@ -22,6 +22,8 @@ (" *Org todo*" :position bottom :height 5) ("*Org Links*" :position bottom :height 2) ("^\\*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) diff --git a/core/core-quickrun.el b/core/core-quickrun.el index a509fea66..1c2adee7f 100644 --- a/core/core-quickrun.el +++ b/core/core-quickrun.el @@ -15,5 +15,18 @@ (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) ;;; core-quickrun.el ends here diff --git a/core/core-ui.el b/core/core-ui.el index ceea15957..cd89fe97e 100644 --- a/core/core-ui.el +++ b/core/core-ui.el @@ -351,7 +351,8 @@ iedit." ;; Initialize modeline (spaceline-install ;; 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-modified narf-vc diff --git a/core/core-workgroups.el b/core/core-workgroups.el index 396138fa8..67a8cb3d4 100644 --- a/core/core-workgroups.el +++ b/core/core-workgroups.el @@ -33,6 +33,8 @@ ;; Create a new workgroup on switch-project (setq projectile-switch-project-action 'narf/wg-projectile-switch-project)) + (add-hook! wg-before-switch-to-workgroup 'popwin:close-popup-window) + ;; Initialize! (add-hook! after-init (workgroups-mode 1) diff --git a/core/core-yasnippet.el b/core/core-yasnippet.el index 04ec438e6..4e641d957 100644 --- a/core/core-yasnippet.el +++ b/core/core-yasnippet.el @@ -52,6 +52,7 @@ "" 'yas-prev-field "" 'narf/yas-clear-to-sof + "" 'evil-normal-state [backspace] 'narf/yas-backspace "" 'narf/yas-delete) @@ -69,7 +70,8 @@ ;; right due to an off-by-one issue. (defadvice yas-expand-snippet (around yas-expand-snippet-visual-line activate) (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) ;;; core-yasnippet.el ends here diff --git a/core/lib/defuns-evil.el b/core/lib/defuns-evil.el index 0c6a7d660..1c6a6bb07 100644 --- a/core/lib/defuns-evil.el +++ b/core/lib/defuns-evil.el @@ -69,24 +69,25 @@ (cons (format "\\%s{" command) "}"))) ;;;###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) - "Apply macro to each line. Courtesy of PythonNut/emacs-config" - (evil-with-state - (evil-normal-state) - (goto-char end) - (evil-visual-state) - (goto-char beg) - (evil-ex-normal (region-beginning) (region-end) - (concat "@" - (single-key-description - (read-char "What macro?")))))) +(evil-define-operator narf/evil-macro-on-all-lines (beg end &optional macro) + "Apply macro to each line." + :motion nil + :move-point nil + (interactive "") + (unless (and beg end) + (setq beg (region-beginning) + end (region-end))) + (evil-ex-normal beg end + (concat "@" + (single-key-description + (or macro (read-char "@-")))))) ;;;###autoload (defmacro define-text-object! (key start-regex end-regex) (let ((inner-name (make-symbol "narf--inner-name")) (outer-name (make-symbol "narf--outer-name"))) `(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-define-text-object ,outer-name (count &optional beg end type) (evil-select-paren ,start-regex ,end-regex beg end type count t)) diff --git a/core/lib/defuns-helm.el b/core/lib/defuns-helm.el index 7aa67c062..507237822 100644 --- a/core/lib/defuns-helm.el +++ b/core/lib/defuns-helm.el @@ -38,8 +38,8 @@ ;; Ex-mode interface for `helm-ag'. If `bang', then `search' is interpreted as ;; regexp. -;;;###autoload (autoload 'narf:helm-search "defuns-helm" nil t) -(evil-define-operator narf:helm-search (beg end &optional search hidden-files-p pwd-p regex-p) +;;;###autoload (autoload 'narf:helm-ag-search "defuns-helm" nil t) +(evil-define-operator narf:helm-ag-search (beg end &optional search hidden-files-p pwd-p regex-p) :type inclusive :repeat nil (interactive "") @@ -61,25 +61,25 @@ :keymap helm-ag-map :input input))) -;;;###autoload (autoload 'narf:helm-regex-search "defuns-helm" nil t) -(evil-define-operator narf:helm-regex-search (beg end &optional search bang) +;;;###autoload (autoload 'narf:helm-ag-regex-search "defuns-helm" nil t) +(evil-define-operator narf:helm-ag-regex-search (beg end &optional search bang) :type inclusive :repeat nil (interactive "") - (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) -(evil-define-operator narf:helm-search-cwd (beg end &optional search bang) +;;;###autoload (autoload 'narf:helm-ag-search-cwd "defuns-helm" nil t) +(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 ;; as regexp :type inclusive :repeat nil (interactive "") - (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) -(evil-define-operator narf:helm-regex-search-cwd (beg end &optional search bang) +;;;###autoload (autoload 'narf:helm-ag-regex-search-cwd "defuns-helm" nil t) +(evil-define-operator narf:helm-ag-regex-search-cwd (beg end &optional search bang) :type inclusive :repeat nil (interactive "") - (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 ;; `helm-css-scss' and `helm-css-scss-multi' (if `bang') if major-mode is diff --git a/core/lib/defuns-yasnippet.el b/core/lib/defuns-yasnippet.el index 5379a1d88..374364ab8 100644 --- a/core/lib/defuns-yasnippet.el +++ b/core/lib/defuns-yasnippet.el @@ -3,16 +3,14 @@ ;;;###autoload (defun narf|yas-before-expand () - "Switch to insert mode when expanding a template via backtab, or go back to -normal mode if there are no fields." - ;; Strip out the shitespace before a line selection. + "Strip out the shitespace before a line selection." (when (narf/evil-visual-line-state-p) - (setq yas-selected-text - (replace-regexp-in-string - "\\(^ *\\|\n? $\\)" "" - (buffer-substring-no-properties (region-beginning) - (1- (region-end)))))) - (evil-insert-state +1)) + (setq-local + yas-selected-text + (replace-regexp-in-string + "\\(^ *\\|\n? $\\)" "" + (buffer-substring-no-properties (region-beginning) + (1- (region-end))))))) ;;;###autoload (defun narf|yas-after-expand () @@ -26,7 +24,10 @@ normal mode if there are no fields." normal mode if there are no fields." (interactive) (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 (defun narf/yas-goto-start-of-field () diff --git a/core/lib/macros-auto-insert.el b/core/lib/macros-auto-insert.el deleted file mode 100644 index b10d0d2c1..000000000 --- a/core/lib/macros-auto-insert.el +++ /dev/null @@ -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 diff --git a/modules/lib/defuns-org-custom.el b/modules/lib/defuns-org-custom.el deleted file mode 100644 index 7804924ee..000000000 --- a/modules/lib/defuns-org-custom.el +++ /dev/null @@ -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 diff --git a/modules/lib/defuns-org.el b/modules/lib/defuns-org.el index 9699540c9..639bb36a8 100644 --- a/modules/lib/defuns-org.el +++ b/modules/lib/defuns-org.el @@ -113,39 +113,6 @@ (defun narf/org-surround (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 (defun narf/org-word-count (beg end &optional count-footnotes?) "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 (if mark-active "region" "buffer"))))) -;;;###autoload (autoload 'narf:org-attach "defuns-org" nil t) -(evil-define-command narf:org-attach (&optional link) - (interactive "") - (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) (evil-define-command narf:org-export (dest) (interactive "") @@ -324,16 +275,14 @@ re-align the table if necessary. (Necessary because org-mode has a (when (org-looking-at-p " ") (forward-char)))) ;;;###autoload -(defun narf/org-replace-link-by-link-description () - "Replace an org link by its description or if empty its address" - (interactive) - (if (org-in-regexp org-bracket-link-regexp 1) - (let ((remove (list (match-beginning 0) (match-end 0))) - (description (if (match-end 3) - (org-match-string-no-properties 3) - (org-match-string-no-properties 1)))) - (apply 'delete-region remove) - (insert description)))) +(defun narf/-org-capture-changelog () + ;; TODO + ) + +;;;###autoload +(defun narf/-org-capture-choose () + ;; TODO + ) (provide 'defuns-org) ;;; defuns-org.el ends here diff --git a/modules/module-js.el b/modules/module-js.el index 756600500..3c51bce5e 100644 --- a/modules/module-js.el +++ b/modules/module-js.el @@ -106,5 +106,7 @@ coffee-tab-width 2 coffee-indent-like-python-mode t)) +(use-package nodejs-repl :defer t) + (provide 'module-js) ;;; module-js.el ends here diff --git a/modules/module-org.el b/modules/module-org.el index 81f8dd87b..ab69f4186 100644 --- a/modules/module-org.el +++ b/modules/module-org.el @@ -40,6 +40,7 @@ org-footnote-auto-label 'plain org-log-done t org-agenda-window-setup 'other-window + org-agenda-skip-unavailable-files t org-src-window-setup 'current-window org-startup-folded 'content org-todo-keywords '((sequence "TODO(t)" "|" "DONE(d)") @@ -141,7 +142,7 @@ 'org-babel-load-languages '((python . t) (ruby . t) (sh . t) (js . t) (css . t) (plantuml . t) (emacs-lisp . t) (matlab . t) - (latex . t) (calc . t) + (latex . t) (calc . t) (lisp . t) (http . t) (rust . t) (go . t))) (setq org-plantuml-jar-path puml-plantuml-jar-path) @@ -272,7 +273,10 @@ will function properly." (setq line-spacing '0.2) (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 '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) - (org-add-link-type "contact" 'narf/org-link-contact) - (org-add-link-type "project" 'narf/org-link-project) - (org-add-link-type "invoice" 'narf/org-link-invoice) + (org-add-link-type "contact" 'narf/org-crm-link-contact) + (org-add-link-type "project" 'narf/org-crm-link-project) + (org-add-link-type "invoice" 'narf/org-crm-link-invoice) (add-to-list 'recentf-exclude (expand-file-name "%s.+\\.org$" org-directory)) (after! helm @@ -346,18 +350,17 @@ will function properly." (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 (require 'org-download) (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") + (defun org-download--dir-2 () + (f-base (buffer-file-name))) + ;;; Auto-completion (after! company (require 'company-math) @@ -426,8 +429,7 @@ will function properly." :n ",f" 'org-sparse-tree :n ",?" 'org-tags-view :n ",e" 'org-edit-special - :n ",a" 'org-attach - :n ",A" 'org-agenda + :n ",a" 'org-agenda :n ",D" 'org-time-stamp-inactive :n ",i" 'narf/org-toggle-inline-images-at-point :n ",t" 'org-todo @@ -435,6 +437,7 @@ will function properly." :n ",d" 'org-time-stamp :n ",r" 'org-refile :n ",s" 'org-schedule + :n ",oa" 'narf/org-reveal-attachments :n ", SPC" 'narf/org-toggle-checkbox :n ", RET" 'org-archive-subtree @@ -462,7 +465,7 @@ will function properly." :n "go" 'org-open-at-point :n "gO" (λ (let ((org-link-frame-setup (append '((file . find-file-other-window)) org-link-frame-setup)) (org-file-apps '(("\\.org$" . emacs) - (t . "qlmanage -p \"%s\"")))) + (t . "open \"%s\"")))) (call-interactively 'org-open-at-point))) :n "gQ" 'org-fill-paragraph diff --git a/modules/module-php.el b/modules/module-php.el index 8c96f385c..eeea66e66 100644 --- a/modules/module-php.el +++ b/modules/module-php.el @@ -24,6 +24,8 @@ (require '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$") (provide 'module-php) diff --git a/private/my-bindings.el b/private/my-bindings.el index 0eecce7d9..2d8644141 100644 --- a/private/my-bindings.el +++ b/private/my-bindings.el @@ -29,6 +29,7 @@ "M-t" 'helm-projectile-find-file "A-`" 'narf-switch-to-iterm "C-`" 'narf/popup-toggle + "C-~" 'rtog/toggle-repl "" 'what-face "M-w" 'evil-window-delete @@ -202,7 +203,8 @@ :m "gl" 'avy-goto-line :m "g]" 'smart-right :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 diff --git a/private/my-commands.el b/private/my-commands.el index d902efde2..5562008de 100644 --- a/private/my-commands.el +++ b/private/my-commands.el @@ -5,10 +5,10 @@ (exmap "a" 'helm-projectile-find-other-file) (exmap "acomp[ile]" 'narf:compile-autoloads) -(exmap "ag" 'narf:helm-search) -(exmap "ag[cw]d" 'narf:helm-search-cwd) -(exmap "agr" 'narf:helm-regex-search) -(exmap "agr[cw]d" 'narf:helm-regex-search-cwd) +(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:whitespace-align) (exmap "bcomp[ile]" 'narf:compile-el) (exmap "big" 'narf:toggle-big-mode) @@ -44,6 +44,7 @@ (exmap "fi[nd]" 'narf:helm-swoop) (exmap "tsnip[pets]" 'narf:yas-file-templates) ; tsnip[!] (exmap "x" 'narf:scratch-buffer) +(exmap "@" 'narf/evil-macro-on-all-lines) (exmap "t[mux]" 'narf:send-to-tmux) (exmap "tcd" (λ (narf:send-to-tmux (format "cd '%s'" default-directory)))) diff --git a/private/templates/c++-mode/__.cpp b/private/templates/c++-mode/__.cpp deleted file mode 100644 index 10f8293e1..000000000 --- a/private/templates/c++-mode/__.cpp +++ /dev/null @@ -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 diff --git a/private/templates/c-mode/__.c b/private/templates/c-mode/__.c deleted file mode 100644 index 10f8293e1..000000000 --- a/private/templates/c-mode/__.c +++ /dev/null @@ -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 diff --git a/private/templates/c-mode/__.h b/private/templates/c-mode/__.h deleted file mode 100644 index b58beb13a..000000000 --- a/private/templates/c-mode/__.h +++ /dev/null @@ -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 diff --git a/private/templates/makefile-gmake-mode/__ b/private/templates/makefile-gmake-mode/__ index 4fba94a0f..466fab247 100644 --- a/private/templates/makefile-gmake-mode/__ +++ b/private/templates/makefile-gmake-mode/__ @@ -1,6 +1,3 @@ -# -*- mode: snippet -*- -# contributor: Henrik Lissner -# -- ## # ${1:Project Title} # diff --git a/private/themes/narf/narf-dark-theme.el b/private/themes/narf/narf-dark-theme.el index 6e2ab66af..c4dea1705 100644 --- a/private/themes/narf/narf-dark-theme.el +++ b/private/themes/narf/narf-dark-theme.el @@ -1,7 +1,7 @@ ;; NARF Dark ;; By Henrik Lissner -(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) @@ -40,7 +40,7 @@ (search-rest-fg black) (highlight orange) (vertical-bar grey-2) - (current-line "#232526") + (current-line "#262829") (selection "#535556") (builtin orange) (comments grey-1) @@ -49,7 +49,7 @@ (functions cyan) (keywords magenta) (methods dark-cyan) - (operators grey) + (operators violet) (type cyan) (strings green) (variables orange) @@ -78,40 +78,45 @@ 'narf-dark ;; Text - `(default ((,c (:foreground ,fg :background ,bg)))) - `(fringe ((,c (:background ,bg :foreground ,grey-1)))) - `(cursor ((,c (:background ,white)))) - `(hl-line ((,c (:background ,current-line)))) - `(region ((,c (:background ,grey-2 :foreground ,white)))) - `(highlight ((,c (:foreground ,yellow :inverse-video t)))) - `(shadow ((,c (:foreground ,cyan)))) - ;; `(secondary-selection ((,c (:background ,orange)))) - ;; `(lazy-highlight ((,c (:background ,orange)))) - ;; `(match ((,c (:background ,magenta)))) + `(default ((,c (:foreground ,fg :background ,bg)))) + `(fringe ((,c (:background ,bg :foreground ,grey-1)))) + `(cursor ((,c (:background ,white)))) + `(hl-line ((,c (:background ,current-line)))) + `(region ((,c (:background ,grey-2 :foreground ,white)))) + `(highlight ((,c (:foreground ,yellow :inverse-video t)))) + `(shadow ((,c (:foreground ,orange)))) + ;; `(secondary-selection ((,c (:background ,orange)))) + ;; `(lazy-highlight ((,c (:background ,orange)))) + ;; `(match ((,c (:background ,magenta)))) + `(scroll-bar ((,c (:background ,green)))) - `(error ((,c (:foreground ,red :bold t)))) - `(warning ((,c (:foreground ,yellow :bold t)))) - `(success ((,c (:foreground ,green :bold t)))) + `(error ((,c (:foreground ,red :bold t)))) + `(warning ((,c (:foreground ,yellow :bold t)))) + `(success ((,c (:foreground ,green :bold t)))) - `(hs-face ((,c (:foreground ,comments :background ,black)))) - `(hs-fringe-face ((,c (:foreground ,grey :background ,current-line)))) + `(spaceline-flycheck-error ((,c (:bold t :foreground ,red)))) + `(spaceline-flycheck-warning ((,c (:bold t :foreground ,yellow)))) + `(spaceline-flycheck-info ((,c (:bold t :foreground ,green)))) - `(font-lock-builtin-face ((,c (:foreground ,builtin)))) - `(font-lock-comment-face ((,c (:foreground ,comments)))) + `(hs-face ((,c (:foreground ,comments :background ,black)))) + `(hs-fringe-face ((,c (:foreground ,orange)))) + + `(font-lock-builtin-face ((,c (:foreground ,builtin)))) + `(font-lock-comment-face ((,c (:foreground ,comments)))) `(font-lock-comment-delimiter-face ((,c (:foreground ,comments)))) - `(font-lock-doc-face ((,c (:foreground ,blue+2)))) - `(font-lock-doc-string-face ((,c (:foreground ,blue+2)))) - `(font-lock-constant-face ((,c (:foreground ,constants)))) - `(font-lock-function-name-face ((,c (:foreground ,functions)))) - `(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-type-face ((,c (:foreground ,type)))) - `(font-lock-variable-name-face ((,c (:foreground ,variables)))) - `(font-lock-warning-face ((,c (:foreground ,red)))) + `(font-lock-doc-face ((,c (:foreground ,blue+2)))) + `(font-lock-doc-string-face ((,c (:foreground ,blue+2)))) + `(font-lock-constant-face ((,c (:foreground ,constants)))) + `(font-lock-function-name-face ((,c (:foreground ,functions)))) + `(font-lock-keyword-face ((,c (:foreground ,keywords)))) + `(font-lock-string-face ((,c (:foreground ,strings)))) + `(font-lock-type-face ((,c (:foreground ,type)))) + `(font-lock-variable-name-face ((,c (:foreground ,variables)))) + `(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)))) `(italic ((,c (:slant italic :foreground ,subtle)))) @@ -137,9 +142,8 @@ `(powerline-active2 ((,c (:foreground ,modeline-fg-3 :background ,modeline-bg-3)))) `(powerline-inactive1 ((,c (:foreground ,modeline-fg-inactive)))) `(powerline-inactive2 ((,c (:foreground ,modeline-fg-inactive)))) - `(spaceline-highlight-face ((,c (:foreground ,black :background ,highlight)))) - `(mode-line-iedit-face ((,c (:foreground ,black :background ,magenta)))) - `(mode-line-substitute-face ((,c (:foreground ,black :background ,yellow)))) + `(spaceline-highlight-face ((,c (:foreground ,black :background ,highlight :bold t)))) + `(mode-line-count-face ((,c (:foreground ,black :background ,magenta :bold t)))) ;; Search `(isearch ((,c (:foreground ,search-fg :background ,search-bg)))) @@ -205,14 +209,22 @@ `(rainbow-delimiters-depth-3-face ((,c (:foreground ,yellow)))) `(rainbow-delimiters-depth-4-face ((,c (:foreground ,green)))) `(rainbow-delimiters-depth-5-face ((,c (:foreground ,cyan)))) - `(rainbow-delimiters-unmatched-face ((,c (:foreground ,bg :background ,red)))) + `(rainbow-delimiters-unmatched-face ((,c (:foreground ,red :inverse-video t)))) `(flyspell-incorrect ((,c (:underline (:style wave :color ,error-highlight) :inherit unspecified)))) ;; Helm - `(helm-source-header ((,c (:background ,bg :foreground ,bg :height 0.1)))) + `(helm-source-header ((,c (:background ,current-line :foreground ,grey-1)))) `(helm-selection ((,c (:background ,selection)))) `(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-lead-face-0 ((,c (:background ,orange :foreground ,black)))) @@ -252,22 +264,19 @@ `(org-tag ((,c (:foreground ,grey-1)))) ;; `(org-ellipsis ((,c (:inherit hs-face)))) - `(org-whitespace ((,c (:inherit fixed-pitch)))) `(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-block-background ((,c (:inherit fixed-pitch :background ,current-line)))) `(org-document-info ((,c (:inherit fixed-pitch :foreground ,orange)))) `(org-document-info-keyword ((,c (:inherit fixed-pitch :foreground ,grey-1)))) `(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-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-2 ((,c (:foreground ,dark-cyan)))) - `(org-level-3 ((,c (:foreground ,grey)))) - `(org-level-4 ((,c (:foreground ,green)))) + `(org-level-2 ((,c (:foreground ,dark-cyan :bold t)))) + `(org-level-3 ((,c (:foreground ,cyan :bold t)))) + `(org-level-4 ((,c (:foreground ,green :bold t)))) `(org-level-5 ((,c (:foreground ,cyan)))) `(org-level-6 ((,c (:foreground ,blue+2)))) ;; `(org-level-7 ((,c ()))) @@ -277,19 +286,26 @@ `(org-code ((,c (:inherit fixed-pitch :foreground ,orange)))) `(org-verbatim ((,c (:inherit fixed-pitch :foreground ,green)))) `(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-date ((,c (:foreground ,violet)))) - `(org-item-checkbox ((,c (:inherit variable-pitch)))) - `(org-item-checkbox-checked ((,c (:inherit org-headline-done)))) - `(org-todo ((,c (:inherit variable-pitch :foreground ,yellow)))) - `(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-link ((,c (:underline t :foreground ,yellow :bold inherit)))) + `(org-date ((,c (:inherit fixed-pitch :foreground ,violet)))) + `(org-todo ((,c (:foreground ,yellow :bold inherit)))) + `(org-done ((,c (:foreground ,green :bold inherit)))) + `(org-headline-done ((,c (:foreground ,grey-.5 :strike-through t :bold nil)))) `(org-special-keyword ((,c (:foreground ,magenta)))) - `(org-checkbox-statistics-todo ((,c (:inherit org-todo :bold t)))) - `(org-checkbox-statistics-done ((,c (:inherit org-done :bold t)))) + `(org-checkbox-statistics-todo ((,c (:inherit org-todo)))) + `(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)))) )) diff --git a/scripts/generate-autoloads.el b/scripts/generate-autoloads.el index ee0737568..3e1c41bdd 100755 --- a/scripts/generate-autoloads.el +++ b/scripts/generate-autoloads.el @@ -7,6 +7,9 @@ (when (f-exists? generated-autoload-file) (delete-file generated-autoload-file)) -(apply #'update-directory-autoloads (list (concat narf-core-dir "lib") - (concat narf-modules-dir "lib") - narf-contrib-dir)) +(let ((dirs (list (concat narf-core-dir "lib") + (concat narf-modules-dir "lib") + narf-contrib-dir))) + (apply #'update-directory-autoloads dirs) + (message "Scanned: %s" dirs)) +