General refactors & reformatting across the board
This commit is contained in:
parent
4e28b48a3a
commit
ea18c83c0a
19 changed files with 123 additions and 110 deletions
|
@ -115,7 +115,8 @@ selection of all minor-modes, active or not."
|
||||||
(require 'org)
|
(require 'org)
|
||||||
(let* ((default-directory doom-docs-dir)
|
(let* ((default-directory doom-docs-dir)
|
||||||
(org-agenda-files (mapcar #'expand-file-name (doom-enlist files)))
|
(org-agenda-files (mapcar #'expand-file-name (doom-enlist files)))
|
||||||
(depth (if (integerp depth) depth)))
|
(depth (if (integerp depth) depth))
|
||||||
|
(org-inhibit-startup t))
|
||||||
(message "Loading search results...")
|
(message "Loading search results...")
|
||||||
(unwind-protect
|
(unwind-protect
|
||||||
(delq
|
(delq
|
||||||
|
@ -218,7 +219,7 @@ selection of all minor-modes, active or not."
|
||||||
:prompt "Search documentation for: "))
|
:prompt "Search documentation for: "))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun doom/help-news-search (&optional initial-input)
|
(defun doom/help-search-news (&optional initial-input)
|
||||||
"Search headlines in Doom's newsletters."
|
"Search headlines in Doom's newsletters."
|
||||||
(interactive)
|
(interactive)
|
||||||
(doom-completing-read-org-headings
|
(doom-completing-read-org-headings
|
||||||
|
|
|
@ -137,8 +137,7 @@
|
||||||
"This disables the company-box scrollbar, because:
|
"This disables the company-box scrollbar, because:
|
||||||
https://github.com/sebastiencs/company-box/issues/44"
|
https://github.com/sebastiencs/company-box/issues/44"
|
||||||
:around #'company-box--update-scrollbar
|
:around #'company-box--update-scrollbar
|
||||||
(cl-letf (((symbol-function #'display-buffer-in-side-window)
|
(letf! ((#'display-buffer-in-side-window #'ignore))
|
||||||
(symbol-function #'ignore)))
|
|
||||||
(apply orig-fn args))))
|
(apply orig-fn args))))
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -178,7 +178,7 @@ If ARG (universal argument), open selection in other-window."
|
||||||
(user-error "%S doesn't support wgrep" caller)))))
|
(user-error "%S doesn't support wgrep" caller)))))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +ivy-yas-prompt (prompt choices &optional display-fn)
|
(defun +ivy-yas-prompt-fn (prompt choices &optional display-fn)
|
||||||
(yas-completing-prompt prompt choices display-fn #'ivy-completing-read))
|
(yas-completing-prompt prompt choices display-fn #'ivy-completing-read))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
|
|
|
@ -88,7 +88,7 @@ results buffer.")
|
||||||
(setq +ivy--origin nil)))
|
(setq +ivy--origin nil)))
|
||||||
|
|
||||||
(after! yasnippet
|
(after! yasnippet
|
||||||
(add-hook 'yas-prompt-functions #'+ivy-yas-prompt))
|
(add-hook 'yas-prompt-functions #'+ivy-yas-prompt-fn))
|
||||||
|
|
||||||
(defadvice! +ivy--inhibit-completion-in-region-a (orig-fn &rest args)
|
(defadvice! +ivy--inhibit-completion-in-region-a (orig-fn &rest args)
|
||||||
"`ivy-completion-in-region' struggles with completing certain
|
"`ivy-completion-in-region' struggles with completing certain
|
||||||
|
@ -114,12 +114,12 @@ evil-ex-specific constructs, so we disable it solely in evil-ex."
|
||||||
(cadr (plist-get ivy-rich-display-transformers-list
|
(cadr (plist-get ivy-rich-display-transformers-list
|
||||||
'ivy-switch-buffer))))
|
'ivy-switch-buffer))))
|
||||||
|
|
||||||
;; Include variable value in `counsel-describe-variable'
|
;; Enahnce the appearance of a couple counsel commands
|
||||||
(plist-put! ivy-rich-display-transformers-list
|
(plist-put! ivy-rich-display-transformers-list
|
||||||
'counsel-describe-variable
|
'counsel-describe-variable
|
||||||
'(:columns
|
'(:columns
|
||||||
((counsel-describe-variable-transformer (:width 40)) ; the original transformer
|
((counsel-describe-variable-transformer (:width 40)) ; the original transformer
|
||||||
(+ivy-rich-describe-variable-transformer (:width 50))
|
(+ivy-rich-describe-variable-transformer (:width 50)) ; display variable value
|
||||||
(ivy-rich-counsel-variable-docstring (:face font-lock-doc-face))))
|
(ivy-rich-counsel-variable-docstring (:face font-lock-doc-face))))
|
||||||
'counsel-M-x
|
'counsel-M-x
|
||||||
'(:columns
|
'(:columns
|
||||||
|
@ -139,10 +139,9 @@ evil-ex-specific constructs, so we disable it solely in evil-ex."
|
||||||
|
|
||||||
;; Highlight buffers differently based on whether they're in the same project
|
;; Highlight buffers differently based on whether they're in the same project
|
||||||
;; as the current project or not.
|
;; as the current project or not.
|
||||||
(let* ((plist (plist-get ivy-rich-display-transformers-list 'ivy-switch-buffer))
|
(when-let* ((plist (plist-get ivy-rich-display-transformers-list 'ivy-switch-buffer))
|
||||||
(switch-buffer-alist (assq 'ivy-rich-candidate (plist-get plist :columns))))
|
(switch-buffer-alist (assq 'ivy-rich-candidate (plist-get plist :columns))))
|
||||||
(when switch-buffer-alist
|
(setcar switch-buffer-alist '+ivy-rich-buffer-name))
|
||||||
(setcar switch-buffer-alist '+ivy-rich-buffer-name)))
|
|
||||||
|
|
||||||
(ivy-rich-mode +1))
|
(ivy-rich-mode +1))
|
||||||
|
|
||||||
|
@ -264,7 +263,8 @@ evil-ex-specific constructs, so we disable it solely in evil-ex."
|
||||||
(cl-destructuring-bind (find-program . args)
|
(cl-destructuring-bind (find-program . args)
|
||||||
(cond ((executable-find doom-projectile-fd-binary)
|
(cond ((executable-find doom-projectile-fd-binary)
|
||||||
(append (list doom-projectile-fd-binary
|
(append (list doom-projectile-fd-binary
|
||||||
"--color=never" "-E" ".git" "--type" "file" "--type" "symlink" "--follow")
|
"--color=never" "-E" ".git"
|
||||||
|
"--type" "file" "--type" "symlink" "--follow")
|
||||||
(if IS-WINDOWS '("--path-separator=/"))))
|
(if IS-WINDOWS '("--path-separator=/"))))
|
||||||
((executable-find "rg")
|
((executable-find "rg")
|
||||||
(append (list "rg" "--files" "--follow" "--color=never" "--hidden" "--no-messages")
|
(append (list "rg" "--files" "--follow" "--color=never" "--hidden" "--no-messages")
|
||||||
|
@ -282,8 +282,8 @@ evil-ex-specific constructs, so we disable it solely in evil-ex."
|
||||||
(let ((offset (if (member find-program (list "rg" doom-projectile-fd-binary)) 0 2))
|
(let ((offset (if (member find-program (list "rg" doom-projectile-fd-binary)) 0 2))
|
||||||
files)
|
files)
|
||||||
(while (< (point) (point-max))
|
(while (< (point) (point-max))
|
||||||
(push (buffer-substring
|
(push (buffer-substring (+ offset (line-beginning-position)) (line-end-position))
|
||||||
(+ offset (line-beginning-position)) (line-end-position)) files)
|
files)
|
||||||
(forward-line 1))
|
(forward-line 1))
|
||||||
(nreverse files)))))))
|
(nreverse files)))))))
|
||||||
|
|
||||||
|
|
|
@ -353,7 +353,7 @@ Continues comments if executed from a commented line. Consults
|
||||||
"dL" #'doom/help-search-loaded-files
|
"dL" #'doom/help-search-loaded-files
|
||||||
"dm" #'doom/help-modules
|
"dm" #'doom/help-modules
|
||||||
"dn" #'doom/help-news
|
"dn" #'doom/help-news
|
||||||
"dN" #'doom/help-news-search
|
"dN" #'doom/help-search-news
|
||||||
"dpc" #'doom/help-package-config
|
"dpc" #'doom/help-package-config
|
||||||
"dpd" #'doom/goto-private-packages-file
|
"dpd" #'doom/goto-private-packages-file
|
||||||
"dph" #'doom/help-package-homepage
|
"dph" #'doom/help-package-homepage
|
||||||
|
|
|
@ -1,13 +1,10 @@
|
||||||
;;; editor/evil/config.el -*- lexical-binding: t; -*-
|
;;; editor/evil/config.el -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
;; I'm a vimmer at heart. Its modal philosophy suits me better, and this module
|
|
||||||
;; strives to make Emacs a much better vim than vim was.
|
|
||||||
|
|
||||||
(defvar +evil-repeat-keys (cons ";" ",")
|
(defvar +evil-repeat-keys (cons ";" ",")
|
||||||
"The keys to use for universal repeating motions.
|
"The keys to use for universal repeating motions.
|
||||||
|
|
||||||
This is a cons cell whose CAR is the key for repeating a motion forward, and
|
This is a cons cell whose CAR is the key for repeating a motion forward, and
|
||||||
whose CDR is for repeating backward. They should both be kbd-able strings.")
|
whose CDR is for repeating backward. They should both be `kbd'-able strings.")
|
||||||
|
|
||||||
(defvar +evil-want-o/O-to-continue-comments t
|
(defvar +evil-want-o/O-to-continue-comments t
|
||||||
"If non-nil, the o/O keys will continue comment lines if the point is on a
|
"If non-nil, the o/O keys will continue comment lines if the point is on a
|
||||||
|
@ -137,8 +134,8 @@ directives. By default, this only recognizes C directives.")
|
||||||
(and (>= char ?2) (<= char ?9)))
|
(and (>= char ?2) (<= char ?9)))
|
||||||
|
|
||||||
;; REVIEW Fix #2493: dir-locals cannot target fundamental-mode when evil-mode
|
;; REVIEW Fix #2493: dir-locals cannot target fundamental-mode when evil-mode
|
||||||
;; is active. See https://github.com/hlissner/doom-emacs/issues/2493.
|
;; is active. See hlissner/doom-emacs#2493. Revert this if
|
||||||
;; Revert this if this is ever fixed upstream.
|
;; emacs-evil/evil#1268 is resolved upstream.
|
||||||
(defadvice! +evil--fix-local-vars-a (&rest _)
|
(defadvice! +evil--fix-local-vars-a (&rest _)
|
||||||
:before #'turn-on-evil-mode
|
:before #'turn-on-evil-mode
|
||||||
(when (eq major-mode 'fundamental-mode)
|
(when (eq major-mode 'fundamental-mode)
|
||||||
|
@ -227,12 +224,12 @@ directives. By default, this only recognizes C directives.")
|
||||||
(use-package! evil-embrace
|
(use-package! evil-embrace
|
||||||
:commands embrace-add-pair embrace-add-pair-regexp
|
:commands embrace-add-pair embrace-add-pair-regexp
|
||||||
:hook (LaTeX-mode . embrace-LaTeX-mode-hook)
|
:hook (LaTeX-mode . embrace-LaTeX-mode-hook)
|
||||||
|
:hook (LaTeX-mode . +evil-embrace-latex-mode-hook-h)
|
||||||
:hook (org-mode . embrace-org-mode-hook)
|
:hook (org-mode . embrace-org-mode-hook)
|
||||||
:hook (ruby-mode . embrace-ruby-mode-hook)
|
:hook (ruby-mode . embrace-ruby-mode-hook)
|
||||||
:hook (emacs-lisp-mode . embrace-emacs-lisp-mode-hook)
|
:hook (emacs-lisp-mode . embrace-emacs-lisp-mode-hook)
|
||||||
:hook ((lisp-mode emacs-lisp-mode clojure-mode racket-mode hy-mode)
|
:hook ((lisp-mode emacs-lisp-mode clojure-mode racket-mode hy-mode)
|
||||||
. +evil-embrace-lisp-mode-hook-h)
|
. +evil-embrace-lisp-mode-hook-h)
|
||||||
:hook ((org-mode LaTeX-mode) . +evil-embrace-latex-mode-hook-h)
|
|
||||||
:hook ((c++-mode rustic-mode csharp-mode java-mode swift-mode typescript-mode)
|
:hook ((c++-mode rustic-mode csharp-mode java-mode swift-mode typescript-mode)
|
||||||
. +evil-embrace-angle-bracket-modes-hook-h)
|
. +evil-embrace-angle-bracket-modes-hook-h)
|
||||||
:init
|
:init
|
||||||
|
@ -369,14 +366,12 @@ directives. By default, this only recognizes C directives.")
|
||||||
(defmacro set-repeater! (command next-func prev-func)
|
(defmacro set-repeater! (command next-func prev-func)
|
||||||
"Makes ; and , the universal repeat-keys in evil-mode.
|
"Makes ; and , the universal repeat-keys in evil-mode.
|
||||||
To change these keys see `+evil-repeat-keys'."
|
To change these keys see `+evil-repeat-keys'."
|
||||||
(let ((fn-sym (intern (format "+evil/repeat-%s" (doom-unquote command)))))
|
`(defadvice! ,(intern (format "+evil--repeat-%s-a" (doom-unquote command))) (&rest _)
|
||||||
`(progn
|
:after-while #',command
|
||||||
(defun ,fn-sym (&rest _)
|
(when +evil-repeat-keys
|
||||||
(when +evil-repeat-keys
|
(evil-define-key* 'motion 'local
|
||||||
(evil-define-key* 'motion 'local
|
(kbd (car +evil-repeat-keys)) #',next-func
|
||||||
(kbd (car +evil-repeat-keys)) #',next-func
|
(kbd (cdr +evil-repeat-keys)) #',prev-func))))
|
||||||
(kbd (cdr +evil-repeat-keys)) #',prev-func)))
|
|
||||||
(advice-add #',command :after-while #',fn-sym))))
|
|
||||||
|
|
||||||
;; n/N
|
;; n/N
|
||||||
(set-repeater! evil-ex-search-next evil-ex-search-next evil-ex-search-previous)
|
(set-repeater! evil-ex-search-next evil-ex-search-next evil-ex-search-previous)
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
;;; editor/evil/init.el -*- lexical-binding: t; -*-
|
;;; editor/evil/init.el -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
|
(defvar evil-collection-key-blacklist)
|
||||||
|
|
||||||
;; We load evil-collection ourselves for these reasons:
|
;; We load evil-collection ourselves for these reasons:
|
||||||
;;
|
;;
|
||||||
;; 1. To truly lazy load it. Some of its modules, like
|
;; 1. To truly lazy load it. Some of its modules, like
|
||||||
|
|
|
@ -40,7 +40,7 @@
|
||||||
This is because there's no guarantee the remote system has GNU ls, which is the
|
This is because there's no guarantee the remote system has GNU ls, which is the
|
||||||
only variant that supports --group-directories-first."
|
only variant that supports --group-directories-first."
|
||||||
(when (file-remote-p default-directory)
|
(when (file-remote-p default-directory)
|
||||||
(setq-local dired-actual-switches "-ahl")))))
|
(setq-local dired-actual-switches (car args))))))
|
||||||
|
|
||||||
;; Don't complain about this command being disabled when we use it
|
;; Don't complain about this command being disabled when we use it
|
||||||
(put 'dired-find-alternate-file 'disabled nil)
|
(put 'dired-find-alternate-file 'disabled nil)
|
||||||
|
|
|
@ -42,16 +42,16 @@
|
||||||
(when (featurep! :ui workspaces)
|
(when (featurep! :ui workspaces)
|
||||||
(define-ibuffer-filter workspace-buffers
|
(define-ibuffer-filter workspace-buffers
|
||||||
"Filter for workspace buffers"
|
"Filter for workspace buffers"
|
||||||
(:reader
|
(:reader (+workspace-get (read-string "workspace name: "))
|
||||||
(+workspace-get (read-string "workspace name: ")) :description "workspace")
|
:description "workspace")
|
||||||
(memq buf (+workspace-buffer-list qualifier)))
|
(memq buf (+workspace-buffer-list qualifier)))
|
||||||
|
|
||||||
(defun +ibuffer/workspace (workspace-name)
|
(defun +ibuffer-workspace (workspace-name)
|
||||||
"Open an ibuffer window for a workspace"
|
"Open an ibuffer window for a workspace"
|
||||||
(ibuffer nil (format "%s buffers" workspace-name)
|
(ibuffer nil (format "%s buffers" workspace-name)
|
||||||
(list (cons 'workspace-buffers (+workspace-get workspace-name)))))
|
(list (cons 'workspace-buffers (+workspace-get workspace-name)))))
|
||||||
|
|
||||||
(defun +ibuffer-current-workspace ()
|
(defun +ibuffer/open-for-current-workspace ()
|
||||||
"Open an ibuffer window for the current workspace"
|
"Open an ibuffer window for the current workspace"
|
||||||
(interactive)
|
(interactive)
|
||||||
(+ibuffer/workspace (+workspace-current-name))))
|
(+ibuffer/workspace (+workspace-current-name))))
|
||||||
|
|
|
@ -46,11 +46,15 @@ exist, and `org-link' otherwise."
|
||||||
"Intepret LINK as an image file path and return its data."
|
"Intepret LINK as an image file path and return its data."
|
||||||
(setq
|
(setq
|
||||||
link (expand-file-name
|
link (expand-file-name
|
||||||
link
|
link (pcase protocol
|
||||||
(pcase protocol
|
("download"
|
||||||
("download" (or org-download-image-dir org-attach-id-dir default-directory))
|
(or (if (require 'org-download nil t) org-download-image-dir)
|
||||||
("attachment" org-attach-id-dir)
|
(if (require 'org-attach) org-attach-id-dir)
|
||||||
(_ default-directory))))
|
default-directory))
|
||||||
|
("attachment"
|
||||||
|
(require 'org-attach)
|
||||||
|
org-attach-id-dir)
|
||||||
|
(_ default-directory))))
|
||||||
(when (and (file-exists-p link)
|
(when (and (file-exists-p link)
|
||||||
(image-type-from-file-name link))
|
(image-type-from-file-name link))
|
||||||
(with-temp-buffer
|
(with-temp-buffer
|
||||||
|
|
|
@ -141,7 +141,7 @@ current file). Only scans first 2048 bytes of the document."
|
||||||
;;; Commands
|
;;; Commands
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +org/dwim-at-point ()
|
(defun +org/dwim-at-point (&optional arg)
|
||||||
"Do-what-I-mean at point.
|
"Do-what-I-mean at point.
|
||||||
|
|
||||||
If on a:
|
If on a:
|
||||||
|
@ -158,7 +158,7 @@ If on a:
|
||||||
- latex fragment: toggle it.
|
- latex fragment: toggle it.
|
||||||
- link: follow it
|
- link: follow it
|
||||||
- otherwise, refresh all inline images in current tree."
|
- otherwise, refresh all inline images in current tree."
|
||||||
(interactive)
|
(interactive "P")
|
||||||
(let* ((context (org-element-context))
|
(let* ((context (org-element-context))
|
||||||
(type (org-element-type context)))
|
(type (org-element-type context)))
|
||||||
;; skip over unimportant contexts
|
;; skip over unimportant contexts
|
||||||
|
@ -206,7 +206,7 @@ If on a:
|
||||||
|
|
||||||
(`table-cell
|
(`table-cell
|
||||||
(org-table-blank-field)
|
(org-table-blank-field)
|
||||||
(org-table-recalculate)
|
(org-table-recalculate arg)
|
||||||
(when (and (string-empty-p (string-trim (org-table-get-field)))
|
(when (and (string-empty-p (string-trim (org-table-get-field)))
|
||||||
(bound-and-true-p evil-local-mode))
|
(bound-and-true-p evil-local-mode))
|
||||||
(evil-change-state 'insert)))
|
(evil-change-state 'insert)))
|
||||||
|
@ -215,13 +215,13 @@ If on a:
|
||||||
(org-babel-lob-execute-maybe))
|
(org-babel-lob-execute-maybe))
|
||||||
|
|
||||||
(`statistics-cookie
|
(`statistics-cookie
|
||||||
(save-excursion (org-update-statistics-cookies nil)))
|
(save-excursion (org-update-statistics-cookies arg)))
|
||||||
|
|
||||||
((or `src-block `inline-src-block)
|
((or `src-block `inline-src-block)
|
||||||
(org-babel-execute-src-block))
|
(org-babel-execute-src-block arg))
|
||||||
|
|
||||||
((or `latex-fragment `latex-environment)
|
((or `latex-fragment `latex-environment)
|
||||||
(org-latex-preview))
|
(org-latex-preview arg))
|
||||||
|
|
||||||
(`link
|
(`link
|
||||||
(let* ((lineage (org-element-lineage context '(link) t))
|
(let* ((lineage (org-element-lineage context '(link) t))
|
||||||
|
@ -229,7 +229,7 @@ If on a:
|
||||||
(if (or (equal (org-element-property :type lineage) "img")
|
(if (or (equal (org-element-property :type lineage) "img")
|
||||||
(and path (image-type-from-file-name path)))
|
(and path (image-type-from-file-name path)))
|
||||||
(+org--refresh-inline-images-in-subtree)
|
(+org--refresh-inline-images-in-subtree)
|
||||||
(org-open-at-point))))
|
(org-open-at-point arg))))
|
||||||
|
|
||||||
((guard (org-element-property :checkbox (org-element-lineage context '(item) t)))
|
((guard (org-element-property :checkbox (org-element-lineage context '(item) t)))
|
||||||
(let ((match (and (org-at-item-checkbox-p) (match-string 1))))
|
(let ((match (and (org-at-item-checkbox-p) (match-string 1))))
|
||||||
|
@ -238,7 +238,7 @@ If on a:
|
||||||
(_
|
(_
|
||||||
(if (or (org-in-regexp org-ts-regexp-both nil t)
|
(if (or (org-in-regexp org-ts-regexp-both nil t)
|
||||||
(org-in-regexp org-tsr-regexp-both nil t)
|
(org-in-regexp org-tsr-regexp-both nil t)
|
||||||
(org-in-regexp org-any-link-re nil t))
|
(org-in-regexp org-link-any-re nil t))
|
||||||
(call-interactively #'org-open-at-point)
|
(call-interactively #'org-open-at-point)
|
||||||
(+org--refresh-inline-images-in-subtree))))))
|
(+org--refresh-inline-images-in-subtree))))))
|
||||||
|
|
||||||
|
|
|
@ -160,7 +160,7 @@ This forces it to read the background before rendering."
|
||||||
("HOLD" . +org-todo-onhold)
|
("HOLD" . +org-todo-onhold)
|
||||||
("PROJ" . +org-todo-project)))
|
("PROJ" . +org-todo-project)))
|
||||||
|
|
||||||
(defadvice! +org-display-link-in-eldoc-a (&rest args)
|
(defadvice! +org-display-link-in-eldoc-a (&rest _)
|
||||||
"Display full link in minibuffer when cursor/mouse is over it."
|
"Display full link in minibuffer when cursor/mouse is over it."
|
||||||
:before-until #'org-eldoc-documentation-function
|
:before-until #'org-eldoc-documentation-function
|
||||||
(when-let (link (org-element-property :raw-link (org-element-context)))
|
(when-let (link (org-element-property :raw-link (org-element-context)))
|
||||||
|
@ -196,10 +196,10 @@ This forces it to read the background before rendering."
|
||||||
;; I prefer C-c C-c over C-c ' (more consistent)
|
;; I prefer C-c C-c over C-c ' (more consistent)
|
||||||
(define-key org-src-mode-map (kbd "C-c C-c") #'org-edit-src-exit)
|
(define-key org-src-mode-map (kbd "C-c C-c") #'org-edit-src-exit)
|
||||||
|
|
||||||
(defadvice! +org-fix-newline-and-indent-in-src-blocks-a ()
|
(defadvice! +org-fix-newline-and-indent-in-src-blocks-a (&optional indent _arg _interactive)
|
||||||
"Mimic `newline-and-indent' in src blocks w/ lang-appropriate indentation."
|
"Mimic `newline-and-indent' in src blocks w/ lang-appropriate indentation."
|
||||||
:after #'org-return-indent
|
:after #'org-return
|
||||||
(when (org-in-src-block-p t)
|
(when (and indent (org-in-src-block-p t))
|
||||||
(org-babel-do-in-edit-buffer
|
(org-babel-do-in-edit-buffer
|
||||||
(call-interactively #'indent-for-tab-command))))
|
(call-interactively #'indent-for-tab-command))))
|
||||||
|
|
||||||
|
@ -916,8 +916,8 @@ compelling reason, so..."
|
||||||
:ni "C-S-k" #'org-shiftup
|
:ni "C-S-k" #'org-shiftup
|
||||||
:ni "C-S-j" #'org-shiftdown
|
:ni "C-S-j" #'org-shiftdown
|
||||||
;; more intuitive RET keybinds
|
;; more intuitive RET keybinds
|
||||||
:i [return] #'org-return-indent
|
:i [return] (λ! (org-return t))
|
||||||
:i "RET" #'org-return-indent
|
:i "RET" (λ! (org-return t))
|
||||||
:n [return] #'+org/dwim-at-point
|
:n [return] #'+org/dwim-at-point
|
||||||
:n "RET" #'+org/dwim-at-point
|
:n "RET" #'+org/dwim-at-point
|
||||||
;; more vim-esque org motion keys (not covered by evil-org-mode)
|
;; more vim-esque org motion keys (not covered by evil-org-mode)
|
||||||
|
|
|
@ -41,19 +41,19 @@
|
||||||
(defadvice! +org-present--narrow-to-subtree-a (orig-fn &rest args)
|
(defadvice! +org-present--narrow-to-subtree-a (orig-fn &rest args)
|
||||||
"Narrow to the target subtree when you start the presentation."
|
"Narrow to the target subtree when you start the presentation."
|
||||||
:around #'org-tree-slide--display-tree-with-narrow
|
:around #'org-tree-slide--display-tree-with-narrow
|
||||||
(letf! ((defun org-narrow-to-subtree ()
|
(letf! (defun org-narrow-to-subtree ()
|
||||||
(save-excursion
|
(save-excursion
|
||||||
(save-match-data
|
(save-match-data
|
||||||
(org-with-limited-levels
|
(org-with-limited-levels
|
||||||
(narrow-to-region
|
(narrow-to-region
|
||||||
(progn
|
(progn
|
||||||
(when (org-before-first-heading-p)
|
(when (org-before-first-heading-p)
|
||||||
(org-next-visible-heading 1))
|
(org-next-visible-heading 1))
|
||||||
(ignore-errors (org-up-heading-all 99))
|
(ignore-errors (org-up-heading-all 99))
|
||||||
(forward-line 1)
|
(forward-line 1)
|
||||||
(point))
|
(point))
|
||||||
(progn (org-end-of-subtree t t)
|
(progn (org-end-of-subtree t t)
|
||||||
(when (and (org-at-heading-p) (not (eobp)))
|
(when (and (org-at-heading-p) (not (eobp)))
|
||||||
(backward-char 1))
|
(backward-char 1))
|
||||||
(point))))))))
|
(point)))))))
|
||||||
(apply orig-fn args))))
|
(apply orig-fn args))))
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
"This module requires (:tools lsp)")
|
"This module requires (:tools lsp)")
|
||||||
|
|
||||||
(if (not (executable-find "python"))
|
(if (not (executable-find "python"))
|
||||||
(error! "Python isn't installed.")
|
(error! "Couldn't find python in your PATH")
|
||||||
(unless (featurep! +lsp)
|
(unless (featurep! +lsp)
|
||||||
(unless (zerop (shell-command "python -c 'import setuptools'"))
|
(unless (zerop (shell-command "python -c 'import setuptools'"))
|
||||||
(warn! "setuptools wasn't detected, which anaconda-mode requires"))))
|
(warn! "setuptools wasn't detected, which anaconda-mode requires"))))
|
||||||
|
|
|
@ -183,9 +183,10 @@ You should use `set-eshell-alias!' to change this.")
|
||||||
:hook (eshell-mode . fish-completion-mode)
|
:hook (eshell-mode . fish-completion-mode)
|
||||||
:init (setq fish-completion-fallback-on-bash-p t)
|
:init (setq fish-completion-fallback-on-bash-p t)
|
||||||
:config
|
:config
|
||||||
;; HACK Even with `fish-completion-fallback-on-bash-p' non-nil, fish must be
|
;; HACK Even with `fish-completion-fallback-on-bash-p' non-nil,
|
||||||
;; installed for bash completion to work. How frustrating. This way we
|
;; `fish-completion--list-completions-with-desc' will throw an error if
|
||||||
;; can at least get bash completion whether or not fish is present.
|
;; fish isn't installed (and so, will fail to fall back to bash), so we
|
||||||
|
;; advise it to fail silently.
|
||||||
(defadvice! +eshell--fallback-to-bash-a (&rest _)
|
(defadvice! +eshell--fallback-to-bash-a (&rest _)
|
||||||
:before-until #'fish-completion--list-completions-with-desc
|
:before-until #'fish-completion--list-completions-with-desc
|
||||||
(unless (executable-find "fish") "")))
|
(unless (executable-find "fish") "")))
|
||||||
|
|
|
@ -28,9 +28,8 @@
|
||||||
(if IS-MAC
|
(if IS-MAC
|
||||||
(package! osx-dictionary :pin "1b79ff64c72485cb078db9ab7ee3256b11a99f4b")
|
(package! osx-dictionary :pin "1b79ff64c72485cb078db9ab7ee3256b11a99f4b")
|
||||||
(package! define-word :pin "08c71b1ff4fd07bf0c78d1fcf77efeaafc8f7443")
|
(package! define-word :pin "08c71b1ff4fd07bf0c78d1fcf77efeaafc8f7443")
|
||||||
;; HACK Fix #2945: the main package is broken (see
|
;; HACK Fix #2945: the main package is broken due to
|
||||||
;; SavchenkoValeriy/emacs-powerthesaurus). We use this fork until it is
|
;; SavchenkoValeriy/emacs-powerthesaurus#11
|
||||||
;; merged.
|
|
||||||
(package! powerthesaurus
|
(package! powerthesaurus
|
||||||
:recipe (:host github :repo "maxchaos/emacs-powerthesaurus" :branch "pt-api-change")
|
:recipe (:host github :repo "maxchaos/emacs-powerthesaurus" :branch "pt-api-change")
|
||||||
:pin "4a834782a394f2dc70fc02d68b6962b44d87f0cf")
|
:pin "4a834782a394f2dc70fc02d68b6962b44d87f0cf")
|
||||||
|
|
|
@ -1,10 +1,22 @@
|
||||||
;;; tools/magit/autoload.el -*- lexical-binding: t; -*-
|
;;; tools/magit/autoload.el -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
;; HACK Magit complains loudly when it can't determine its own version, which is
|
;; HACK Magit complains loudly (but harmlessly) when it can't determine its own
|
||||||
;; the case when magit is built through straight. The warning is harmless,
|
;; version (in the case of a sparse clone).
|
||||||
;; however, so we just need it to shut up.
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(advice-add #'magit-version :override #'ignore)
|
(defadvice! +magit--ignore-version-a (&optional print-dest)
|
||||||
|
:override #'magit-version
|
||||||
|
(when print-dest
|
||||||
|
(defvar magit-git-debug)
|
||||||
|
(princ (format "Magit (unknown), Git %s, Emacs %s, %s"
|
||||||
|
(or (let ((magit-git-debug
|
||||||
|
(lambda (err)
|
||||||
|
(display-warning '(magit git) err :error))))
|
||||||
|
(magit-git-version t))
|
||||||
|
"(unknown)")
|
||||||
|
emacs-version
|
||||||
|
system-type)
|
||||||
|
print-dest))
|
||||||
|
nil)
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +magit-display-buffer-fn (buffer)
|
(defun +magit-display-buffer-fn (buffer)
|
||||||
|
|
|
@ -65,29 +65,30 @@
|
||||||
(setq-hook! 'pdf-view-mode-hook evil-normal-state-cursor (list nil))
|
(setq-hook! 'pdf-view-mode-hook evil-normal-state-cursor (list nil))
|
||||||
|
|
||||||
;; Install epdfinfo binary if needed, blocking until it is finished
|
;; Install epdfinfo binary if needed, blocking until it is finished
|
||||||
(require 'pdf-tools)
|
(when doom-interactive-mode
|
||||||
(unless (file-executable-p pdf-info-epdfinfo-program)
|
(require 'pdf-tools)
|
||||||
(let ((wconf (current-window-configuration)))
|
(unless (file-executable-p pdf-info-epdfinfo-program)
|
||||||
(pdf-tools-install)
|
(let ((wconf (current-window-configuration)))
|
||||||
(message "Building epdfinfo, this will take a moment...")
|
(pdf-tools-install)
|
||||||
;; HACK We reset all `pdf-view-mode' buffers to fundamental mode so that
|
(message "Building epdfinfo, this will take a moment...")
|
||||||
;; `pdf-tools-install' has a chance to reinitialize them as
|
;; HACK We reset all `pdf-view-mode' buffers to fundamental mode so that
|
||||||
;; `pdf-view-mode' buffers. This is necessary because
|
;; `pdf-tools-install' has a chance to reinitialize them as
|
||||||
;; `pdf-tools-install' won't do this to buffers that are already in
|
;; `pdf-view-mode' buffers. This is necessary because
|
||||||
;; pdf-view-mode.
|
;; `pdf-tools-install' won't do this to buffers that are already in
|
||||||
(dolist (buffer (doom-buffers-in-mode 'pdf-view-mode))
|
;; pdf-view-mode.
|
||||||
(with-current-buffer buffer (fundamental-mode)))
|
(dolist (buffer (doom-buffers-in-mode 'pdf-view-mode))
|
||||||
(while compilation-in-progress
|
(with-current-buffer buffer (fundamental-mode)))
|
||||||
;; Block until `pdf-tools-install' is done
|
(while compilation-in-progress
|
||||||
(redisplay)
|
;; Block until `pdf-tools-install' is done
|
||||||
(sleep-for 1))
|
(redisplay)
|
||||||
;; HACK If pdf-tools was loaded by you opening a pdf file, once
|
(sleep-for 1))
|
||||||
;; `pdf-tools-install' completes, `pdf-view-mode' will throw an error
|
;; HACK If pdf-tools was loaded by you opening a pdf file, once
|
||||||
;; because the compilation buffer is focused, not the pdf buffer.
|
;; `pdf-tools-install' completes, `pdf-view-mode' will throw an error
|
||||||
;; Therefore, it is imperative that the window config is restored.
|
;; because the compilation buffer is focused, not the pdf buffer.
|
||||||
(when (file-executable-p pdf-info-epdfinfo-program)
|
;; Therefore, it is imperative that the window config is restored.
|
||||||
(set-window-configuration wconf))))
|
(when (file-executable-p pdf-info-epdfinfo-program)
|
||||||
|
(set-window-configuration wconf))))
|
||||||
|
|
||||||
;; Sets up `pdf-tools-enable-minor-modes', `pdf-occur-global-minor-mode' and
|
;; Sets up `pdf-tools-enable-minor-modes', `pdf-occur-global-minor-mode' and
|
||||||
;; `pdf-virtual-global-minor-mode'.
|
;; `pdf-virtual-global-minor-mode'.
|
||||||
(pdf-tools-install-noverify))
|
(pdf-tools-install-noverify)))
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
(use-package! evil-goggles
|
(use-package! evil-goggles
|
||||||
:when (featurep! :editor evil)
|
:when (featurep! :editor evil)
|
||||||
:after-call pre-command-hook
|
:hook (doom-first-input . evil-goggles-mode)
|
||||||
:init
|
:init
|
||||||
(setq evil-goggles-duration 0.1
|
(setq evil-goggles-duration 0.1
|
||||||
evil-goggles-pulse nil ; too slow
|
evil-goggles-pulse nil ; too slow
|
||||||
|
@ -23,13 +23,12 @@
|
||||||
'(+eval:region
|
'(+eval:region
|
||||||
:face evil-goggles-yank-face
|
:face evil-goggles-yank-face
|
||||||
:switch evil-goggles-enable-yank
|
:switch evil-goggles-enable-yank
|
||||||
:advice evil-goggles--generic-async-advice))
|
:advice evil-goggles--generic-async-advice)))
|
||||||
(evil-goggles-mode +1))
|
|
||||||
|
|
||||||
|
|
||||||
(use-package! volatile-highlights
|
(use-package! volatile-highlights
|
||||||
:unless (featurep! :editor evil)
|
:unless (featurep! :editor evil)
|
||||||
:after-call pre-command-hook
|
:hook (doom-first-input . volatile-highlights-mode)
|
||||||
:config
|
:config
|
||||||
(after! undo-fu
|
(after! undo-fu
|
||||||
(vhl/define-extension 'undo-fu 'undo-fu-only-undo 'undo-fu-only-redo)
|
(vhl/define-extension 'undo-fu 'undo-fu-only-undo 'undo-fu-only-redo)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue