Minor updates.

This commit is contained in:
Derek Taylor
2020-08-11 17:27:59 -05:00
parent c00618a23a
commit 367af05623
154 changed files with 2484 additions and 1801 deletions

View File

@@ -34,7 +34,8 @@ calendar data from:
(cfw:open-calendar-buffer
:contents-sources
(list
(cfw:org-create-source "Green") ; orgmode source
(cfw:org-create-source "Green") ; org-agenda source
(cfw:org-create-file-source "cal" "/path/to/cal.org" "Cyan") ; other org source
(cfw:howm-create-source "Blue") ; howm source
(cfw:cal-create-source "Orange") ; diary source
(cfw:ical-create-source "Moon" "~/moon.ics" "Gray") ; ICS source1
@@ -42,23 +43,6 @@ calendar data from:
)))
#+END_SRC
To control what org files ~clfw:org-create-source~ will use, ~let~-bind
~org-agenda-files~ around a call to ~+calendar/open-calendar~ like so:
#+BEGIN_SRC emacs-lisp
;;;###autoload
(defun cfw:open-org-calendar-with-cal1 ()
(interactive)
(let ((org-agenda-files '("/path/to/org/" "/path/to/cal1.org")))
(call-interactively #'+calendar/open-calendar)))
;;;###autoload
(defun cfw:open-org-calendar-with-cal2 ()
(interactive)
(let ((org-agenda-files '("/path/to/org/" "/path/to/cal2.org")))
(call-interactively #'+calendar/open-calendar)))
#+END_SRC
The [[https://github.com/kiwanami/emacs-calfw][kiwanami/emacs-calfw]] project readme contains more examples.
** Synchronizing Org and Google Calendar

View File

@@ -33,9 +33,16 @@
(use-package! calfw-org
:commands (cfw:open-org-calendar
cfw:org-create-source
cfw:org-create-file-source
cfw:open-org-calendar-withkevin
my-open-calendar))
(use-package! calfw-cal
:commands (cfw:cal-create-source))
(use-package! calfw-ical
:commands (cfw:ical-create-source))
(use-package! org-gcal
:commands (org-gcal-sync

View File

@@ -3,4 +3,6 @@
(package! calfw :pin "03abce97620a4a7f7ec5f911e669da9031ab9088")
(package! calfw-org :pin "03abce97620a4a7f7ec5f911e669da9031ab9088")
(package! calfw-cal :pin "03abce97620a4a7f7ec5f911e669da9031ab9088")
(package! calfw-ical :pin "03abce97620a4a7f7ec5f911e669da9031ab9088")
(package! org-gcal :pin "744505832b34e07b44a5d97d8720b2d7492d7fc9")

View File

@@ -34,7 +34,6 @@ https://assets.doomemacs.org/completion/company/overlay.png
** Plugins
+ [[https://github.com/company-mode/company-mode][company-mode]]
+ [[https://github.com/hlissner/emacs-company-dict][company-dict]]
+ [[https://github.com/raxod502/prescient.el][company-prescient]]
+ [[https://github.com/sebastiencs/company-box][company-box]]* (=+childframe=)
* Prerequisites

View File

@@ -9,17 +9,18 @@
company-tooltip-limit 14
company-tooltip-align-annotations t
company-require-match 'never
company-global-modes
'(not erc-mode message-mode help-mode gud-mode)
company-global-modes '(not erc-mode message-mode help-mode gud-mode)
company-frontends '(company-pseudo-tooltip-frontend
company-echo-metadata-frontend)
;; Buffer-local backends will be computed when loading a major mode, so
;; only specify a global default here.
company-backends '(company-capf)
company-backends '(company-capf)
;; Company overrides `company-active-map' based on
;; `company-auto-complete-chars'; no magic please!
;; These auto-complete the current selection when
;; `company-auto-complete-chars' is typed. This is too magical. We
;; already have the much more explicit RET and TAB.
company-auto-complete nil
company-auto-complete-chars nil
;; Only search the current buffer for `company-dabbrev' (a backend that
@@ -75,14 +76,6 @@
(add-to-list 'company-files--regexps "file:\\(\\(?:\\.\\{1,2\\}/\\|~/\\|/\\)[^\]\n]*\\)"))
(use-package! company-prescient
:hook (company-mode . company-prescient-mode)
:config
;; NOTE prescient config duplicated with `ivy'
(setq prescient-save-file (concat doom-cache-dir "prescient-save.el"))
(prescient-persist-mode +1))
(use-package! company-box
:when (featurep! +childframe)
:hook (company-mode . company-box-mode)

View File

@@ -1,8 +1,7 @@
;; -*- no-byte-compile: t; -*-
;;; completion/company/packages.el
(package! company :pin "6333fc4ebbbf4d28e834de8715561e984f149ecb")
(package! company :pin "5eb7d868c2a13bbfb14060b79d69f0d59f6a5f60")
(package! company-dict :pin "cd7b8394f6014c57897f65d335d6b2bd65dab1f4")
(package! company-prescient :pin "0f4a89bdec61395138d968a38d375e63ccfbed63")
(when (featurep! +childframe)
(package! company-box :pin "3814fcb14e92f4b85b19e664e216a7c8d5c7144d"))
(package! company-box :pin "889d723786df2de27d248c9965149d04af44273a"))

View File

@@ -1,19 +1,19 @@
;; -*- no-byte-compile: t; -*-
;;; completion/helm/packages.el
(package! helm :pin "b6db9fb47a8900704394e63b795f4a54cb4701a8")
(package! helm-rg :pin "785a80fe5cc87e27c5ea3d00a70049028d9e2847")
(package! helm-c-yasnippet :pin "65ca732b510bfc31636708aebcfe4d2d845b59b0")
(package! helm :pin "5d224cb889aea8f090c82c5ae572b8db276bcf80")
(package! helm-rg :pin "ee0a3c09da0c843715344919400ab0a0190cc9dc")
(package! helm-c-yasnippet :pin "89cc8561e7e57e9d1070ee3641df019c7f49c5dd")
(package! helm-company :pin "6eb5c2d730a60e394e005b47c1db018697094dde")
(package! helm-describe-modes
:recipe (:host github :repo "emacs-helm/helm-describe-modes")
:pin "11fb36af119b784539d31c6160002de1957408aa")
(package! helm-projectile :pin "5328b74dddcee8d1913803ca8167868831a07463")
(package! helm-projectile :pin "2f3a2a03d6cb9419c25b432637aa11c8d2f9f3b7")
(package! swiper-helm :pin "93fb6db87bc6a5967898b5fd3286954cc72a0008")
(when (featurep! +fuzzy)
(package! helm-flx :pin "6640fac5cb16bee73c95b8ed1248a4e5e113690e"))
(when (featurep! +childframe)
(package! posframe :pin "093b29a53cbeda6d637ccc9ef4dfc47123e79b9e"))
(package! posframe :pin "922e4d239f7a083213d856de67a9686a091b1e27"))
(when (featurep! :lang org)
(package! helm-org :pin "b7a18dfc17e8b933956d61d68c435eee03a96c24"))
(package! helm-descbinds :pin "b72515982396b6e336ad7beb6767e95a80fca192")

View File

@@ -2,7 +2,7 @@
;;; completion/ido/packages.el
(package! flx-ido :pin "17f5c9cb2af18aa6f52910ff4a5a63591261ced5")
(package! ido-completing-read+ :pin "98d3a6e56b1d3652da7b47f49f76d77f82ea80ba")
(package! ido-completing-read+ :pin "b9ca2566b867464c25b720e2148d240961c110e7")
(package! ido-sort-mtime :pin "f638ff0c922af862f5211779f2311a27fde428eb")
(package! ido-vertical-mode :pin "16c4c1a112796ee0bcf401ea39d3e2643a89feaf")
(package! crm-custom :pin "f1aaccf64306a5f99d9bf7ba815d7ea41c15518d")

View File

@@ -77,6 +77,26 @@ Buffers that are considered unreal (see `doom-real-buffer-p') are dimmed with
((format "%s" val)))
t)))
;;;###autoload
(defun +ivy-format-function-line-or-arrow (cands)
"Transform CANDS into a string for minibuffer.
If in terminal, prefix candidates with a chevron to make it more obvious which
one you're selecting, especially in themes that can't set a good background for
`ivy-current-match'. This is a combination of `ivy-format-function-line' and
`ivy-format-function-arrow'.
In the GUI, this is the same as `ivy-format-function-line'."
(if (display-graphic-p)
(ivy-format-function-line cands)
(ivy--format-function-generic
(lambda (str)
(ivy--add-face (concat "> " str "\n") 'ivy-current-match))
(lambda (str)
(concat " " str "\n"))
cands
"")))
;;
;; Library

View File

@@ -69,7 +69,7 @@ results buffer.")
;; Highlight each ivy candidate including the following newline, so that it
;; extends to the right edge of the window
(setf (alist-get 't ivy-format-functions-alist)
#'ivy-format-function-line)
#'+ivy-format-function-line-or-arrow)
;; Integrate `ivy' with `better-jumper'; ensure a jump point is registered
;; before jumping to new locations with ivy
@@ -278,11 +278,11 @@ evil-ex-specific constructs, so we disable it solely in evil-ex."
"Change `counsel-file-jump' to use fd or ripgrep, if they are available."
:override #'counsel--find-return-list
(cl-destructuring-bind (find-program . args)
(cond ((executable-find doom-projectile-fd-binary)
(append (list doom-projectile-fd-binary
"--color=never" "-E" ".git"
"--type" "file" "--type" "symlink" "--follow")
(if IS-WINDOWS '("--path-separator=/"))))
(cond ((when-let (fd (executable-find (or doom-projectile-fd-binary "fd")))
(append (list fd
"--color=never" "-E" ".git"
"--type" "file" "--type" "symlink" "--follow")
(if IS-WINDOWS '("--path-separator=/")))))
((executable-find "rg")
(append (list "rg" "--files" "--follow" "--color=never" "--hidden" "--no-messages")
(cl-loop for dir in projectile-globally-ignored-directories
@@ -296,10 +296,9 @@ evil-ex-specific constructs, so we disable it solely in evil-ex."
(cons find-program args)
(lambda ()
(goto-char (point-min))
(let ((offset (if (member find-program (list "rg" doom-projectile-fd-binary)) 0 2))
files)
(let (files)
(while (< (point) (point-max))
(push (buffer-substring (+ offset (line-beginning-position)) (line-end-position))
(push (buffer-substring (line-beginning-position) (line-end-position))
files)
(forward-line 1))
(nreverse files)))))))

View File

@@ -1,18 +1,18 @@
;; -*- no-byte-compile: t; -*-
;;; completion/ivy/packages.el
(package! swiper :pin "544e7de63a4543a74596c5d95efa0bb9da25791e")
(package! swiper :pin "c6b60d34ac37bf4d91a25f16d22e528f85e06938")
(package! ivy)
(package! ivy-hydra)
(package! counsel)
(package! amx :pin "7fb7b874291e0cdeb1f0acb18564a686ec86788d")
(package! amx :pin "ccfc92c600df681df5e8b5fecec328c462ceb71e")
(package! counsel-projectile :pin "77392cbbc42e98fc137b43f1db1b111ba6e2dd75")
(package! ivy-rich :pin "10970130b41c6ef9570893cdab8dfbe720e2b1a9")
(package! wgrep :pin "f0ef9bfa44db503cdb2f83fcfbd2fa4e2382ef1f")
(if (featurep! +prescient)
(package! ivy-prescient :pin "3ab7605d997fb8337bf5ded2ad960b98ac0e1fd7")
(package! ivy-prescient :pin "b11d79b10df12c58edc3487371c2c47dfb9b50e6")
(when (featurep! +fuzzy)
(package! flx :pin "17f5c9cb2af18aa6f52910ff4a5a63591261ced5")))

View File

@@ -34,8 +34,10 @@
:desc "Evaluate buffer/region" "e" #'+eval/buffer-or-region
:desc "Evaluate & replace region" "E" #'+eval/region-and-replace
:desc "Format buffer/region" "f" #'+format/region-or-buffer
:desc "Find implementations" "i" #'+lookup/implementations
:desc "Jump to documentation" "k" #'+lookup/documentation
:desc "Send to repl" "s" #'+eval/send-region-to-repl
:desc "Find type definition" "t" #'+lookup/type-definition
:desc "Delete trailing whitespace" "w" #'delete-trailing-whitespace
:desc "Delete trailing newlines" "W" #'doom/delete-trailing-newlines
:desc "List errors" "x" #'flymake-show-diagnostics-buffer
@@ -43,7 +45,7 @@
:desc "List errors" "x" #'flycheck-list-errors)
(:when (and (featurep! :tools lsp) (not (featurep! :tools lsp +eglot)))
:desc "LSP Code actions" "a" #'lsp-execute-code-action
:desc "LSP Organize imports" "i" #'lsp-organize-imports
:desc "LSP Organize imports" "o" #'lsp-organize-imports
:desc "LSP Rename" "r" #'lsp-rename
(:after lsp-mode
:desc "LSP" "l" lsp-command-map)
@@ -55,10 +57,8 @@
:desc "Jump to symbol in any workspace" "J" #'helm-lsp-global-workspace-symbol))
(:when (featurep! :tools lsp +eglot)
:desc "LSP Execute code action" "a" #'eglot-code-actions
:desc "LSP Format buffer/region" "F" #'eglot-format
:desc "LSP Rename" "r" #'eglot-rename
:desc "LSP Find declaration" "j" #'eglot-find-declaration
:desc "LSP Find implementation" "J" #'eglot-find-implementation))
:desc "LSP Find declaration" "j" #'eglot-find-declaration))
;;; <leader> f --- file
(:prefix-map ("f" . "file")
@@ -118,8 +118,7 @@
:desc "Look up in all docsets" "K" #'+lookup/in-all-docsets
:desc "Search project" "p" #'+default/search-project
:desc "Search other project" "P" #'+default/search-other-project
:desc "Search buffer" "s" #'swiper-isearch
:desc "Search buffer for thing at point" "S" #'swiper-isearch-thing-at-point
:desc "Search buffer" "s" #'+default/search-buffer
:desc "Dictionary" "t" #'+lookup/dictionary-definition
:desc "Thesaurus" "T" #'+lookup/synonyms)
@@ -140,8 +139,8 @@
(cond ((featurep! :completion ivy) #'ivy-bibtex)
((featurep! :completion helm) #'helm-bibtex)))
:desc "Toggle org-clock" "c" #'+org/toggle-clock
:desc "Cancel org-clock" "C" #'org-clock-cancel
:desc "Toggle last org-clock" "c" #'+org/toggle-last-clock
:desc "Cancel current org-clock" "C" #'org-clock-cancel
:desc "Open deft" "d" #'deft
(:when (featurep! :lang org +noter)
:desc "Org noter" "e" #'org-noter)
@@ -165,12 +164,13 @@
:desc "Search Forever" "s" #'org-journal-search-forever))
(:when (featurep! :lang org +roam)
(:prefix ("r" . "roam")
:desc "Switch to buffer" "b" #'org-roam-switch-to-buffer
:desc "Org Roam Capture" "c" #'org-roam-capture
:desc "Find file" "f" #'org-roam-find-file
:desc "Show graph" "g" #'org-roam-graph
:desc "Insert" "i" #'org-roam-insert
:desc "Org Roam" "r" #'org-roam
:desc "Switch to buffer" "b" #'org-roam-switch-to-buffer
:desc "Org Roam Capture" "c" #'org-roam-capture
:desc "Find file" "f" #'org-roam-find-file
:desc "Show graph" "g" #'org-roam-graph
:desc "Insert" "i" #'org-roam-insert
:desc "Insert (skipping org-capture)" "I" #'org-roam-insert-immediate
:desc "Org Roam" "r" #'org-roam
(:prefix ("d" . "by date")
:desc "Arbitrary date" "d" #'org-roam-dailies-date
:desc "Today" "t" #'org-roam-dailies-today
@@ -277,7 +277,7 @@
(:when (featurep! :ui minimap)
:desc "Minimap mode" "m" #'minimap-mode)
(:when (featurep! :lang org +present)
:desc "org-tree-slide mode" "p" #'+org-present/start)
:desc "org-tree-slide mode" "p" #'org-tree-slide-mode)
:desc "Read-only mode" "r" #'read-only-mode
(:when (featurep! :checkers spell)
:desc "Flyspell" "s" #'flyspell-mode)
@@ -342,31 +342,32 @@
;;; <leader> w --- workspaces/windows
(:prefix-map ("w" . "workspaces/windows")
(:when (featurep! :ui workspaces)
:desc "Display workspaces" "d" #'+workspace/display
:desc "Rename workspace" "r" #'+workspace/rename
:desc "Create workspace" "c" #'+workspace/new
:desc "Delete workspace" "k" #'+workspace/delete
:desc "Save workspace" "S" #'+workspace/save
:desc "Switch to other workspace" "o" #'+workspace/other
:desc "Switch to left workspace" "p" #'+workspace/switch-left
:desc "Switch to right workspace" "n" #'+workspace/switch-right
:desc "Switch to" "w" #'+workspace/switch-to
:desc "Switch to workspace 1" "1" #'+workspace/switch-to-0
:desc "Switch to workspace 2" "2" #'+workspace/switch-to-1
:desc "Switch to workspace 3" "3" #'+workspace/switch-to-2
:desc "Switch to workspace 4" "4" #'+workspace/switch-to-3
:desc "Switch to workspace 5" "5" #'+workspace/switch-to-4
:desc "Switch to workspace 6" "6" #'+workspace/switch-to-5
:desc "Switch to workspace 7" "7" #'+workspace/switch-to-6
:desc "Switch to workspace 8" "8" #'+workspace/switch-to-7
:desc "Switch to workspace 9" "9" #'+workspace/switch-to-8
:desc "Switch to last workspace" "0" #'+workspace/switch-to-final)
:desc "Autosave session" "a" #'doom/quicksave-session
:desc "Display workspaces" "d" #'+workspace/display
:desc "Rename workspace" "r" #'+workspace/rename
:desc "Create workspace" "c" #'+workspace/new
:desc "Delete workspace" "k" #'+workspace/delete
:desc "Save session" "s" #'doom/save-session
:desc "Save workspace" "S" #'+workspace/save
:desc "Load session" "l" #'doom/load-session
:desc "Load last autosaved session" "L" #'doom/quickload-session
:desc "Switch to other workspace" "o" #'+workspace/other
:desc "Undo window config" "u" #'winner-undo
:desc "Redo window config" "U" #'winner-redo
:desc "Switch to left workspace" "p" #'+workspace/switch-left
:desc "Switch to right workspace" "n" #'+workspace/switch-right
:desc "Switch to" "w" #'+workspace/switch-to
:desc "Switch to workspace 1" "1" #'+workspace/switch-to-0
:desc "Switch to workspace 2" "2" #'+workspace/switch-to-1
:desc "Switch to workspace 3" "3" #'+workspace/switch-to-2
:desc "Switch to workspace 4" "4" #'+workspace/switch-to-3
:desc "Switch to workspace 5" "5" #'+workspace/switch-to-4
:desc "Switch to workspace 6" "6" #'+workspace/switch-to-5
:desc "Switch to workspace 7" "7" #'+workspace/switch-to-6
:desc "Switch to workspace 8" "8" #'+workspace/switch-to-7
:desc "Switch to workspace 9" "9" #'+workspace/switch-to-8
:desc "Switch to last workspace" "0" #'+workspace/switch-to-final)
:desc "Redo window config" "U" #'winner-redo)
;;; <leader> m --- multiple cursors
(:when (featurep! :editor multiple-cursors)
@@ -417,17 +418,10 @@
(map! "C-'" #'imenu
;;; Text scaling
[C-mouse-4] #'text-scale-increase
[C-mouse-5] #'text-scale-decrease
[C-down-mouse-2] (cmd! (text-scale-set 0))
"M-+" #'doom/reset-font-size
"M-=" #'doom/increase-font-size
"M--" #'doom/decrease-font-size
;;; newlines
[remap newline] #'newline-and-indent
"C-j" #'+default/newline
;;; search
(:when (featurep! :completion ivy)
"C-S-s" #'swiper

View File

@@ -50,10 +50,6 @@
(not (memq (char-after) (list ?\( ?\[ ?\{ ?\} ?\] ?\))))))
#'yas-insert-snippet)
;; Smarter newlines
:i [remap newline] #'newline-and-indent ; auto-indent on newline
:i "C-j" #'+default/newline ; default behavior
(:after help :map help-mode-map
:n "o" #'link-hint-open-link)
(:after helpful :map helpful-mode-map
@@ -69,6 +65,8 @@
[escape] #'View-quit-all)
(:after man :map Man-mode-map
:n "q" #'kill-current-buffer)
(:after geiser-doc :map geiser-doc-mode-map
:n "o" #'link-hint-open-link)
(:after (evil-org evil-easymotion)
:map evil-org-mode-map
@@ -108,8 +106,8 @@
;;; :completion
(map! (:when (featurep! :completion company)
:i "C-@" #'+company/complete
:i "C-SPC" #'+company/complete
:i "C-@" (cmds! (not (minibufferp)) #'+company/complete)
:i "C-SPC" (cmds! (not (minibufferp)) #'+company/complete)
(:after company
(:map company-active-map
"C-w" nil ; don't interfere with `evil-delete-backward-word'
@@ -342,9 +340,9 @@
;;; <leader> c --- code
(:prefix-map ("c" . "code")
(:unless (featurep! :tools lsp +eglot)
(:when (and (featurep! :tools lsp) (not (featurep! :tools lsp +eglot)))
:desc "LSP Execute code action" "a" #'lsp-execute-code-action
:desc "LSP Organize imports" "i" #'lsp-organize-imports
:desc "LSP Organize imports" "o" #'lsp-organize-imports
(:when (featurep! :completion ivy)
:desc "Jump to symbol in current workspace" "j" #'lsp-ivy-workspace-symbol
:desc "Jump to symbol in any workspace" "J" #'lsp-ivy-global-workspace-symbol)
@@ -356,10 +354,8 @@
:desc "LSP" "l" lsp-command-map))
(:when (featurep! :tools lsp +eglot)
:desc "LSP Execute code action" "a" #'eglot-code-actions
:desc "LSP Format buffer/region" "F" #'eglot-format
:desc "LSP Rename" "r" #'eglot-rename
:desc "LSP Find declaration" "j" #'eglot-find-declaration
:desc "LSP Find implementation" "J" #'eglot-find-implementation)
:desc "LSP Find declaration" "j" #'eglot-find-declaration)
:desc "Compile" "c" #'compile
:desc "Recompile" "C" #'recompile
:desc "Jump to definition" "d" #'+lookup/definition
@@ -367,8 +363,10 @@
:desc "Evaluate buffer/region" "e" #'+eval/buffer-or-region
:desc "Evaluate & replace region" "E" #'+eval:replace-region
:desc "Format buffer/region" "f" #'+format/region-or-buffer
:desc "Find implementations" "i" #'+lookup/implementations
:desc "Jump to documentation" "k" #'+lookup/documentation
:desc "Send to repl" "s" #'+eval/send-region-to-repl
:desc "Find type definition" "t" #'+lookup/type-definition
:desc "Delete trailing whitespace" "w" #'delete-trailing-whitespace
:desc "Delete trailing newlines" "W" #'doom/delete-trailing-newlines
:desc "List errors" "x" #'flymake-show-diagnostics-buffer
@@ -379,7 +377,7 @@
(:prefix-map ("f" . "file")
:desc "Open project editorconfig" "c" #'editorconfig-find-current-editorconfig
:desc "Copy this file" "C" #'doom/copy-this-file
:desc "Find directory" "d" #'dired
:desc "Find directory" "d" #'+default/dired
:desc "Delete this file" "D" #'doom/delete-this-file
:desc "Find file in emacs.d" "e" #'+default/find-in-emacsd
:desc "Browse emacs.d" "E" #'+default/browse-emacsd
@@ -475,8 +473,8 @@
(cond ((featurep! :completion ivy) #'ivy-bibtex)
((featurep! :completion helm) #'helm-bibtex)))
:desc "Toggle org-clock" "c" #'+org/toggle-clock
:desc "Cancel org-clock" "C" #'org-clock-cancel
:desc "Toggle last org-clock" "c" #'+org/toggle-last-clock
:desc "Cancel current org-clock" "C" #'org-clock-cancel
:desc "Open deft" "d" #'deft
(:when (featurep! :lang org +noter)
:desc "Org noter" "e" #'org-noter)
@@ -497,12 +495,13 @@
(:when (featurep! :lang org +roam)
(:prefix ("r" . "roam")
:desc "Switch to buffer" "b" #'org-roam-switch-to-buffer
:desc "Org Roam Capture" "c" #'org-roam-capture
:desc "Find file" "f" #'org-roam-find-file
:desc "Show graph" "g" #'org-roam-graph
:desc "Insert" "i" #'org-roam-insert
:desc "Org Roam" "r" #'org-roam
:desc "Switch to buffer" "b" #'org-roam-switch-to-buffer
:desc "Org Roam Capture" "c" #'org-roam-capture
:desc "Find file" "f" #'org-roam-find-file
:desc "Show graph" "g" #'org-roam-graph
:desc "Insert" "i" #'org-roam-insert
:desc "Insert (skipping org-capture)" "I" #'org-roam-insert-immediate
:desc "Org Roam" "r" #'org-roam
(:prefix ("d" . "by date")
:desc "Arbitrary date" "d" #'org-roam-dailies-date
:desc "Today" "t" #'org-roam-dailies-today
@@ -645,8 +644,7 @@
:desc "Search project" "p" #'+default/search-project
:desc "Search other project" "P" #'+default/search-other-project
:desc "Jump to mark" "r" #'evil-show-marks
:desc "Search buffer" "s" #'swiper-isearch
:desc "Search buffer for thing at point" "S" #'swiper-isearch-thing-at-point
:desc "Search buffer" "s" #'+default/search-buffer
:desc "Dictionary" "t" #'+lookup/dictionary-definition
:desc "Thesaurus" "T" #'+lookup/synonyms)

View File

@@ -427,11 +427,30 @@ Continues comments if executed from a commented line. Consults
;; which ctrl+RET will add a new "item" below the current one and
;; cmd+RET (Mac) / meta+RET (elsewhere) will add a new, blank line below
;; the current one.
:gn [C-return] #'+default/newline-below
:gn [C-S-return] #'+default/newline-above
;; C-<mouse-scroll-up> = text scale increase
;; C-<mouse-scroll-down> = text scale decrease
[C-down-mouse-2] (cmd! (text-scale-set 0))
;; auto-indent on newline by default
:gi [remap newline] #'newline-and-indent
;; insert literal newline
:gi "S-RET" #'+default/newline
:gi [S-return] #'+default/newline
:gi "C-j" #'+default/newline
;; Add new item below current (without splitting current line).
:gi "C-RET" #'+default/newline-below
:gn [C-return] #'+default/newline-below
;; Add new item above current (without splitting current line)
:gi "C-S-RET" #'+default/newline-above
:gn [C-S-return] #'+default/newline-above
(:when IS-MAC
:gn [s-return] #'+default/newline-below
:gn [S-s-return] #'+default/newline-above)))
:gn "s-RET" #'+default/newline-below
:gn [s-return] #'+default/newline-below
:gn "S-s-RET" #'+default/newline-above
:gn [S-s-return] #'+default/newline-above)))
;;

View File

@@ -9,43 +9,81 @@
"The file path that `+literate-config-file' will be tangled to, then
byte-compiled from.")
;;;###autoload
(defun +literate-tangle-h (&optional force-p)
"Tangles `+literate-config-file' if it has changed."
(let ((default-directory doom-private-dir))
(when (or (file-newer-than-file-p +literate-config-file
+literate-config-cache-file)
force-p)
(print! (start "Compiling your literate config..."))
(print-group!
(let* ((org (expand-file-name +literate-config-file))
(dest (concat (file-name-sans-extension +literate-config-file) ".el"))
(output (get-buffer-create "*org-tangle*")))
(unwind-protect
;; We tangle in a separate, blank process because loading it here
;; would load all of :lang org (very expensive!).
(and (require 'ob-tangle)
(letf! (defun message (msg &rest args)
(print! (info "%s") (apply #'format msg args)))
(org-babel-tangle-file org dest))
;; Write the cache file to serve as our mtime cache
(with-temp-file +literate-config-cache-file))
(kill-buffer output)))))))
(defvar org-mode-hook)
(defvar org-inhibit-startup)
;;;###autoload
(after! org
;; Recompile our literate config if we modify it
(add-hook 'after-save-hook #'+literate-recompile-maybe-h))
(defun +literate-tangle-h ()
"Tangles `+literate-config-file' if it has changed."
(print! (start "Compiling your literate config..."))
(print-group!
(let* ((default-directory doom-private-dir)
(org (expand-file-name +literate-config-file))
(dest (concat (file-name-sans-extension +literate-config-file) ".el")))
(and (require 'ox)
(require 'ob-tangle)
(letf! (;; Operate on a copy because `org-babel-tangle' has
;; side-effects we need to undo immediately as not to
;; overwrite the user's config; it's bad ettiquite.
(backup (make-temp-file (concat (file-name-nondirectory org) ".")))
;; A hack to prevent ob-tangle from operating relative to the
;; backup file and thus tangling to the wrong destinations.
(defun org-babel-tangle-single-block (&rest args)
(let* ((spec (apply org-babel-tangle-single-block args))
(file (nth 1 spec))
(file (if (file-equal-p file backup) org file))
(file (if org-babel-tangle-use-relative-file-links
(file-relative-name file)
file)))
(setf (nth 1 spec) file)
spec))
;; Ensure output conforms to the formatting of all doom CLIs
(defun message (msg &rest args)
(when msg
(print! (info "%s") (apply #'format msg args)))))
(unwind-protect
(with-temp-file backup
(insert-file-contents org)
(let ((buffer-file-name backup)
;; Prevent unwanted entries in recentf, or formatters, or
;; anything that could be on these hooks, really. Nothing
;; else should be touching these files (particularly in
;; interactive sessions).
(write-file-functions nil)
(before-save-hook nil)
(after-save-hook nil)
;; Prevent infinite recursion due to recompile-on-save
;; hooks later, and speed up `org-mode' init.
(org-mode-hook nil)
(org-inhibit-startup t))
(org-mode)
(with-silent-modifications
;; Tangling won't ordinarily expand #+INCLUDE directives,
;; so I do it myself.
(org-export-expand-include-keyword)
(org-babel-tangle nil dest))))
(ignore-errors (delete-file backup)))
;; Write an empty file to serve as our mtime cache
(with-temp-file +literate-config-cache-file)
t)))))
;;;###autoload
(add-hook 'org-mode-hook #'+literate-enable-recompile-h)
;;;###autoload
(defalias '+literate/reload #'doom/reload)
;;;###autoload
(defun +literate-enable-recompile-h ()
"Enable literate-compiling-on-save in the current buffer."
(add-hook 'after-save-hook #'+literate-recompile-maybe-h nil 'local))
;;;###autoload
(defun +literate-recompile-maybe-h ()
"Recompile config.org if we're editing an org file in our DOOMDIR.
"Recompile literate config to `doom-private-dir'.
We assume any org file in `doom-private-dir' is connected to your literate
config, and should trigger a recompile if changed."
(when (and (eq major-mode 'org-mode)
(file-in-directory-p buffer-file-name doom-private-dir))
(+literate-tangle-h 'force)))
(when (file-in-directory-p buffer-file-name doom-private-dir)
(+literate-tangle-h)))

View File

@@ -4,7 +4,9 @@
"The keys to use for universal repeating motions.
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.
Set this to `nil' to disable universal-repeating on these keys.")
(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
@@ -32,7 +34,6 @@ directives. By default, this only recognizes C directives.")
:preface
(setq evil-want-visual-char-semi-exclusive t
evil-ex-search-vim-style-regexp t
evil-ex-substitute-global t
evil-ex-visual-char-range t ; column range for ex commands
evil-mode-line-format 'nil
;; more vim-like behavior
@@ -45,12 +46,15 @@ directives. By default, this only recognizes C directives.")
evil-visual-state-cursor 'hollow
;; Only do highlighting in selected window so that Emacs has less work
;; to do highlighting them all.
evil-ex-interactive-search-highlight 'selected-window)
evil-ex-interactive-search-highlight 'selected-window
;; It's infuriating that innocuous "beginning of line" or "end of line"
;; errors will abort macros, so suppress them:
evil-kbd-macro-suppress-motion-error t)
;; Slow this down from 0.02 to prevent blocking in large or folded buffers
;; like magit while incrementally highlighting matches.
(setq-hook! 'magit-mode-hook evil-ex-hl-update-delay 0.2)
(setq-hook! 'so-long-minor-mode-hook evil-ex-hl-update-delay 0.25)
(setq-hook! '(magit-mode-hook so-long-minor-mode-hook)
evil-ex-hl-update-delay 0.25)
:config
(evil-select-search-module 'evil-search-module 'evil-search)
@@ -325,7 +329,7 @@ directives. By default, this only recognizes C directives.")
evil-snipe-repeat-scope 'visible
evil-snipe-char-fold t)
:config
(pushnew! evil-snipe-disabled-modes 'Info-mode 'calc-mode)
(pushnew! evil-snipe-disabled-modes 'Info-mode 'calc-mode 'treemacs-mode)
(evil-snipe-mode +1)
(evil-snipe-override-mode +1))
@@ -368,42 +372,6 @@ directives. By default, this only recognizes C directives.")
;;
;;; Keybinds
(defmacro set-repeater! (command next-func prev-func)
"Makes ; and , the universal repeat-keys in evil-mode.
To change these keys see `+evil-repeat-keys'."
`(defadvice! ,(intern (format "+evil--repeat-%s-a" (doom-unquote command))) (&rest _)
:after-while #',command
(when +evil-repeat-keys
(evil-define-key* 'motion 'local
(kbd (car +evil-repeat-keys)) #',next-func
(kbd (cdr +evil-repeat-keys)) #',prev-func))))
;; n/N
(set-repeater! evil-ex-search-next evil-ex-search-next evil-ex-search-previous)
(set-repeater! evil-ex-search-previous evil-ex-search-next evil-ex-search-previous)
(set-repeater! evil-ex-search-forward evil-ex-search-next evil-ex-search-previous)
(set-repeater! evil-ex-search-backward evil-ex-search-next evil-ex-search-previous)
;; f/F/t/T/s/S
(after! evil-snipe
(setq evil-snipe-repeat-keys nil
evil-snipe-override-evil-repeat-keys nil) ; causes problems with remapped ;
(set-repeater! evil-snipe-f evil-snipe-repeat evil-snipe-repeat-reverse)
(set-repeater! evil-snipe-F evil-snipe-repeat evil-snipe-repeat-reverse)
(set-repeater! evil-snipe-t evil-snipe-repeat evil-snipe-repeat-reverse)
(set-repeater! evil-snipe-T evil-snipe-repeat evil-snipe-repeat-reverse)
(set-repeater! evil-snipe-s evil-snipe-repeat evil-snipe-repeat-reverse)
(set-repeater! evil-snipe-S evil-snipe-repeat evil-snipe-repeat-reverse)
(set-repeater! evil-snipe-x evil-snipe-repeat evil-snipe-repeat-reverse)
(set-repeater! evil-snipe-X evil-snipe-repeat evil-snipe-repeat-reverse))
;; */#
(set-repeater! evil-visualstar/begin-search-forward
evil-ex-search-next evil-ex-search-previous)
(set-repeater! evil-visualstar/begin-search-backward
evil-ex-search-previous evil-ex-search-next)
;; Keybinds that have no Emacs+evil analogues (i.e. don't exist):
;; zq - mark word at point as good word
;; zw - mark word at point as bad
@@ -501,7 +469,7 @@ To change these keys see `+evil-repeat-keys'."
:nv "zn" #'+evil:narrow-buffer
:n "zN" #'doom/widen-indirectly-narrowed-buffer
:n "zx" #'kill-current-buffer
:n "ZX" #'bury-buffer
:n "ZX" #'doom/save-and-kill-buffer
;; don't leave visual mode after shifting
:v "<" #'+evil/visual-dedent ; vnoremap < <gv
:v ">" #'+evil/visual-indent ; vnoremap > >gv
@@ -552,7 +520,7 @@ To change these keys see `+evil-repeat-keys'."
"a" (evilem-create #'evil-forward-arg)
"A" (evilem-create #'evil-backward-arg)
"s" #'evil-avy-goto-char-2
"SPC" (cmd!! #'evil-avy-goto-char-timer t)
"SPC" (cmd! (let ((current-prefix-arg t)) (evil-avy-goto-char-timer)))
"/" #'evil-avy-goto-char-timer))
;; evil-snipe

View File

@@ -1,7 +1,7 @@
;; -*- no-byte-compile: t; -*-
;;; editor/evil/packages.el
(package! evil :pin "25fc5c6647979357cf3e39f0667a9b7ae5266af9")
(package! evil :pin "2bc6ca3587502fde67b93e411e329fc8224c916a")
(package! evil-args :pin "758ad5ae54ad34202064fec192c88151c08cb387")
(package! evil-easymotion :pin "f96c2ed38ddc07908db7c3c11bcd6285a3e8c2e9")
(package! evil-embrace :pin "4379adea032b25e359d01a36301b4a5afdd0d1b7")
@@ -11,12 +11,12 @@
(package! evil-exchange :pin "3030e21ee16a42dfce7f7cf86147b778b3f5d8c1")
(package! evil-indent-plus :pin "0c7501e6efed661242c3a20e0a6c79a6455c2c40")
(package! evil-lion :pin "6b03593f5dd6e7c9ca02207f9a73615cf94c93ab")
(package! evil-nerd-commenter :pin "1bd2de52011c39777a3e8779b14cee2790dc873b")
(package! evil-nerd-commenter :pin "87734b9c7fcd047f73a072b9d03ec05f786eeb03")
(package! evil-numbers
:recipe (:host github :repo "janpath/evil-numbers")
:pin "c2cfdd1eb1f193bea28ee79b191b78309677058a")
:pin "006da406d175c05fedca4431cccd569e20bef92c")
(package! evil-snipe :pin "6dcac7f2516c6137a2de532fc2c052f242559ee3")
(package! evil-surround :pin "1c34944d8c98da4a2385d24ee89eef9cdf569a12")
(package! evil-surround :pin "346d4d85fcf1f9517e9c4991c1efe68b4130f93a")
(package! evil-textobj-anyblock :pin "ff00980f0634f95bf2ad9956b615a155ea8743be")
(package! evil-traces :pin "bc25cae9fa5ab0ba1507827f0944f52ce0ca7462")
(package! evil-visualstar :pin "06c053d8f7381f91c53311b1234872ca96ced752")
@@ -33,4 +33,4 @@
(package! neotree)
(autoload 'neotree-make-executor "neotree" nil nil 'macro))
(package! evil-collection :pin "e065da3732f015428bd0068481dadad9e0e6d09c"))
(package! evil-collection :pin "3e62b6b1312f7907081be41a032aaacffa732fef"))

View File

@@ -89,6 +89,8 @@ evil is loaded and enabled)."
(match-string 1 path))
((file-in-directory-p path doom-emacs-dir)
(file-relative-name path doom-emacs-dir))
((file-in-directory-p path doom-private-dir)
(file-relative-name path doom-private-dir))
((abbreviate-file-name path))))))

View File

@@ -201,16 +201,43 @@ See `+format/buffer' for the interactive version of this function, and
;;
;;; Commands
(defun +format--org-region (beg end)
"Reformat the region within BEG and END.
If nil, BEG and/or END will default to the boundaries of the src block at point."
(let ((element (org-element-at-point)))
(save-excursion
(let* ((block-beg (save-excursion
(goto-char (org-babel-where-is-src-block-head element))
(line-beginning-position 2)))
(block-end (save-excursion
(goto-char (org-element-property :end element))
(skip-chars-backward " \t\n")
(line-beginning-position)))
(beg (if beg (max beg block-beg) block-beg))
(end (if end (min end block-end) block-end))
(lang (org-element-property :language element))
(major-mode (org-src-get-lang-mode lang)))
(if (eq major-mode 'org-mode)
(user-error "Cannot reformat an org src block in org-mode")
(+format/region beg end))))))
;;;###autoload
(defun +format/buffer ()
"Reformat the current buffer using LSP or `format-all-buffer'."
(interactive)
(call-interactively
(if (and +format-with-lsp
(bound-and-true-p lsp-mode)
(lsp-feature? "textDocument/formatting"))
#'lsp-format-buffer
#'format-all-buffer)))
(if (and (eq major-mode 'org-mode)
(org-in-src-block-p t))
(+format--org-region nil nil)
(call-interactively
(cond ((and +format-with-lsp
(bound-and-true-p lsp-mode)
(lsp-feature? "textDocument/formatting"))
#'lsp-format-buffer)
((and +format-with-lsp
(bound-and-true-p eglot--managed-mode)
(eglot--server-capable :documentFormattingProvider))
#'eglot-format-buffer)
(#'format-all-buffer)))))
;;;###autoload
(defun +format/region (beg end)
@@ -220,14 +247,21 @@ WARNING: this may not work everywhere. It will throw errors if the region
contains a syntax error in isolation. It is mostly useful for formatting
snippets or single lines."
(interactive "rP")
(if (and +format-with-lsp
(bound-and-true-p lsp-mode)
(lsp-feature? "textDocument/rangeFormatting"))
(call-interactively #'lsp-format-region)
(save-restriction
(narrow-to-region beg end)
(let ((+format-region-p t))
(+format/buffer)))))
(if (and (eq major-mode 'org-mode)
(org-in-src-block-p t))
(+format--org-region beg end)
(cond ((and +format-with-lsp
(bound-and-true-p lsp-mode)
(lsp-feature? "textDocument/rangeFormatting"))
(call-interactively #'lsp-format-region))
((and +format-with-lsp
(bound-and-true-p eglot--managed-mode)
(eglot--server-capable :documentRangeFormattingProvider))
(call-interactively #'eglot-format))
((save-restriction
(narrow-to-region beg end)
(let ((+format-region-p t))
(+format/buffer)))))))
;;;###autoload
(defun +format/region-or-buffer ()

View File

@@ -120,3 +120,12 @@ FLAGS can be g and/or i; which mean the same thing they do in
:key #'evil-mc-get-cursor-start))
(message "No cursors to undo in region"))
(evil-mc-undo-last-added-cursor)))
;;;###autoload (autoload '+multiple-cursors-execute-default-operator-fn "editor/multiple-cursors/autoload/evil-mc" nil t)
(after! evil-mc
(evil-mc-define-handler +multiple-cursors-execute-default-operator-fn ()
:cursor-clear region
(evil-mc-with-region-or-execute-macro region t
(funcall (evil-mc-get-command-name) region-start region-end))))

View File

@@ -67,20 +67,22 @@
(company-complete-common . evil-mc-execute-default-complete)
(doom/backward-to-bol-or-indent . evil-mc-execute-default-call)
(doom/forward-to-last-non-comment-or-eol . evil-mc-execute-default-call)
;; :emacs undo
(undo-fu-only-undo . evil-mc-execute-default-undo)
(undo-fu-only-redo . evil-mc-execute-default-redo)
;; :editor evil
(evil-delete-back-to-indentation . evil-mc-execute-default-call)
;; Have evil-mc work with explicit `evil-escape' (on C-g)
(evil-escape . evil-mc-execute-default-evil-normal-state)
;; Add `evil-org' support
(evil-org-delete . evil-mc-execute-default-evil-delete)
(evil-org-delete-char . evil-mc-execute-default-evil-delete)
(evil-org-delete-backward-char . evil-mc-execute-default-evil-delete)
;; `evil-numbers'
(evil-escape . evil-mc-execute-default-evil-normal-state) ; C-g
(evil-numbers/inc-at-pt-incremental)
(evil-numbers/dec-at-pt-incremental)))
(cl-pushnew `(,(car fn) (:default . ,(or (cdr fn) #'evil-mc-execute-default-call-with-count)))
evil-mc-custom-known-commands
:test #'eq
:key #'car))
(evil-numbers/dec-at-pt-incremental)
;; :tools eval
(+eval:replace-region . +multiple-cursors-execute-default-operator-fn)
;; :lang org
(evil-org-delete . evil-mc-execute-default-evil-delete)))
(setf (alist-get (car fn) evil-mc-custom-known-commands)
(list (cons :default
(or (cdr fn)
#'evil-mc-execute-default-call-with-count)))))
;; HACK Allow these commands to be repeated by prefixing them with a numerical
;; argument. See gabesoft/evil-mc#110
@@ -102,12 +104,12 @@
;; our multiple cursors
(add-hook 'evil-insert-state-entry-hook #'evil-mc-resume-cursors)
;; evil-escape's escape key sequence leaves behind extraneous characters
(cl-pushnew 'evil-escape-mode evil-mc-incompatible-minor-modes)
;; Lispy commands don't register on more than 1 cursor. Lispyville is fine
;; though.
(when (featurep! :editor lispy)
(cl-pushnew 'lispy-mode evil-mc-incompatible-minor-modes))
(pushnew! evil-mc-incompatible-minor-modes
;; evil-escape's escape key leaves behind extraneous characters
'evil-escape-mode
;; Lispy commands don't register on more than 1 cursor. Lispyville
;; is fine though.
'lispy-mode)
(add-hook! 'doom-escape-hook
(defun +multiple-cursors-escape-multiple-cursors-h ()
@@ -132,6 +134,9 @@
(after! multiple-cursors-core
(setq mc/list-file (concat doom-etc-dir "mc-lists.el"))
;; Can't use `mc/cmds-to-run-once' because mc-lists.el overwrites it
(add-to-list 'mc--default-cmds-to-run-once 'swiper-mc)
;; TODO multiple-cursors config for Emacs users?
;; mc doesn't play well with evil, this attempts to assuage some of its

View File

@@ -3,6 +3,9 @@
(cond
((featurep! :editor evil)
;; REVIEW Broken in 8abf2c1f4f0ade64cbb06c8f47055f04ab83e8d6 (latest commit at
;; time of writing). Revisit later.
(package! iedit :pin "77eb0a1e2e44b453e4ebf4c38409affa353f5139")
(package! evil-multiedit :pin "9f271e0e6048297692f80ed6c5ae8994ac523abc")
(package! evil-mc :pin "4d4c0172e4c7f80acc1d0e73d5fb3e536929b262"))

View File

@@ -11,9 +11,10 @@ This modules adds [[https://github.com/clemera/objed][objed]], a global minor-mo
text objects. It combines the ideas of versor-mode and other editors like Vim or
Kakoune and tries to align them with regular Emacs conventions.
Note that =objed= is intended as an *alternative* to =evil=, for people who
prefer standard Emacs key-bindings and conventions. It's not recommended to use
these modules together.
#+begin_quote
This module is incompatible with the =:editor evil=. Enabling them both will
cause errors.
#+end_quote
[[https://github.com/clemera/objed][See the objed project README]] for information on keybinds and usage.

View File

@@ -93,14 +93,39 @@
:filter-return #'yas--all-templates
(cl-delete-duplicates templates :test #'equal))
;; HACK Smartparens will interfere with snippets expanded by `hippie-expand`,
;; so temporarily disable smartparens during snippet expansion.
(after! hippie-exp
(defvar +snippets--smartparens-enabled-p t)
(defvar +snippets--expanding-p nil)
;; Is called for all snippet expansions,
(add-hook! 'yas-before-expand-snippet-hook
(defun +snippets--disable-smartparens-before-expand-h ()
;; Remember the initial smartparens state only once, when expanding a
;; top-level snippet.
(unless +snippets--expanding-p
(setq +snippets--expanding-p t
+snippets--smartparens-enabled-p smartparens-mode))
(when smartparens-mode
(smartparens-mode -1))))
;; Is called only for the top level snippet, but not for the nested ones.
;; Hence `+snippets--expanding-p'.
(add-hook! 'yas-after-exit-snippet-hook
(defun +snippets--restore-smartparens-after-expand-h ()
(setq +snippets--expanding-p nil)
(when +snippets--smartparens-enabled-p
(smartparens-mode 1)))))
;; If in a daemon session, front-load this expensive work:
(if (daemonp) (yas-reload-all)))
(use-package! auto-yasnippet
:defer t
:init (setq aya-persist-snippets-dir (concat doom-etc-dir "auto-snippets/"))
:config
(setq aya-persist-snippets-dir +snippets-dir)
(defadvice! +snippets--inhibit-yas-global-mode-a (orig-fn &rest args)
"auto-yasnippet enables `yas-global-mode'. This is obnoxious for folks like
us who use yas-minor-mode and enable yasnippet more selectively. This advice

View File

@@ -1,10 +1,10 @@
;; -*- no-byte-compile: t; -*-
;;; editor/snippets/packages.el
(package! yasnippet :pin "5b1217ab085fab4abeb1118dccb260691b446703")
(package! yasnippet :pin "5cbdbf0d2015540c59ed8ee0fcf4788effdf75b6")
(package! auto-yasnippet :pin "db9e0dd4335b2202cd5dac95bbbc87a1032d9bbe")
(package! doom-snippets
:recipe (:host github
:repo "hlissner/doom-snippets"
:files ("*.el" "*"))
:pin "422f683adfbec1b01fe00524690b64dc9e702ae0")
:pin "21b7c8d37224768091a34a6c3ede68d52d03fb18")

View File

@@ -162,7 +162,7 @@ we have to clean it up ourselves."
(use-package! fd-dired
:when (executable-find doom-projectile-fd-binary)
:when doom-projectile-fd-binary
:defer t
:init
(global-set-key [remap find-dired] #'fd-dired)

View File

@@ -3,10 +3,10 @@
(package! diredfl :pin "83567d00affce66a4e501563eddd0bd436ac48d0")
(package! dired-git-info :pin "b47f2b0c3a6cb9b7a62a4ee2605a492e512d40a9")
(package! diff-hl :pin "a625033fb1dde83f6e4c2fc21f632b22ec34b609")
(package! diff-hl :pin "2281a89a3ddc6616073da6f190dda08d23b18ba6")
(package! dired-rsync :pin "bfd5c155be1cb6b71c83e5f41116c81b6532b6d5")
(when (featurep! +ranger)
(package! ranger :pin "ae9b3816a6da927cca5beb62c45400103797a2da"))
(package! ranger :pin "d7c18370981c9e585bc0fb78f7e55033457ca643"))
(when (featurep! +icons)
(package! all-the-icons-dired :pin "fc2dfa1e9eb8bf1c402a675e7089638d702a27a5"))
(package! fd-dired :pin "001cc95effdd5c4d9974b3f2c40b2ddf1f0e3de2")
(package! fd-dired :pin "5622041068d5fa2f299dbc8aa91fece0ba260086")

View File

@@ -38,7 +38,7 @@ via IMAP) and ~mu~ (to index my mail into a format ~mu4e~ can understand).
+ ~+gmail~ Enables gmail-specific configuration.
** Plugins
This module install no plugins.
+ [[https://github.com/jeremy-compostella/org-msg][org-msg]]
* Prerequisites
This module requires:

View File

@@ -7,9 +7,6 @@
;;
;;; Packages
(add-to-list 'auto-mode-alist '("\\.\\(?:offlineimap\\|mbsync\\)rc\\'" . conf-mode))
(use-package! mu4e
:commands mu4e mu4e-compose-new
:init
@@ -108,16 +105,13 @@
:desc "attach" "a" #'mail-add-attachment))
(use-package! org-mu4e
:hook (mu4e-compose-mode . org-mu4e-compose-org-mode)
(use-package! org-msg
:hook (org-load . org-msg-mode)
:config
(setq org-mu4e-convert-to-html t)
(when (version< mu4e-mu-version "1.4")
(setq org-mu4e-link-query-in-headers-mode nil))
(setq org-msg-startup "inlineimages"
org-msg-greeting-name-limit 3
org-msg-text-plain-alternative t))
;; Only render to html once. If the first send fails for whatever reason,
;; org-mu4e would do so each time you try again.
(setq-hook! 'message-send-hook org-mu4e-convert-to-html nil))
;;

View File

@@ -1,3 +1,4 @@
;; -*- no-byte-compile: t; -*-
;;; email/mu4e/packages.el
(package! org-msg :pin "2db6725c4a4f4342a9c61895b7c3c82795b01fee")

View File

@@ -19,7 +19,9 @@
(use-package! fcitx
:after evil
:config
(when (executable-find "fcitx-remote")
(when (setq fcitx-remote-command
(or (executable-find "fcitx5-remote")
(executable-find "fcitx-remote")))
(fcitx-evil-turn-on)))
@@ -38,14 +40,9 @@ when exporting org-mode to html."
:filter-args #'org-html-paragraph
(cl-destructuring-bind (paragraph contents info) args
(let* ((fix-regexp "[[:multibyte:]]")
(origin-contents
(replace-regexp-in-string
"<[Bb][Rr] */>"
""
contents))
(fixed-contents
(replace-regexp-in-string
(concat "\\(" fix-regexp "\\) *\n *\\(" fix-regexp "\\)")
"\\1\\2"
origin-contents)))
contents)))
(list paragraph fixed-contents info))))

View File

@@ -1,7 +1,7 @@
;; -*- no-byte-compile: t; -*-
;;; input/chinese/packages.el
(package! pyim :pin "b934273bb33d6be6aea6e20e68930bc5aaf4a48a")
(package! pyim :pin "e54153f462dd8cd8e9bb379e0483a2849ec94f42")
(package! fcitx :pin "12dc2638ddd15c8f6cfaecb20e1f428ab2bb5624")
(package! ace-pinyin :pin "8b2e9335b02486730ea4ceee790130cc5328f9ea")
(package! pangu-spacing :pin "f92898949ba3bf991fd229416f3bbb54e9c6c223")

View File

@@ -47,14 +47,9 @@ when exporting org-mode to html."
:filter-args #'org-html-paragraph
(cl-destructuring-bind (paragraph contents info) args
(let* ((fix-regexp "[[:multibyte:]]")
(origin-contents
(replace-regexp-in-string
"<[Bb][Rr] */>"
""
contents))
(fixed-contents
(replace-regexp-in-string
(concat "\\(" fix-regexp "\\) *\n *\\(" fix-regexp "\\)")
"\\1\\2"
origin-contents)))
contents)))
(list paragraph fixed-contents info))))

View File

@@ -3,5 +3,5 @@
(package! migemo :pin "f42832c8ac462ecbec9a16eb781194f876fba64a")
(package! avy-migemo :pin "922a6dd82c0bfa316b0fbb56a9d4dd4ffa5707e7")
(package! ddskk :pin "11d91b4cce988e15d7c5fc4345535c9d7a92d53b")
(package! ddskk :pin "fe7f82ba568dc653431bf824a764993aa86a7aa3")
(package! pangu-spacing :pin "f92898949ba3bf991fd229416f3bbb54e9c6c223")

View File

@@ -6,11 +6,11 @@
:recipe (:host github :repo "agda/agda"
:files ("src/data/emacs-mode/agda-input.el")
:nonrecursive t)
:pin "ff9173e14e")
:pin "8eb0d01811a663cf2b27b482b3b18690adfa094b")
(package! agda2-mode
:recipe (:host github :repo "agda/agda"
:files ("src/data/emacs-mode/*.el"
(:exclude "agda-input.el"))
:nonrecursive t)
:pin "ff9173e14e"))
:pin "8eb0d01811a663cf2b27b482b3b18690adfa094b"))

View File

@@ -230,28 +230,26 @@ If rtags or rdm aren't available, fail silently instead of throwing a breaking e
(add-hook! '(c-mode-local-vars-hook
c++-mode-local-vars-hook
objc-mode-local-vars-hook)
(defun +cc-init-lsp-h ()
(setq-local company-transformers nil)
(setq-local company-lsp-async t)
(setq-local company-lsp-cache-candidates nil)
(lsp!))))
#'lsp!)
(when (featurep! :tools lsp +eglot)
;; Map eglot specific helper
(map! :localleader
:after cc-mode
:map c++-mode-map
:n :desc "Show type inheritance hierarchy" "ct" #'+cc/eglot-ccls-inheritance-hierarchy)
;; NOTE : This setting is untested yet
(after! eglot
;; IS-MAC custom configuration
(when IS-MAC
(add-to-list 'eglot-workspace-configuration
`((:ccls . ((:clang . ,(list :extraArgs ["-isystem/Library/Developer/CommandLineTools/usr/include/c++/v1"
"-isystem/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include"
"-isystem/usr/local/include"]
:resourceDir (string-trim (shell-command-to-string "clang -print-resource-dir"))))))))))))
(when (and (featurep! +lsp) (featurep! :tools lsp +eglot))
;; Map eglot specific helper
(map! :localleader
:after cc-mode
:map c++-mode-map
:n :desc "Show type inheritance hierarchy" "ct" #'+cc/eglot-ccls-inheritance-hierarchy)
;; NOTE : This setting is untested yet
(after! eglot
;; IS-MAC custom configuration
(when IS-MAC
(add-to-list 'eglot-workspace-configuration
`((:ccls . ((:clang . ,(list :extraArgs ["-isystem/Library/Developer/CommandLineTools/usr/include/c++/v1"
"-isystem/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include"
"-isystem/usr/local/include"]
:resourceDir (string-trim (shell-command-to-string "clang -print-resource-dir")))))))))))
(use-package! ccls
:when (and (featurep! +lsp) (not (featurep! :tools lsp +eglot)))

View File

@@ -3,31 +3,31 @@
(package! cmake-mode
:recipe (:host github :repo "emacsmirror/cmake-mode" :files (:defaults "*"))
:pin "bfe85bc009")
(package! cuda-mode :pin "9ae9eacfdb")
(package! demangle-mode :pin "06903d731d")
(package! disaster :pin "10a785facc")
(package! modern-cpp-font-lock :pin "02f104701b")
(package! opencl-mode :pin "55cb49c824")
:pin "bfe85bc009c4778b44e246d5c27d0f888f0bfc0c")
(package! cuda-mode :pin "9ae9eacfdba3559b5456342d0d03296290df8ff5")
(package! demangle-mode :pin "697c1dbde93f164eac7ea0dc530d7e8b799272d6")
(package! disaster :pin "10a785facc60d89d78e0d5177985ab1af1741bb4")
(package! modern-cpp-font-lock :pin "865955d0035382a17a7f03add0d00d0bd812b103")
(package! opencl-mode :pin "55cb49c8243e6420961d719faced035bc547c1ef")
(when (package! glsl-mode :pin "43d906688a")
(when (package! glsl-mode :pin "b07112016436d9634cd4ef747f9af6b01366d136")
(when (featurep! :completion company)
(package! company-glsl
:recipe (:host github :repo "Kaali/company-glsl")
:pin "404cd0694a")))
:pin "404cd0694ab34971f9c01eb22126cd2e7d3f9dc4")))
(if (featurep! +lsp)
(unless (featurep! :tools lsp +eglot)
;; ccls package is necessary only for lsp-mode.
(package! ccls :pin "17ec7bb4cf"))
(when (package! irony :pin "5f75fc0c92")
(package! irony-eldoc :pin "0df5831eaa")
(package! ccls :pin "b8e2f4d9b5bed5b5e8b387ac8e43eff723120b80"))
(when (package! irony :pin "5f75fc0c9274f4622470e2324e2f4457087aa643")
(package! irony-eldoc :pin "73e79a89fad982a2ba072f2fcc1b4e41f0aa2978")
(when (featurep! :checkers syntax)
(package! flycheck-irony :pin "42dbecd4a8"))
(package! flycheck-irony :pin "42dbecd4a865cabeb301193bb4d660e26ae3befe"))
(when (featurep! :completion company)
(package! company-irony :pin "b44711dfce")
(package! company-irony-c-headers :pin "72c386aeb0")))
(when (package! rtags :pin "d370c09007")
(package! company-irony :pin "b44711dfce445610c1ffaec4951c6ff3882b216a")
(package! company-irony-c-headers :pin "72c386aeb079fb261d9ec02e39211272f76bbd97")))
(when (package! rtags :pin "080cb0e6b025b5d3d40fe9f7aecc791c0ea53f36")
(when (featurep! :completion ivy)
(package! ivy-rtags))
(when (featurep! :completion helm)

View File

@@ -49,7 +49,7 @@
(setq nrepl-hide-special-buffers t
nrepl-log-messages nil
cider-font-lock-dynamically '(macro core function var)
cider-font-lock-dynamically '(macro core function var deprecated)
cider-overlays-use-font-lock t
cider-prompt-for-symbol nil
cider-repl-history-display-duplicates nil

View File

@@ -2,8 +2,8 @@
;;; lang/clojure/packages.el
(package! clojure-mode :pin "da9f1ec717dac1194404b4a4562dba6bd9a4ee3a")
(package! cider :pin "2c8f510a5ae0e6c1bdb96195e04629f4791dea79")
(package! clj-refactor :pin "8259791e054382457b87d1f78061b5e3ce948907")
(package! cider :pin "9e117c2ff34b7a63eee87c8bfa93a800bb94add5")
(package! clj-refactor :pin "97095682580bbc5bfebcbc5349f03f5bd7121c96")
(when (featurep! :checkers syntax)
(package! flycheck-clj-kondo :pin "5472c26ffdf754a0661357564874ffd4f8598805"))

View File

@@ -14,7 +14,7 @@
(use-package! sly
:defer t
:hook (lisp-mode-local-vars . sly-editing-mode)
:init
(after! lisp-mode
(set-repl-handler! 'lisp-mode #'sly-mrepl)
@@ -89,7 +89,7 @@
(:localleader
:map lisp-mode-map
:desc "Sly" "'" #'sly
:desc "Sly (ask)" ";" (λ!! #'sly '-)
:desc "Sly (ask)" ";" (cmd!! #'sly '-)
:desc "Expand macro" "m" #'macrostep-expand
(:prefix ("c" . "compile")
:desc "Compile file" "c" #'sly-compile-file

View File

@@ -1,6 +1,6 @@
;; -*- no-byte-compile: t; -*-
;;; lang/common-lisp/packages.el
(package! sly :pin "1382bda945")
(package! sly-macrostep :pin "5113e4e926")
(package! sly-repl-ansi-color :pin "b9cd52d1cf")
(package! sly :pin "becf7b72ec6ef1a8165ec796425e143282838a66")
(package! sly-macrostep :pin "5113e4e926cd752b1d0bcc1508b3ebad5def5fad")
(package! sly-repl-ansi-color :pin "b9cd52d1cf927bf7e08582d46ab0bcf1d4fb5048")

View File

@@ -1,5 +1,5 @@
;; -*- no-byte-compile: t; -*-
;;; lang/coq/packages.el
(package! proof-general :pin "9196749d55")
(package! company-coq :pin "f9dba9ddff")
(package! proof-general :pin "0f0bb2c00fb7b20fd187cb92d4d2c3f84c4c5987")
(package! company-coq :pin "7ec80586fa23e2d8caa3f26ad223c803df8abb0f")

View File

@@ -3,11 +3,7 @@
(after! crystal-mode
(set-lookup-handlers! 'crystal-mode
:definition #'crystal-def-jump
:references #'crystal-tool-imp)
(set-eval-handler! 'crystal-mode
'((:command . "crystal")
(:exec . "%c %s")
(:description . "Run Crystal script"))))
:references #'crystal-tool-imp))
(use-package! flycheck-crystal

View File

@@ -1,8 +1,8 @@
;; -*- no-byte-compile: t; -*-
;;; lang/crystal/packages.el
(package! crystal-mode :pin "2428b01624")
(package! inf-crystal :pin "02007b2a2a")
(package! crystal-mode :pin "f9e4db16ff9fdc6a296363aa35d19cfb4926e472")
(package! inf-crystal :pin "02007b2a2a3bea44902d7c83c4acba1e39d278e3")
(when (featurep! :checkers syntax)
(package! flycheck-crystal :pin "2428b01624")
(package! flycheck-ameba :pin "0c4925ae0e"))
(package! flycheck-crystal :pin "f9e4db16ff9fdc6a296363aa35d19cfb4926e472")
(package! flycheck-ameba :pin "0c4925ae0e998818326adcb47ed27ddf9761c7dc"))

View File

@@ -20,6 +20,7 @@ LSP).
** Plugins
+ [[https://github.com/josteink/csharp-mode][csharp-mode]]
+ [[https://github.com/omajid/csproj-mode][csproj-mode]]
+ [[https://github.com/OmniSharp/omnisharp-emacs][omnisharp]]* (not =+lsp=)
+ [[https://github.com/midnightSuyama/shader-mode][shader-mode]]* (=+unity=)

View File

@@ -13,7 +13,15 @@
:post-handlers '(("| " "SPC")))
(when (featurep! +lsp)
(add-hook 'csharp-mode-local-vars-hook #'lsp!)))
(add-hook 'csharp-mode-local-vars-hook #'lsp!))
(defadvice! +csharp-disable-clear-string-fences-a (orig-fn &rest args)
"This turns off `c-clear-string-fences' for `csharp-mode'. When
on for `csharp-mode' font lock breaks after an interpolated string
or terminating simple string."
:around #'csharp-disable-clear-string-fences
(unless (eq major-mode 'csharp-mode)
(apply orig-fn args))))
(use-package! omnisharp

View File

@@ -1,8 +1,9 @@
;; -*- no-byte-compile: t; -*-
;;; lang/csharp/packages.el
(package! csharp-mode :pin "57bd21bda4")
(package! csharp-mode :pin "48851778e0f01a2b0395e054e418a1d8a1687a06")
(package! csproj-mode :pin "a7f0f4610c976a28c41b9b8299892f88b5d0336c")
(unless (featurep! +lsp)
(package! omnisharp :pin "e658a18a76"))
(package! omnisharp :pin "e658a18a762438c3e1737612737b05d02a21ca2a"))
(when (featurep! +unity)
(package! shader-mode :pin "d7dc8d0d6f"))
(package! shader-mode :pin "d7dc8d0d6fe8914e8b6d5cf2081ad61e6952359c"))

View File

@@ -37,7 +37,12 @@
(sp-local-pair "fn " " end" :unless '(sp-in-comment-p sp-in-string-p)))
(when (featurep! +lsp)
(add-hook 'elixir-mode-local-vars-hook #'lsp!)))
(add-hook 'elixir-mode-local-vars-hook #'lsp!))
(after! highlight-numbers
(puthash 'elixir-mode
"\\_<-?[[:digit:]]+\\(?:_[[:digit:]]\\{3\\}\\)*\\_>"
highlight-numbers-modelist)))
(use-package! flycheck-credo

View File

@@ -2,7 +2,7 @@
;;; lang/elixir/packages.el
;; +elixir.el
(package! elixir-mode :pin "231291ecad")
(package! alchemist :pin "6f99367511")
(package! elixir-mode :pin "02a3922711b7dc6a25895df6d2bf00360fda45cc")
(package! alchemist :pin "6f99367511ae209f8fe2c990779764bbb4ccb6ed")
(when (featurep! :checkers syntax)
(package! flycheck-credo :pin "e88f11ead5"))
(package! flycheck-credo :pin "e88f11ead53805c361ec7706e44c3dfee1daa19f"))

View File

@@ -219,11 +219,10 @@ https://emacs.stackexchange.com/questions/10230/how-to-indent-keywords-aligned"
verbosity when editing a file in `doom-private-dir' or `doom-emacs-dir'."
(when (and (bound-and-true-p flycheck-mode)
(eq major-mode 'emacs-lisp-mode)
(or (not buffer-file-name)
(cl-find-if (doom-partial #'file-in-directory-p buffer-file-name)
(or (not default-directory)
(cl-find-if (doom-partial #'file-in-directory-p default-directory)
+emacs-lisp-disable-flycheck-in-dirs)))
(add-to-list (make-local-variable 'flycheck-disabled-checkers)
'emacs-lisp-checkdoc)
(add-to-list 'flycheck-disabled-checkers 'emacs-lisp-checkdoc)
(set (make-local-variable 'flycheck-emacs-lisp-check-form)
(concat "(progn "
(prin1-to-string
@@ -251,7 +250,7 @@ verbosity when editing a file in `doom-private-dir' or `doom-emacs-dir'."
(goto-char (match-beginning 0))
(and (stringp (plist-get (sexp-at-point) :pin))
(search-forward ":pin" nil t)
(let ((start (re-search-forward "\"[^\"]\\{10\\}" nil t))
(let ((start (re-search-forward "\"[^\"\n]\\{10\\}" nil t))
(finish (and (re-search-forward "\"" (line-end-position) t)
(match-beginning 0))))
(when (and start finish)

View File

@@ -46,7 +46,11 @@ employed so that flycheck still does *some* helpful linting.")
("describe" "xdescribe")))
(setq-hook! 'emacs-lisp-mode-hook
tab-width (or lisp-indent-offset 2)
;; Emacs' built-in elisp files use a hybrid tab->space indentation scheme
;; with a tab width of 8. Any smaller and the indentation will be
;; unreadable. Since Emacs' lisp indenter doesn't respect this variable it's
;; safe to ignore this setting otherwise.
tab-width 8
;; shorter name in modeline
mode-name "Elisp"
;; Don't treat autoloads or sexp openers as outline headers, we have

View File

@@ -1,7 +1,7 @@
;; -*- no-byte-compile: t; -*-
;;; lang/ess/packages.el
(package! ess :pin "625041ad51")
(package! ess-R-data-view :pin "d6e98d3ae1")
(package! polymode :pin "44265e3516")
(package! poly-R :pin "51ffeb6ec4")
(package! ess :pin "964bf64d8bb3c6dd710cd8f2259921099a50456a")
(package! ess-R-data-view :pin "d6e98d3ae1e2a2ea39a56eebcdb73e99d29562e9")
(package! polymode :pin "3284ff10017d280ba82f27dc20fe5223b0df709c")
(package! poly-R :pin "51ffeb6ec45dd44eafa4d22ad2d6150cc4b248fc")

View File

@@ -1,16 +1,16 @@
;; -*- no-byte-compile: t; -*-
;;; lang/java/packages.el
(package! android-mode :pin "d5332e339a")
(package! groovy-mode :pin "cafdd98e06")
(package! android-mode :pin "d5332e339a1f5e30559a53feffb8442ca79265d6")
(package! groovy-mode :pin "cafdd98e06a3bbff213f3ccb163de2c42d412b66")
(when (featurep! +meghanada)
(package! meghanada :pin "70bfbf553c"))
(package! meghanada :pin "e119c7b3271281d60892b80a0cc6488503baf38f"))
(when (featurep! +eclim)
(package! eclim :pin "23f5b294f8")
(package! eclim :pin "222ddd48fcf0ee01592dec77c58e0cf3f2ea1100")
(when (featurep! :completion company)
(package! company-emacs-eclim :pin "23f5b294f8")))
(package! company-emacs-eclim :pin "222ddd48fcf0ee01592dec77c58e0cf3f2ea1100")))
(when (featurep! +lsp)
(package! lsp-java :pin "6efb741845"))
(package! lsp-java :pin "811760ad89a29939c28f47d0925f58d9eeea9fa3"))

View File

@@ -6,11 +6,7 @@
(setq ledger-clear-whole-transactions 1
ledger-mode-should-check-version nil)
:config
(setq ledger-binary-path
(if (executable-find "hledger")
"hledger"
"ledger"))
(set-company-backend! 'ledger-mode 'company-capf)
(defadvice! +ledger--check-version-a (orig-fn)
"Fail gracefully if ledger binary isn't available."

View File

@@ -24,20 +24,27 @@ lua-language-server.")
(set-repl-handler! 'lua-mode #'+lua/open-repl)
(set-company-backend! 'lua-mode '(company-lua company-yasnippet))
(set-eglot-client!
'lua-mode
;; The absolute path to lua-language-server binary is necessary because the
;; bundled dependencies aren't found otherwise. The only reason this is a
;; function is to dynamically change when/if lua-lsp-dir variable changed
(list (doom-path lua-lsp-dir
(cond (IS-MAC "bin/macOS")
(IS-LINUX "bin/Linux")
(IS-WINDOWS "bin/Windows"))
"lua-language-server")
"-E" "-e" "LANG=en"
(doom-path lua-lsp-dir "main.lua")))
(when (featurep! +lsp)
(defun +lua-generate-lsp-server-command ()
;; The absolute path to lua-language-server binary is necessary because
;; the bundled dependencies aren't found otherwise. The only reason this
;; is a function is to dynamically change when/if `+lua-lsp-dir' does
(list (doom-path +lua-lsp-dir
(cond (IS-MAC "bin/macOS")
(IS-LINUX "bin/Linux")
(IS-WINDOWS "bin/Windows"))
"lua-language-server")
"-E" "-e" "LANG=en"
(doom-path +lua-lsp-dir "main.lua")))
(if (featurep! :tools lsp +eglot)
(set-eglot-client! 'lua-mode (+lua-generate-lsp-server-command))
(after! lsp-mode
(lsp-register-client
(make-lsp-client :new-connection (lsp-stdio-connection '+lua-generate-lsp-server-command)
:major-modes '(lua-mode)
:priority -1
:server-id 'lua-langserver))))
(add-hook 'lua-mode-local-vars-hook #'lsp!)))

View File

@@ -1,13 +1,14 @@
;; -*- no-byte-compile: t; -*-
;;; lang/lua/packages.el
(package! lua-mode :pin "1f596a93b3")
(package! lua-mode :pin "35b6e4c20b8b4eaf783ccc8e613d0dd06dbd165c")
(when (featurep! +moonscript)
(package! moonscript :pin "56f90471e2")
(package! moonscript :pin "56f90471e2ced2b0a177aed4d8c2f854797e9cc7")
(when (featurep! :checkers syntax)
(package! flycheck-moonscript
:recipe (:host github :repo "hlissner/emacs-flycheck-moonscript") :pin "fcb99e5efc")))
:recipe (:host github :repo "hlissner/emacs-flycheck-moonscript")
:pin "fcb99e5efcf31db05f236f02eaa575986a57172d")))
(when (featurep! :completion company)
(package! company-lua :pin "29f6819de4"))
(package! company-lua :pin "29f6819de4d691e5fd0b62893a9f4fbc1c6fcb52"))

View File

@@ -1,12 +1,12 @@
;; -*- no-byte-compile: t; -*-
;;; lang/markdown/packages.el
(package! markdown-mode :pin "770e3aa7cdfc9d731119b9425e8a7c8ac6dd5f93")
(package! markdown-mode :pin "fa9fa20e3236006c2cf278209356f60cc4175120")
(package! markdown-toc :pin "9565eeaa1d26bc0ab83eb65bd30470888f724044")
(package! edit-indirect :pin "935ded353b9ed3da67bc61abf245c21b58d88864")
(when (featurep! +grip)
(package! grip-mode :pin "9615c4774727a719d38313a679d70f2a2c6aca68"))
(package! grip-mode :pin "52768a0187f8ce9b42010dc45bbc432551aeccee"))
(when (featurep! :editor evil +everywhere)
(package! evil-markdown

View File

@@ -1,7 +1,7 @@
;; -*- no-byte-compile: t; -*-
;;; lang/nix/packages.el
(package! nix-mode :pin "5b5961780f3b1c1b62453d2087f775298980f10d")
(package! nix-mode :pin "a00b3f776de65b5af7571976a73213ca2a5c683e")
(package! nix-update :pin "fc6c39c2da3fcfa62f4796816c084a6389c8b6e7")
(when (featurep! :completion company)

View File

@@ -1,25 +1,24 @@
;; -*- no-byte-compile: t; -*-
;;; lang/ocaml/packages.el
(package! tuareg :pin "c12061eb80")
(package! tuareg :pin "ccde45bbc292123ec20617f1af7f7e19f7481545")
(unless (featurep! +lsp)
(package! merlin :pin "37e38e44f5")
(package! merlin-eldoc :pin "db7fab1edd")
(package! merlin :pin "3751cbfff75022c396c4ff4dc1729048f80daa4f")
(package! merlin-eldoc :pin "db7fab1eddfe34781b7e79694f8923b285698032")
(when (featurep! :checkers syntax)
(package! flycheck-ocaml :pin "8707a7bf54")))
(package! flycheck-ocaml :pin "8707a7bf545a8639a6a5c600a98d9a2ea1487dc9")))
(package! ocp-indent :pin "9e26c0a269")
(package! ocp-indent :pin "9e26c0a2699b7076cebc04ece59fb354eb84c11c")
(when (featurep! :tools eval)
(package! utop :pin "30c77ce4d7"))
(package! utop :pin "7bc5117d3449fc19f5c706a6decfdb2a30984507"))
(when (featurep! :editor format)
;; by default quelpa generated a version 0pre0.20180929.192844, which got
;; parsed into (0 -1 0 ...), which when compared with version nil (0) in
;; package-installed-p always yielded false
(package! ocamlformat :recipe
(:host github :repo "ocaml-ppx/ocamlformat" :files ("emacs/*.el")) :pin "5282e047bb"))
(package! ocamlformat
:recipe (:host github :repo "ocaml-ppx/ocamlformat" :files ("emacs/*.el"))
:pin "27a49cc289dc99cfbe32e90aafc8d9e3cb32a059"))
(package! dune :recipe
(:host github :repo "ocaml/dune" :files ("editor-integration/emacs/*.el")) :pin "1944d0fb52")
(package! dune
:recipe (:host github :repo "ocaml/dune" :files ("editor-integration/emacs/*.el"))
:pin "66cfb3a2fb5a507f8c58e0ca516bfa20ca14d544")

View File

@@ -70,12 +70,15 @@ https://www.mfoot.com/blog/2015/11/22/literate-emacs-configuration-with-org-mode
+ =+pomodoro= Enables a pomodoro timer for clocking time on tasks.
+ =+present= Enables integration with reveal.js, beamer and org-tree-slide, so
Emacs can be used for presentations.
+ =+roam= Enables org-roam integration.
+ =+pretty= Enables pretty unicode symbols for bullets and priorities, and
better syntax highlighting for latex. Keep in mind: this can be expensive. If
org becomes too slow, it'd be wise to disable this flag.
+ =+roam= Enables org-roam integration. This requires ~sqlite3~ to be installed
on your system.
** Plugins
+ [[https://github.com/hniksic/emacs-htmlize][htmlize]]
+ [[https://github.com/astahlman/ob-async][ob-async]]
+ [[https://github.com/integral-dw/org-superstar-mode][org-superstar]]
+ [[https://github.com/rexim/org-cliplink][org-cliplink]]
+ [[https://github.com/magit/orgit][orgit]]
+ [[https://orgmode.org/][org-plus-contrib]]
@@ -121,6 +124,9 @@ https://www.mfoot.com/blog/2015/11/22/literate-emacs-configuration-with-org-mode
+ [[https://github.com/anler/centered-window-mode][centered-window]]
+ [[https://github.com/takaxp/org-tree-slide][org-tree-slide]]
+ [[https://gitlab.com/oer/org-re-reveal][org-re-reveal]]
+ =+pretty=
+ [[https://github.com/integral-dw/org-superstar-mode][org-superstar]]
+ [[https://github.com/harrybournis/org-fancy-priorities][org-fancy-priorities]]
+ =+roam=
+ [[https://github.com/org-roam/org-roam][org-roam]]
+ [[https://github.com/org-roam/company-org-roam][company-org-roam]]
@@ -162,12 +168,13 @@ https://www.mfoot.com/blog/2015/11/22/literate-emacs-configuration-with-org-mode
Org has a few soft dependencies that you will need to make use of Org's more
esoteric features:
+ For inline LaTeX previews, you need ~latex~ and ~dvipng~.
+ For rendering GNUPlot images (with =+gnuplot= flag) you need the ~gnuplot~
program installed.
+ To run babel code blocks, you need whatever dependencies those languages need.
It is recommended you enable the associated =:lang= module and ensure its
dependencies are met, e.g. install the =ruby= executable for ruby support.
+ For inline LaTeX previews, ~latex~ and ~dvipng~ is needed.
+ To render GNUPlot images (with =+gnuplot= flag) the ~gnuplot~ program is
needed.
+ To execute babel code blocks, you need whatever dependencies those languages
need. It is recommended you enable the associated =:lang= module and ensure
its dependencies are met, e.g. install the =ruby= executable for ruby support.
+ =org-roam= (with the =+roam= flag) requires =sqlite3= to be installed.
** MacOS
#+BEGIN_SRC sh

View File

@@ -74,8 +74,9 @@ exist, and `org-link' otherwise."
;;;###autoload
(defun +org-http-image-data-fn (protocol link _description)
"Interpret LINK as an URL to an image file."
(when (image-type-from-file-name link)
(if-let* ((buf (url-retrieve-synchronously (concat protocol ":" link))))
(when (and (image-type-from-file-name link)
(not (eq org-display-remote-inline-images 'skip)))
(if-let (buf (url-retrieve-synchronously (concat protocol ":" link)))
(with-current-buffer buf
(goto-char (point-min))
(re-search-forward "\r?\n\r?\n" nil t)

View File

@@ -3,82 +3,82 @@
;;
;;; Helpers
(defun +org--refresh-inline-images-in-subtree ()
"Refresh image previews in the current heading/tree."
(if (> (length org-inline-image-overlays) 0)
(org-remove-inline-images)
(org-display-inline-images
t t
(if (org-before-first-heading-p)
(line-beginning-position)
(save-excursion (org-back-to-heading) (point)))
(if (org-before-first-heading-p)
(line-end-position)
(save-excursion (org-end-of-subtree) (point))))))
(defun +org--toggle-inline-images-in-subtree (&optional beg end refresh)
"Refresh inline image previews in the current heading/tree."
(let ((beg (or beg
(if (org-before-first-heading-p)
(line-beginning-position)
(save-excursion (org-back-to-heading) (point)))))
(end (or end
(if (org-before-first-heading-p)
(line-end-position)
(save-excursion (org-end-of-subtree) (point)))))
(overlays (cl-remove-if-not (lambda (ov) (overlay-get ov 'org-image-overlay))
(ignore-errors (overlays-in beg end)))))
(dolist (ov overlays nil)
(delete-overlay ov)
(setq org-inline-image-overlays (delete ov org-inline-image-overlays)))
(when (or refresh (not overlays))
(org-display-inline-images t t beg end)
t)))
(defun +org--insert-item (direction)
(let* ((context
(save-excursion
(when (bolp)
(back-to-indentation)
(forward-char))
(org-element-lineage
(org-element-context)
'(table table-row headline inlinetask item plain-list)
t)))
(type (org-element-type context)))
(cond ((memq type '(item plain-list))
(let ((marker (org-element-property :bullet context))
(pad (save-excursion
(org-beginning-of-item)
(back-to-indentation)
(- (point) (line-beginning-position)))))
(save-match-data
(pcase direction
(`below
(org-end-of-item)
(backward-char)
(end-of-line)
(if (and marker (string-match "\\([0-9]+\\)\\([).] *\\)" marker))
(let ((l (line-number-at-pos)))
(org-insert-item)
(when (= l (line-number-at-pos))
(org-next-item)
(org-end-of-line)))
(insert "\n" (make-string pad 32) (or marker ""))))
(`above
(org-beginning-of-item)
(if (and marker (string-match-p "[0-9]+[).]" marker))
(org-insert-item)
(insert (make-string pad 32) (or marker ""))
(save-excursion (insert "\n")))))))
(when (org-element-property :checkbox context)
(insert "[ ] ")))
(let ((context (org-element-lineage
(org-element-context)
'(table table-row headline inlinetask item plain-list)
t)))
(pcase (org-element-type context)
;; Add a new list item (carrying over checkboxes if necessary)
((or `item `plain-list)
;; Position determines where org-insert-todo-heading and org-insert-item
;; insert the new list item.
(if (eq direction 'above)
(org-beginning-of-item)
(org-end-of-item)
(backward-char))
(org-insert-item (org-element-property :checkbox context))
;; Handle edge case where current item is empty and bottom of list is
;; flush against a new heading.
(when (and (eq direction 'below)
(eq (org-element-property :contents-begin context)
(org-element-property :contents-end context)))
(org-end-of-item)
(org-end-of-line)))
((memq type '(table table-row))
(pcase direction
('below (save-excursion (org-table-insert-row t))
(org-table-next-row))
('above (save-excursion (org-shiftmetadown))
(+org/table-previous-row))))
;; Add a new table row
((or `table `table-row)
(pcase direction
('below (save-excursion (org-table-insert-row t))
(org-table-next-row))
('above (save-excursion (org-shiftmetadown))
(+org/table-previous-row))))
((let ((level (or (org-current-level) 1)))
(pcase direction
(`below
(let (org-insert-heading-respect-content)
(goto-char (line-end-position))
(org-end-of-subtree)
(insert "\n" (make-string level ?*) " ")))
(`above
(org-back-to-heading)
(insert (make-string level ?*) " ")
(save-excursion (insert "\n"))))
(when-let* ((todo-keyword (org-element-property :todo-keyword context))
(todo-type (org-element-property :todo-type context)))
(org-todo (cond ((eq todo-type 'done)
(car (+org-get-todo-keywords-for todo-keyword)))
(todo-keyword)
('todo)))))))
;; Otherwise, add a new heading, carrying over any todo state, if
;; necessary.
(_
(let ((level (or (org-current-level) 1)))
;; I intentionally avoid `org-insert-heading' and the like because they
;; impose unpredictable whitespace rules depending on the cursor
;; position. It's simpler to express this command's responsibility at a
;; lower level than work around all the quirks in org's API.
(pcase direction
(`below
(let (org-insert-heading-respect-content)
(goto-char (line-end-position))
(org-end-of-subtree)
(insert "\n" (make-string level ?*) " ")))
(`above
(org-back-to-heading)
(insert (make-string level ?*) " ")
(save-excursion (insert "\n"))))
(when-let* ((todo-keyword (org-element-property :todo-keyword context))
(todo-type (org-element-property :todo-type context)))
(org-todo
(cond ((eq todo-type 'done)
;; Doesn't make sense to create more "DONE" headings
(car (+org-get-todo-keywords-for todo-keyword)))
(todo-keyword)
('todo)))))))
(when (org-invisible-p)
(org-show-hidden-entry))
@@ -147,7 +147,8 @@ current file). Only scans first 2048 bytes of the document."
If on a:
- checkbox list item or todo heading: toggle it.
- clock: update its time.
- headline: toggle latex fragments and inline images underneath.
- headline: cycle ARCHIVE subtrees, toggle latex fragments and inline images in
subtree; update statistics cookies/checkboxes and ToCs.
- footnote reference: jump to the footnote's definition
- footnote definition: jump to the first reference of this footnote
- table-row or a TBLFM: recalculate the table's formulas
@@ -167,7 +168,8 @@ If on a:
type (org-element-type context)))
(pcase type
(`headline
(cond ((memq (bound-and-true-p org-goto-map) (current-active-maps))
(cond ((memq (bound-and-true-p org-goto-map)
(current-active-maps))
(org-goto-ret))
((and (fboundp 'toc-org-insert-toc)
(member "TOC" (org-get-tags)))
@@ -181,11 +183,32 @@ If on a:
(if (eq (org-element-property :todo-type context) 'done)
(or (car (+org-get-todo-keywords-for (org-element-property :todo-keyword context)))
'todo)
'done)))
(t
(+org--refresh-inline-images-in-subtree)
(org-clear-latex-preview)
(org-latex-preview '(4)))))
'done))))
;; Update any metadata or inline previews in this subtree
(org-update-checkbox-count)
(let (org-hierarchical-todo-statistics)
(org-update-parent-todo-statistics))
(when (and (fboundp 'toc-org-insert-toc)
(member "TOC" (org-get-tags)))
(toc-org-insert-toc)
(message "Updating table of contents"))
(let* ((beg (if (org-before-first-heading-p)
(line-beginning-position)
(save-excursion (org-back-to-heading) (point))))
(end (if (org-before-first-heading-p)
(line-end-position)
(save-excursion (org-end-of-subtree) (point))))
(overlays (ignore-errors (overlays-in beg end)))
(latex-overlays
(cl-find-if (lambda (o) (eq (overlay-get o 'org-overlay-type) 'org-latex-overlay))
overlays))
(image-overlays
(cl-find-if (lambda (o) (overlay-get o 'org-image-overlay))
overlays)))
(+org--toggle-inline-images-in-subtree beg end)
(if (or image-overlays latex-overlays)
(org-clear-latex-preview beg end)
(org--latex-preview-region beg end))))
(`clock (org-clock-update-time-maybe))
@@ -230,7 +253,9 @@ If on a:
(path (org-element-property :path lineage)))
(if (or (equal (org-element-property :type lineage) "img")
(and path (image-type-from-file-name path)))
(+org--refresh-inline-images-in-subtree)
(+org--toggle-inline-images-in-subtree
(org-element-property :begin lineage)
(org-element-property :end lineage))
(org-open-at-point arg))))
((guard (org-element-property :checkbox (org-element-lineage context '(item) t)))
@@ -242,12 +267,23 @@ If on a:
(org-in-regexp org-tsr-regexp-both nil t)
(org-in-regexp org-link-any-re nil t))
(call-interactively #'org-open-at-point)
(+org--refresh-inline-images-in-subtree))))))
(+org--toggle-inline-images-in-subtree
(org-element-property :begin context)
(org-element-property :end context)))))))
;;;###autoload
(defun +org/shift-return (&optional arg)
"Insert a literal newline, or dwim in tables.
Executes `org-table-copy-down' if in table."
(interactive "p")
(if (org-at-table-p)
(org-table-copy-down arg)
(org-return nil arg)))
;; I use this instead of `org-insert-item' or `org-insert-heading' which are too
;; opinionated and perform this simple task incorrectly (e.g. whitespace in the
;; wrong places).
;; I use these instead of `org-insert-item' or `org-insert-heading' because they
;; impose bizarre whitespace rules depending on cursor location and many
;; settings. These commands have a much simpler responsibility.
;;;###autoload
(defun +org/insert-item-below (count)
"Inserts a new heading, table cell or item below the current one."
@@ -262,37 +298,24 @@ If on a:
;;;###autoload
(defun +org/dedent ()
"TODO"
(interactive)
(cond ((org-at-item-p)
(org-list-indent-item-generic
-1 nil
(save-excursion
(when (org-region-active-p)
(goto-char (region-beginning)))
(org-list-struct))))
((org-at-heading-p)
(ignore-errors (org-promote)))
((call-interactively #'self-insert-command))))
(defun +org/toggle-last-clock (arg)
"Toggles last clocked item.
;;;###autoload
(defun +org/toggle-clock (arg)
"Toggles clock on the last clocked item.
Clock out if an active clock is running (or cancel it if prefix ARG is non-nil).
Clock out if an active clock is running. Clock in otherwise.
If in an org file, clock in on the item at point. Otherwise clock into the last
task you clocked into.
See `org-clock-out', `org-clock-in' and `org-clock-in-last' for details on how
the prefix ARG changes this command's behavior."
If no clock is active, then clock into the last item. See `org-clock-in-last' to
see how ARG affects this command."
(interactive "P")
(if (org-clocking-p)
(if arg
(org-clock-cancel)
(org-clock-out))
(org-clock-in-last arg)))
(cond ((org-clocking-p)
(if arg
(org-clock-cancel)
(org-clock-out)))
((and (null org-clock-history)
(or (org-on-heading-p)
(org-at-item-p))
(y-or-n-p "No active clock. Clock in on current item?"))
(org-clock-in))
((org-clock-in-last arg))))
;;; Folds
@@ -390,15 +413,15 @@ Made for `org-tab-first-hook' in evil-mode."
;;;###autoload
(defun +org-update-cookies-h ()
"Update counts in headlines (aka \"cookies\")."
"Update statistics cookies/todo statistics in headlines."
(when (and buffer-file-name (file-exists-p buffer-file-name))
(let (org-hierarchical-todo-statistics)
(org-update-parent-todo-statistics))))
;;;###autoload
(defun +org-yas-expand-maybe-h ()
"Tries to expand a yasnippet snippet, if one is available. Made for
`org-tab-first-hook'."
"Expand a yasnippet snippet, if trigger exists at point or region is active.
Made for `org-tab-first-hook'."
(when (bound-and-true-p yas-minor-mode)
(and (let ((major-mode (if (org-in-src-block-p t)
(org-src-get-lang-mode (org-eldoc-get-src-lang))
@@ -422,8 +445,14 @@ Made for `org-tab-first-hook' in evil-mode."
;;;###autoload
(defun +org-cycle-only-current-subtree-h (&optional arg)
"Toggle the local fold at the point (as opposed to cycling through all levels
with `org-cycle')."
"Toggle the local fold at the point, and no deeper.
`org-cycle's standard behavior is to cycle between three levels: collapsed,
subtree and whole document. This is slow, especially in larger org buffer. Most
of the time I just want to peek into the current subtree -- at most, expand
*only* the current subtree.
All my (performant) foldings needs are met between this and `org-show-subtree'
(on zO for evil users), and `org-cycle' on shift-TAB if I need it."
(interactive "P")
(unless (eq this-command 'org-shifttab)
(save-excursion
@@ -439,19 +468,14 @@ with `org-cycle')."
(org-cycle-internal-local)
t)))))
;;;###autoload
(defun +org-clear-babel-results-h ()
"Remove the results block for the org babel block at point."
(when (and (org-in-src-block-p t)
(org-babel-where-is-src-block-result))
(org-babel-remove-result)
t))
;;;###autoload
(defun +org-make-last-point-visible-h ()
"Unfold subtree around point if saveplace places it to a folded region."
(and (not org-agenda-inhibit-startup)
(outline-invisible-p)
"Unfold subtree around point if saveplace places us in a folded region."
(and (not org-inhibit-startup)
(not org-inhibit-startup-visibility-stuff)
(org-invisible-p nil 'folding-only)
(or (not (org-on-heading-p))
(not (member "ARCHIVE" (org-get-tags))))
(ignore-errors
(save-excursion
(outline-previous-visible-heading 1)

View File

@@ -74,15 +74,24 @@ Is relative to `org-directory', unless it is absolute. Is used in Doom's default
(unless org-agenda-files
(setq org-agenda-files (list org-directory)))
(setq-default
;; Different colors for different priority levels
org-agenda-deadline-faces
'((1.001 . error)
(1.0 . org-warning)
(0.5 . org-upcoming-deadline)
(0.0 . org-upcoming-distant-deadline))
;; Don't monopolize the whole frame just for the agenda
org-agenda-window-setup 'current-window
org-agenda-skip-unavailable-files t
;; Move the agenda to show the previous 3 days and the next 7 days for a bit
;; better context instead of just the current week which is a bit confusing
;; on, for example, a sunday
;; Shift the agenda to show the previous 3 days and the next 7 days for
;; better context on your week. The past is less important than the future.
org-agenda-span 10
org-agenda-start-on-weekday nil
org-agenda-start-day "-3d"))
org-agenda-start-day "-3d"
;; Optimize `org-agenda' by inhibiting extra work while opening agenda
;; buffers in the background. They'll be "restarted" if the user switches to
;; them anyway (see `+org-exclude-agenda-buffers-from-workspace-h')
org-agenda-inhibit-startup t))
(defun +org-init-appearance-h ()
@@ -93,11 +102,13 @@ Is relative to `org-directory', unless it is absolute. Is used in Doom's default
org-entities-user
'(("flat" "\\flat" nil "" "" "266D" "")
("sharp" "\\sharp" nil "" "" "266F" ""))
org-fontify-done-headline t
org-fontify-quote-and-verse-blocks t
org-fontify-whole-heading-line t
org-footnote-auto-label 'plain
org-hide-leading-stars t
org-image-actual-width nil
org-imenu-depth 8
org-priority-faces
'((?A . error)
(?B . warning)
@@ -200,10 +211,27 @@ This forces it to read the background before rendering."
(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."
:after #'org-return
(when (and indent (org-in-src-block-p t))
(when (and indent
org-src-tab-acts-natively
(org-in-src-block-p t))
(org-babel-do-in-edit-buffer
(call-interactively #'indent-for-tab-command))))
(defadvice! +org-inhibit-mode-hooks-a (orig-fn datum name &optional initialize &rest args)
"Prevent potentially expensive mode hooks in `org-babel-do-in-edit-buffer' ops."
:around #'org-src--edit-element
(apply orig-fn datum name
(if (and (eq org-src-window-setup 'switch-invisibly)
(functionp initialize))
;; org-babel-do-in-edit-buffer is used to execute quick, one-off
;; logic in the context of another major mode. Initializing this
;; major mode can be terribly expensive (particular its mode
;; hooks), so we inhibit them.
(lambda ()
(quiet! (delay-mode-hooks (funcall initialize))))
initialize)
args))
;; Refresh inline images after executing src blocks (useful for plantuml or
;; ipython, where the result could be an image)
(add-hook 'org-babel-after-execute-hook #'org-redisplay-inline-images)
@@ -344,10 +372,7 @@ relative to `org-directory', unless it is an absolute path."
(propertize (abbreviate-file-name (buffer-file-name (buffer-base-buffer)))
'face 'font-lock-string-face)
org-eldoc-breadcrumb-separator
header-line-format))))
(when (featurep! :editor evil)
(add-hook 'org-capture-mode-hook #'evil-insert-state)))
header-line-format)))))
(defun +org-init-capture-frame-h ()
@@ -413,19 +438,27 @@ relative to `org-directory', unless it is an absolute path."
(+org-define-basic-link "doom-docs" 'doom-docs-dir)
(+org-define-basic-link "doom-modules" 'doom-modules-dir)
;; Allow inline image previews of http(s)? urls or data uris
;; Allow inline image previews of http(s)? urls or data uris.
;; `+org-http-image-data-fn' will respect `org-display-remote-inline-images'.
(setq org-display-remote-inline-images 'download) ; TRAMP urls
(org-link-set-parameters "http" :image-data-fun #'+org-http-image-data-fn)
(org-link-set-parameters "https" :image-data-fun #'+org-http-image-data-fn)
(org-link-set-parameters "img" :image-data-fun #'+org-inline-image-data-fn)
;; Add support for youtube links + previews
(require 'org-yt nil t))
(require 'org-yt nil t)
(defadvice! +org-dont-preview-if-disabled-a (&rest _)
"Make `org-yt' respect `org-display-remote-inline-images'."
:before-while #'org-yt-image-data-fun
(not (eq org-display-remote-inline-images 'skip))))
(defun +org-init-export-h ()
"TODO"
(setq org-export-with-smart-quotes t
org-html-validation-link nil)
org-html-validation-link nil
org-latex-prefer-user-labels t)
(when (featurep! :lang markdown)
(add-to-list 'org-export-backends 'md))
@@ -514,7 +547,7 @@ eldoc string."
(funcall orig-fn
(cl-loop for part in path
;; Remove full link syntax
for fixedpart = (replace-regexp-in-string org-link-any-re "\\4" part)
for fixedpart = (replace-regexp-in-string org-link-any-re "\\4" (or part ""))
for n from 0
for face = (nth (% n org-n-level-faces) org-level-faces)
collect
@@ -538,24 +571,25 @@ eldoc string."
(add-hook! 'org-agenda-finalize-hook
(defun +org-exclude-agenda-buffers-from-workspace-h ()
"Prevent temporarily-opened agenda buffers from being associated with the
current workspace (and clean them up)."
(when (and org-agenda-new-buffers (bound-and-true-p persp-mode))
(unless org-agenda-sticky
(let (persp-autokill-buffer-on-remove)
(persp-remove-buffer org-agenda-new-buffers
(get-current-persp)
nil)))
(dolist (buffer org-agenda-new-buffers)
(with-current-buffer buffer
;; HACK Org agenda opens temporary agenda incomplete org-mode
;; buffers. These are great for extracting agenda information
;; from, but what if the user tries to visit one of these
;; buffers? Then we remove it from the to-be-cleaned queue and
;; restart `org-mode' so they can grow up to be full-fledged
;; org-mode buffers.
(add-hook 'doom-switch-buffer-hook #'+org--restart-mode-h
nil 'local))))))
"Prevent temporary agenda buffers being associated with current
workspace."
(when (and org-agenda-new-buffers
(bound-and-true-p persp-mode)
(not org-agenda-sticky))
(let (persp-autokill-buffer-on-remove)
(persp-remove-buffer org-agenda-new-buffers
(get-current-persp)
nil))))
(defun +org-defer-mode-in-agenda-buffers-h ()
"Org agenda opens temporary agenda incomplete org-mode buffers.
These are great for extracting agenda information from, but what if the user
tries to visit one of these buffers? Then we remove it from the to-be-cleaned
queue and restart `org-mode' so they can grow up to be full-fledged org-mode
buffers."
(dolist (buffer org-agenda-new-buffers)
(with-current-buffer buffer
(add-hook 'doom-switch-buffer-hook #'+org--restart-mode-h
nil 'local)))))
(defadvice! +org--exclude-agenda-buffers-from-recentf-a (orig-fn file)
"Prevent temporarily opened agenda buffers from polluting recentf."
@@ -606,6 +640,7 @@ between the two."
"C-c C-S-l" #'+org/remove-link
"C-c C-i" #'org-toggle-inline-images
;; textmate-esque newline insertion
"S-RET" #'+org/shift-return
"C-RET" #'+org/insert-item-below
"C-S-RET" #'+org/insert-item-above
"C-M-RET" #'org-insert-subheading
@@ -692,7 +727,8 @@ between the two."
"e" #'org-clock-modify-effort-estimate
"E" #'org-set-effort
"g" #'org-clock-goto
"G" (λ! (org-clock-goto 'select))
"G" (cmd! (org-clock-goto 'select))
"l" #'+org/toggle-last-clock
"i" #'org-clock-in
"I" #'org-clock-in-last
"o" #'org-clock-out
@@ -715,7 +751,7 @@ between the two."
"g" #'helm-org-in-buffer-headings
"G" #'helm-org-agenda-files-headings)
"c" #'org-clock-goto
"C" (λ! (org-clock-goto 'select))
"C" (cmd! (org-clock-goto 'select))
"i" #'org-id-goto
"r" #'org-refile-goto-last-stored
"v" #'+org/goto-visible
@@ -729,6 +765,12 @@ between the two."
"s" #'org-store-link
"S" #'org-insert-last-stored-link
"t" #'org-toggle-link-display)
(:prefix ("P" . "publish")
"a" #'org-publish-all
"f" #'org-publish-current-file
"p" #'org-publish
"P" #'org-publish-current-project
"s" #'org-publish-sitemap)
(:prefix ("r" . "refile")
"." #'+org/refile-to-current-file
"c" #'+org/refile-to-running-clock
@@ -757,7 +799,6 @@ between the two."
"p" #'org-priority
"u" #'org-priority-up)))
(map! :after org-agenda
:map org-agenda-mode-map
:m "C-SPC" #'org-agenda-show-and-scroll-up
@@ -852,25 +893,6 @@ compelling reason, so..."
(set-marker p nil)))))
(use-package! org-superstar ; "prettier" bullets
:hook (org-mode . org-superstar-mode)
:config
;; Make leading stars truly invisible, by rendering them as spaces!
(setq org-superstar-leading-bullet ?\s
org-superstar-leading-fallback ?\s
org-hide-leading-stars nil)
;; Don't do anything special for item bullets or TODOs by default; these slow
;; down larger org buffers.
(setq org-superstar-prettify-item-bullets nil
org-superstar-special-todo-items nil
;; ...but configure it in case the user wants it later
org-superstar-todo-bullet-alist
'(("TODO" . 9744)
("[ ]" . 9744)
("DONE" . 9745)
("[X]" . 9745))))
(use-package! org-crypt ; built-in
:commands org-encrypt-entries org-encrypt-entry org-decrypt-entries org-decrypt-entry
:hook (org-reveal-start . org-decrypt-entry)
@@ -925,6 +947,7 @@ compelling reason, so..."
(use-package! evil-org
:when (featurep! :editor evil +everywhere)
:hook (org-mode . evil-org-mode)
:hook (org-capture-mode . evil-insert-state)
:init
(defvar evil-org-retain-visual-state-on-shift t)
(defvar evil-org-special-o/O '(table-row))
@@ -940,24 +963,25 @@ compelling reason, so..."
:ni [C-return] #'+org/insert-item-below
:ni [C-S-return] #'+org/insert-item-above
;; navigate table cells (from insert-mode)
:i "C-l" (general-predicate-dispatch 'org-end-of-line
(org-at-table-p) 'org-table-next-field)
:i "C-h" (general-predicate-dispatch 'org-beginning-of-line
(org-at-table-p) 'org-table-previous-field)
:i "C-k" (general-predicate-dispatch 'org-up-element
(org-at-table-p) '+org/table-previous-row)
:i "C-j" (general-predicate-dispatch 'org-down-element
(org-at-table-p) 'org-table-next-row)
;; moving/(de|pro)moting subtress & expanding tables (prepend/append columns/rows)
:ni "C-S-l" #'org-shiftright
:ni "C-S-h" #'org-shiftleft
:ni "C-S-k" #'org-shiftup
:ni "C-S-j" #'org-shiftdown
:i "C-l" (cmds! (org-at-table-p) #'org-table-next-field
#'org-end-of-line)
:i "C-h" (cmds! (org-at-table-p) #'org-table-previous-field
#'org-beginning-of-line)
:i "C-k" (cmds! (org-at-table-p) #'+org/table-previous-row
#'org-up-element)
:i "C-j" (cmds! (org-at-table-p) #'org-table-next-row
#'org-down-element)
:ni "C-S-l" #'org-shiftright
:ni "C-S-h" #'org-shiftleft
:ni "C-S-k" #'org-shiftup
:ni "C-S-j" #'org-shiftdown
;; more intuitive RET keybinds
:i [return] (λ! (org-return t))
:i "RET" (λ! (org-return t))
:n [return] #'+org/dwim-at-point
:n "RET" #'+org/dwim-at-point
:n [return] #'+org/dwim-at-point
:n "RET" #'+org/dwim-at-point
:i [return] (cmd! (org-return electric-indent-mode))
:i "RET" (cmd! (org-return electric-indent-mode))
:i [S-return] #'+org/shift-return
:i "S-RET" #'+org/shift-return
;; more vim-esque org motion keys (not covered by evil-org-mode)
:m "]h" #'org-forward-heading-same-level
:m "[h" #'org-backward-heading-same-level
@@ -966,8 +990,6 @@ compelling reason, so..."
:m "]c" #'org-babel-next-src-block
:m "[c" #'org-babel-previous-src-block
:n "gQ" #'org-fill-paragraph
:n "gr" #'org-ctrl-c-ctrl-c
:n "gR" #'org-babel-execute-buffer
;; sensible vim-esque folding keybinds
:n "za" #'+org/toggle-fold
:n "zA" #'org-shifttab
@@ -1011,16 +1033,18 @@ compelling reason, so..."
org-list org-pcomplete org-src org-footnote org-macro ob org org-agenda
org-capture
:preface
;; Set these to nil now so we can detect user changes to them later (and fall
;; back on defaults otherwise)
;; Set to nil so we can detect user changes to them later (and fall back on
;; defaults otherwise).
(defvar org-directory nil)
(defvar org-attach-id-dir nil)
(setq org-publish-timestamp-directory (concat doom-cache-dir "org-timestamps/")
org-preview-latex-image-directory (concat doom-cache-dir "org-latex/"))
org-preview-latex-image-directory (concat doom-cache-dir "org-latex/")
;; Recognize a), A), a., A., etc -- must be set before org is loaded.
org-list-allow-alphabetical t)
;; Make most of the default modules opt-in, because I sincerely doubt most
;; users use all of them.
;; Make most of the default modules opt-in to lighten its first-time load
;; delay. I sincerely doubt most users use them all.
(defvar org-modules
'(;; ol-w3m
;; ol-bbdb
@@ -1081,7 +1105,19 @@ compelling reason, so..."
(run-hooks 'org-load-hook))
:config
(setq org-archive-subtree-save-file-p t) ; save target buffer after archiving
(set-company-backend! 'org-mode 'company-capf 'company-dabbrev)
(set-eval-handler! 'org-mode #'+org-eval-handler)
(set-lookup-handlers! 'org-mode
:definition #'+org-lookup-definition-handler
:references #'+org-lookup-references-handler
:documentation #'+org-lookup-documentation-handler)
;; Save target buffer after archiving a node.
(setq org-archive-subtree-save-file-p t)
;; Prevent modifications made in invisible sections of an org document, as
;; unintended changes can easily go unseen otherwise.
(setq org-catch-invisible-edits 'smart)
;; Global ID state means we can have ID links anywhere. This is required for
;; `org-brain', however.

View File

@@ -9,16 +9,16 @@
;; delay on the first file the user opens, because calling the autoloaded
;; `org-journal-is-journal' pulls all of `org' with it. So, we replace it
;; with our own, extra layer of heuristics.
(setq magic-mode-alist (assq-delete-all 'org-journal-is-journal magic-mode-alist))
(add-to-list 'magic-mode-alist '(+org-journal-p . org-journal-mode))
(defun +org-journal-p ()
(when-let (buffer-file-name (buffer-file-name (buffer-base-buffer)))
(and (file-in-directory-p
buffer-file-name (expand-file-name org-journal-dir org-directory))
(delq! '+org-journal-p magic-mode-alist 'assq)
(require 'org-journal nil t)
(org-journal-is-journal))))
(if (or (featurep 'org-journal)
(and (file-in-directory-p
buffer-file-name (expand-file-name org-journal-dir org-directory))
(delq! '+org-journal-p magic-mode-alist 'assq)
(require 'org-journal nil t)))
(org-journal-is-journal))))
;; `org-journal-dir' defaults to "~/Documents/journal/", which is an odd
;; default, so we change it to {org-directory}/journal (we expand it after
@@ -27,12 +27,20 @@
org-journal-cache-file (concat doom-cache-dir "org-journal"))
:config
;; Remove the orginal journal file detector and rely on `+org-journal-p'
;; instead, to avoid loading org-journal until the last possible moment.
(setq magic-mode-alist (assq-delete-all 'org-journal-is-journal magic-mode-alist))
;; `org-journal' can't deal with symlinks, so resolve them here.
(setq org-journal-dir (expand-file-name org-journal-dir org-directory)
;; Doom opts for an "open in a popup or here" strategy as a default.
;; Open in "other window" is less predictable, and can replace a window
;; we wanted to keep visible.
org-journal-find-file #'find-file)
;; Setup carryover to include all configured TODO states.
(setq org-journal-carryover-items "TODO=\"TODO\"|TODO=\"PROJ\"|TODO=\"STRT\"|TODO=\"WAIT\"|TODO=\"HOLD\"")
(set-popup-rule! "^\\*Org-journal search" :select t :quit t)

View File

@@ -10,6 +10,8 @@
(alert-add-rule :category "org-pomodoro"
:style (cond (alert-growl-command
'growl)
(alert-notifier-command
'notifier)
(alert-libnotify-command
'libnotify)
(alert-default-style))))

View File

@@ -14,7 +14,8 @@
(use-package! org-re-reveal
:after ox
:init
(setq org-re-reveal-root "https://revealjs.com"))
(setq org-re-reveal-root "https://cdnjs.cloudflare.com/ajax/libs/reveal.js/3.9.2"
org-re-reveal-revealjs-version "3.8"))
(use-package! org-tree-slide

View File

@@ -6,5 +6,7 @@
(warn! "Couldn't find gnuplot. org-plot/gnuplot will not work")))
(when (featurep! +roam)
(unless (executable-find "sqlite3")
(warn! "Couldn't find the sqlite3 executable. org-roam will not work."))
(unless (executable-find "dot")
(warn! "Couldn't find the dot executable (from graphviz). org-roam will not be able to generate graph visuallizations.")))

View File

@@ -27,18 +27,17 @@
:recipe (:host github
:repo "emacs-straight/org-mode"
:files ("*.el" "lisp/*.el" "contrib/lisp/*.el"))
:pin "c709187173ff2bb72c0f902c0299998c8c5a4260")
:pin "a1e5bee5cb9c34ceb8226597605a49638bee7cec")
;; ...And prevent other packages from pulling org; org-plus-contrib satisfies
;; the dependency already: https://github.com/raxod502/straight.el/issues/352
(package! org :recipe (:local-repo nil))
(package! avy)
(package! htmlize :pin "86f22f211e9230857197c42a9823d3f05381deed")
(package! org-superstar :pin "09ddc28383d363a4b353348a433e24535b4af0e3")
(package! org-yt
:recipe (:host github :repo "TobiasZawada/org-yt")
:pin "40cc1ac76d741055cbefa13860d9f070a7ade001")
(package! ox-clip :pin "bd36f9fb4e3b1b9e8686b993b02ccd780ff75a96")
(package! ox-clip :pin "f5eac28734ea33d0b7a3dbe10b777907a91cf9f9")
(package! toc-org :pin "5deaec41ed0e5c51715737d7f74c5ae1b3c00387")
(package! org-cliplink :pin "82402cae7e118d67de7328417fd018a18f95fac2")
@@ -49,11 +48,11 @@
(when (featurep! :tools pdf)
(package! org-pdftools :pin "8cc15bb8014ed1f047eecc0abd8bf447f86c0505"))
(when (featurep! :tools magit)
(package! orgit :pin "e147f055772cc934fe1f1d8619059badeb647c93"))
(package! orgit :pin "ac9b1a42863a864fde9d225890ef5464bffdc646"))
(when (featurep! +brain)
(package! org-brain :pin "6b2ec93ec92b4a244af9d600433e0d0a02eb5f1e"))
(package! org-brain :pin "671db0e08b91c7d2637d765a7afca8b2561275c8"))
(when (featurep! +dragndrop)
(package! org-download :pin "40c8a1db186a4ec79d87805018237234c0aad878"))
(package! org-download :pin "768716b6fcc814b06360b99ad70bce44c0eb4a32"))
(when (featurep! +gnuplot)
(package! gnuplot :pin "f0001c30010b2899e36d7d89046322467e923088")
(package! gnuplot-mode :pin "601f6392986f0cba332c87678d31ae0d0a496ce7"))
@@ -62,21 +61,24 @@
(when (featurep! +jupyter)
(package! jupyter :pin "785edbbff65abb0c929dc2fbd8b8305c77fd529e"))
(when (featurep! +journal)
(package! org-journal :pin "0d6d81234a20ac800d24373b89159ee33a69f6c3"))
(package! org-journal :pin "a6378dc484ed8df7d2d2f05ac70bd9196aa6f4c0"))
(when (featurep! +noter)
(package! org-noter :pin "9ead81d42dd4dd5074782d239b2efddf9b8b7b3d"))
(when (featurep! +pomodoro)
(package! org-pomodoro :pin "aa07c11318f91219336197e62c47bc7a3d090479"))
(when (featurep! +pretty)
(package! org-superstar :pin "17481852c1bd09afea877635a3185261fc19fd64")
(package! org-fancy-priorities :pin "819bb993b71e7253cefef7047306ab4e0f9d0a86"))
(when (featurep! +present)
(package! centered-window
:recipe (:host github :repo "anler/centered-window-mode")
:pin "f50859941ab5c7cbeaee410f2d38716252b552ac")
(package! org-tree-slide :pin "7126a4365072a32898f169ead8fb59265dabc605")
(package! org-re-reveal :pin "a9e9d4ef88417b3af7741a8d8f444ece820e7a3b"))
(package! org-re-reveal :pin "c548e239898e97e700f7c1d3f34a148ccbedb820"))
(when (featurep! +roam)
(package! org-roam :pin "9cf26494e86b1cc18267fd70abf942d2fb75c774")
(package! org-roam :pin "0aa0a7c05a78e9b29881570604c24381b658fe2a")
(when (featurep! :completion company)
(package! company-org-roam :pin "674c2bd493f571c5323d69279557a6c18ccbd14e")))
(package! company-org-roam :pin "5d7ccd944519ae1d03f5e17ddfe33dcd8a0cc71e")))
;;; Babel
(package! ob-async :pin "80a30b96a007d419ece12c976a81804ede340311")
@@ -103,6 +105,6 @@
(when (featurep! +hugo)
(package! ox-hugo
:recipe (:host github :repo "kaushalmodi/ox-hugo" :nonrecursive t)
:pin "5de3da970f9ead05930781dd0b73b5011310b2ba"))
:pin "75b849e9561c4a6022babf6eaf0e037310ded7c1"))
(when (featurep! :lang rst)
(package! ox-rst :pin "9158bfd18096c559e0a225ae62ab683f1c98a547"))

View File

@@ -92,6 +92,7 @@ The features in this module optionally depend on the following php packages:
+ ~boris~ (REPL)
+ ~phpctags~ (better code completion)
+ ~phpunit~ (unit test commands)
+ ~php-cs-fixer~ (for code formatting)
#+BEGIN_SRC sh
composer global require \

View File

@@ -21,6 +21,23 @@
(set-repl-handler! 'php-mode #'php-boris)
(set-lookup-handlers! 'php-mode :documentation #'php-search-documentation)
(set-formatter! 'php-mode #'php-cs-fixer-fix)
(set-pretty-symbols! 'php-mode
;; Functional
:lambda "function()"
:def "function"
;; Types
:null "null"
:true "true" :false "false"
:int "int" :float "float"
:str "string"
:bool "list"
;; Flow
:not "!"
:and "&&" :and "and"
:or "||" :or "or"
:for "for"
:return "return"
:yield "use")
(if (featurep! +lsp)
(add-hook 'php-mode-local-vars-hook #'lsp!)

View File

@@ -1,22 +1,26 @@
;; -*- no-byte-compile: t; -*-
;;; lang/php/packages.el
(package! php-boris :pin "f2faebf610")
(package! php-extras :recipe (:host github :repo "arnested/php-extras") :pin "d410c5af66")
(package! php-mode :pin "b5d9988100")
(package! php-refactor-mode :pin "7a794b0618")
(package! phpunit :pin "fe6bc91c3b")
(package! php-boris :pin "f2faebf610c917f7091f7ec0cd97645629c4f819")
(package! php-extras
:recipe (:host github :repo "arnested/php-extras")
:pin "81ebd7c1a8c8d02b2775d4cdbf73653feb608a7c")
(package! php-mode :pin "4345dfd81fc6da9b7ac123377902b42f5b7b3e0d")
(package! php-refactor-mode :pin "7a794b0618df2882b1bd586fdd698dba0bc5130d")
(package! phpunit :pin "fe6bc91c3bd8b329c6d26ad883a025f06b5121ee")
(when (featurep! +hack)
(package! hack-mode :recipe (:host github :repo "hhvm/hack-mode") :pin "fd6a661b09"))
(package! hack-mode
:recipe (:host github :repo "hhvm/hack-mode")
:pin "572c3b41bed91ea543434c04914a7a0c45fec7c7"))
(unless (featurep! +lsp)
(package! phpactor :pin "31fe2ea4db")
(package! phpactor :pin "62d2372ea55c0c5fb4e77076988472ebb5d85f24")
(when (featurep! :completion company)
(package! company-phpactor :pin "31fe2ea4db")))
(package! company-phpactor :pin "62d2372ea55c0c5fb4e77076988472ebb5d85f24")))
(when (featurep! :editor format)
(package! php-cs-fixer :pin "95eace9bc0"))
(package! php-cs-fixer :pin "95eace9bc0ace128d5166e303c76df2b778c4ddb"))
;; For building php-extras
(package! async :pin "86aef2c38e")
(package! async :pin "86aef2c38e7d35e8509b7feeee3e989d825eba91")

View File

@@ -7,5 +7,5 @@
;; unnecessary altogether.
;;(package! flycheck-purescript :pin "30f0435d5e")
(package! psc-ide :pin "7fc2b841be")
(package! purescript-mode :pin "8db1d0243c")
(package! psc-ide :pin "663f4e2cf9cbafdd4b9a60c34346596e2a40c87c")
(package! purescript-mode :pin "154ad16b61fb9dec83a6c863ffaf92638278f00f")

View File

@@ -20,14 +20,17 @@ Adds Python support to Doom Emacs.
+ Snippets
+ Run tests (~nose~, ~pytest~)
+ Auto-format (~black~), requires ~:editor format~
+ LSP integration (mspyls, pyls, or pyright)
** Module Flags
+ ~+lsp~ Language Server Protocol support
+ ~+pyright~ Use the pyright LSP server instead of mspyls or pyls (requires
~+lsp~).
+ ~+pyenv~ Python virtual environment support via [[https://github.com/pyenv/pyenv][pyenv]]
+ ~+conda~ Python virtual environment support via [[https://conda.io/en/latest/][Conda]]
+ ~+poetry~ Python packaging, dependency management, and virtual environment
support via [[https://python-poetry.org/][Poetry]]
+ ~+cython~ Cython files support via [[https://github.com/cython/cython/blob/master/Tools/cython-mode.el][Cython-mode]]
+ ~+cython~ Cython files support via [[https://github.com/cython/cython/blob/master/Tools/cython-mode.el][cython-mode]]
** Plugins
+ [[https://github.com/pythonic-emacs/anaconda-mode][anaconda-mode]]*
@@ -37,66 +40,55 @@ Adds Python support to Doom Emacs.
+ [[https://github.com/wbolster/emacs-python-pytest][python-pytest]]*
+ [[https://github.com/Wilfred/pip-requirements.el][pip-requirements]]*
+ [[https://github.com/pwalsh/pipenv.el][pipenv]]*
+ ~:editor format~
+ [[https://github.com/lassik/emacs-format-all-the-code][format-all]]*
+ ~+conda~
+ if ~+conda~
+ [[https://github.com/necaris/conda.el][conda]]*
+ ~+pyenv~
+ if ~+pyenv~
+ [[https://github.com/pythonic-emacs/pyenv-mode][pyenv]]*
+ ~+poetry~
+ if ~+poetry~
+ [[https://github.com/galaunay/poetry.el][poetry]]*
+ ~+lsp~ and ~:tools lsp~
+ if ~+lsp~ and ~:tools lsp~
+ [[https://github.com/emacs-lsp/lsp-mode][lsp]]
+ [[https://github.com/emacs-lsp/lsp-python-ms][lsp-python-ms]]*
+ ~+cython~
+ [[https://github.com/cython/cython/blob/master/Tools/cython-mode.el][Cython-mode]]
+ ~:checkers syntax~ [[https://github.com/lbolla/emacs-flycheck-cython/tree/master][Flycheck-cython]]
+ if ~+pyright~
+ [[https://github.com/emacs-lsp/lsp-pyright][lsp-pyright]]
+ else
+ [[https://github.com/emacs-lsp/lsp-python-ms][lsp-python-ms]]
+ if ~+cython~
+ [[https://github.com/cython/cython/blob/master/Tools/cython-mode.el][cython-mode]]
+ if ~:checkers syntax~: [[https://github.com/lbolla/emacs-flycheck-cython/tree/master][flycheck-cython]]
* Prerequisites
This module has no direct prerequisites. Here are some of its soft dependencies.
This module has no hard prerequisites, but a few soft ones:
+ To run tests inside of Emacs:
+ For this module's supported test runners:
+ ~pip install pytest~
+ ~pip install nose~
+ The ~:editor format~ module uses [[https://github.com/psf/black][Black]] for python files
+ ~pip install black~
+ ~pyimport~ requires Python's module ~pyflakes~:
+ ~pip install pyflakes~
+ ~py-isort~ requires [[https://github.com/timothycrosley/isort][isort]] to be installed:
+ ~pip install isort~
+ The ~:editor format~ module uses [[https://github.com/psf/black][Black]] for python files :: ~pip install black~
+ ~pyimport~ requires Python's module ~pyflakes~ :: ~pip install pyflakes~
+ ~py-isort~ requires [[https://github.com/timothycrosley/isort][isort]] to be installed :: ~pip install isort~
+ Python virtual environments install instructions at:
+ [[https://github.com/pyenv/pyenv][pyenv]]
+ [[https://conda.io/en/latest/][Conda]]
+ [[https://python-poetry.org/][Poetry]]
+ ~pipenv~ requires [[https://pipenv.readthedocs.io/en/latest/][pipenv]]
+ [[https://pipenv.readthedocs.io/en/latest/][pipenv]]
+ ~cython~ requires [[https://cython.org/][Cython]]
** Language Server Protocol Support
This module must be enabled with the =+lsp= flag, and the =:tools lsp= module
must be enabled. LSP will try pyls then mspyls; the first that is available.
For LSP support the =:tools lsp= module must be enabled, along with this
module's =+lsp= flag. By default, it supports =mspyls= and =pyls=, in that
order. With the =+pyright= flag, it will try Pyright first.
*To use [[https://pypi.org/project/python-language-server/][Python Language Server]] (pyls)* install it with ~pip install
'python-language-server[all]'~
Each of these servers must be installed on your system via your OS package
manager or manually:
*To use mspyls*, install it with ~M-x lsp-install-server~ and add this to your
private config.el:
#+BEGIN_SRC elisp
(after! lsp-python-ms
(set-lsp-priority! 'mspyls 1))
#+END_SRC
+ [[https://pypi.org/project/python-language-server/][*pyls*]] can be installed with ~pip install python-language-server[all]~.
+ *mspyls* can be installed by typing =M-x lsp-install-server RET mspyls=.
+ *pyright* can be installed with ~pip install pyright~ or ~npm i -g pyright~.
* Features
This module supports LSP. It requires installation of [[https://pypi.org/project/python-language-server/][Python Language
Server]] or [[https://github.com/Microsoft/python-language-server][Microsoft Language Server]], see [[Language Server Protocol Support][LSP Support]].
Server]], [[https://github.com/Microsoft/python-language-server][Microsoft Language Server]], or [[https://github.com/microsoft/pyright][pyright]], see [[Language Server Protocol Support][LSP Support]].
To enable support for auto-formatting with black enable ~:editor format-all~ in
To enable support for auto-formatting with black enable ~:editor format~ in
~init.el~ file.
** Keybindings

View File

@@ -13,7 +13,7 @@ called.")
;;
;; Packages
;;; Packages
(use-package! python
:mode ("[./]flake8\\'" . conf-mode)
@@ -198,7 +198,7 @@ called.")
;;
;; Environment management
;;; Environment management
(use-package! pipenv
:commands pipenv-project-p
@@ -266,14 +266,15 @@ called.")
"~/.anaconda"
"~/.miniconda"
"~/.miniconda3"
"~/anaconda3"
"~/miniconda3"
"/usr/bin/anaconda3"
"/usr/local/anaconda3"
"/usr/local/miniconda3"
"/usr/local/Caskroom/miniconda/base")
if (file-directory-p dir)
return (setq conda-anaconda-home dir
conda-env-home-directory dir))
return (setq conda-anaconda-home (expand-file-name dir)
conda-env-home-directory (expand-file-name dir)))
(message "Cannot find Anaconda installation"))
;; integration with term/eshell
@@ -290,23 +291,6 @@ called.")
:after python)
(use-package! lsp-python-ms
:when (and (featurep! +lsp) (not (featurep! :tools lsp +eglot)))
:after lsp-clients
:preface
(after! python
(setq lsp-python-ms-python-executable-cmd python-shell-interpreter))
:init
;; HACK If you don't have python installed, then opening python buffers with
;; this on causes a "wrong number of arguments: nil 0" error, because of
;; careless usage of `cl-destructuring-bind'. This silences that error,
;; since we may still want to write some python on a system without
;; python installed!
(defadvice! +python--silence-errors-a (orig-fn &rest args)
:around #'lsp-python-ms--extra-init-params
(ignore-errors (apply orig-fn args))))
(use-package! cython-mode
:when (featurep! +cython)
:mode "\\.p\\(yx\\|x[di]\\)\\'"
@@ -322,3 +306,21 @@ called.")
:when (featurep! +cython)
:when (featurep! :checkers syntax)
:after cython-mode)
;;
;;; LSP
(when! (and (featurep! +lsp)
(not (featurep! :tools lsp +eglot)))
(use-package! lsp-python-ms
:unless (featurep! +pyright)
:after lsp-clients
:preface
(after! python
(setq lsp-python-ms-python-executable-cmd python-shell-interpreter)))
(use-package! lsp-pyright
:when (featurep! +pyright)
:after lsp-clients))

View File

@@ -4,17 +4,22 @@
;; Major modes
(package! pip-requirements :pin "216cd1690f80cc965d4ae47b8753fc185f778ff6")
(when (featurep! +cython)
(package! cython-mode :pin "12ab8bc0056a0e77ccc0756955eb1621fd3b35db")
(package! cython-mode :pin "0208bf2b71f478779491bf4a63a6b61de3d7269e")
(when (featurep! :checkers syntax)
(package! flycheck-cython :pin "ecc4454d35ab5317ab66a04406f36f0c1dbc0b76")))
;; LSP
(when (and (featurep! +lsp)
(not (featurep! :tools lsp +eglot)))
(package! lsp-python-ms :pin "db6f2636da1037bda06d5a2d992c4857ce3ad9b0"))
(when (featurep! +lsp)
(unless (featurep! :tools lsp +eglot)
(if (featurep! +pyright)
(package! lsp-pyright
;; REVIEW Remove this when added to melpa
:recipe (:host github :repo "emacs-lsp/lsp-pyright")
:pin "3cf2e8fc652e35270b1b39aeecc990d4a97de91f")
(package! lsp-python-ms :pin "7a502e6c09456cbe8b5f6c64883c79f5ce08e5a9"))))
;; Programming environment
(package! anaconda-mode :pin "10299bd9ff38c4f0da1d892905d02ef828e7fdce")
(package! anaconda-mode :pin "73266a48fa964d44268c3f3478597e553b9843f1")
(when (featurep! :completion company)
(package! company-anaconda :pin "da1566db41a68809ef7f91ebf2de28118067c89b"))
@@ -26,14 +31,14 @@
(when (featurep! +conda)
(package! conda :pin "9d0213020ff170b17e11b35cad40ac9a8bf30f4c"))
(when (featurep! +poetry)
(package! poetry :pin "d876522e5af576d53c62b2838f85c9441fe62258"))
(package! poetry :pin "22a76cdcba180b4689a6b45c97669e3c76cd36ed"))
;; Testing frameworks
(package! nose
;; REVIEW Remove this when emacsmirror/epkgs updates its emacsattic index
:recipe (:host github :repo "emacsattic/nose")
:pin "f8528297519eba911696c4e68fa88892de9a7b72")
(package! python-pytest :pin "09ad688df207ee9b02c990d3897a9e2841931d97")
(package! python-pytest :pin "6a3b4e560f26b5b8c9dca5699a3573f554592ac9")
;; Import managements
(package! pyimport :pin "a6f63cf7ed93f0c0f7c207e6595813966f8852b9")

View File

@@ -13,7 +13,7 @@
;;;###autoload
(defun +racket-lookup-documentation (thing)
"A `+lookup/documentation' handler for Racket."
"A `+lookup/documentation' handler for `racket-mode' and `racket-xp-mode'."
(let ((buf (if racket-xp-mode
(racket-xp-describe thing)
(racket-repl-describe thing))))
@@ -23,7 +23,8 @@
;;;###autoload
(defun +racket-lookup-definition (_thing)
"A `+lookup/definition' handler for Racket."
(if racket-xp-mode
(call-interactively #'racket-xp-visit-definition)
(call-interactively #'racket-repl-visit-definition)))
"A `+lookup/definition' handler for `racket-mode' and `racket-xp-mode'."
(call-interactively
(if racket-xp-mode
#'racket-xp-visit-definition
#'racket-repl-visit-definition)))

View File

@@ -28,39 +28,48 @@
#'highlight-quoted-mode)
(when (featurep! +xp)
(add-hook 'racket-mode-hook #'racket-xp-mode))
(add-hook 'racket-mode-local-vars-hook #'racket-xp-mode)
;; Both flycheck and racket-xp produce error popups, but racket-xp's are
;; higher quality so disable flycheck's:
(when (featurep! :checkers syntax)
(add-hook! 'racket-xp-mode-hook
(defun +racket-disable-flycheck-h ()
(cl-pushnew 'racket flycheck-disabled-checkers)))))
(unless (or (featurep! :editor parinfer)
(featurep! :editor lispy))
(add-hook 'racket-mode-hook #'racket-smart-open-bracket-mode))
(map! :localleader
:map racket-mode-map
"a" #'racket-align
"A" #'racket-unalign
"f" #'racket-fold-all-tests
"F" #'racket-unfold-all-tests
"h" #'racket-doc
"i" #'racket-unicode-input-method-enable
"l" #'racket-logger
"o" #'racket-profile
"p" #'racket-cycle-paren-shapes
"r" #'racket-run
"R" #'racket-run-and-switch-to-repl
"t" #'racket-test
"u" #'racket-backward-up-list
"y" #'racket-insert-lambda
(:prefix ("m" . "macros")
(map! (:map racket-xp-mode-map
[remap next-error] #'racket-xp-next-error
[remap previous-error] #'racket-xp-previous-error)
(:localleader
:map racket-mode-map
"a" #'racket-align
"A" #'racket-unalign
"f" #'racket-fold-all-tests
"F" #'racket-unfold-all-tests
"h" #'racket-doc
"i" #'racket-unicode-input-method-enable
"l" #'racket-logger
"o" #'racket-profile
"p" #'racket-cycle-paren-shapes
"r" #'racket-run
"R" #'racket-run-and-switch-to-repl
"t" #'racket-test
"u" #'racket-backward-up-list
"y" #'racket-insert-lambda
(:prefix ("m" . "macros")
"d" #'racket-expand-definition
"e" #'racket-expand-last-sexp
"r" #'racket-expand-region
"a" #'racket-expand-again)
(:prefix ("g" . "goto")
(:prefix ("g" . "goto")
"b" #'racket-unvisit
"d" #'racket-visit-definition
"m" #'racket-visit-module
"r" #'racket-open-require-path)
(:prefix ("s" . "send")
(:prefix ("s" . "send")
"d" #'racket-send-definition
"e" #'racket-send-last-sexp
"r" #'racket-send-region)))
"r" #'racket-send-region))))

View File

@@ -1,4 +1,4 @@
;; -*- no-byte-compile: t; -*-
;;; lang/racket/packages.el
(package! racket-mode :pin "8f3b214a5ea06e6a2a9492e7d20b19badd0c3bdf")
(package! racket-mode :pin "29afd2544a2f14bf29f3e542f6177579d0ae581f")

View File

@@ -6,13 +6,13 @@
(package! yard-mode :pin "ba74a47463b0320ae152bd42a7dd7aeecd7b5748")
;; REPL
(package! inf-ruby :pin "41e5ed3a886fca56990486f1987bb3bae0dbd54b")
(package! inf-ruby :pin "f3c927c1b917a20ce6b2228d480db43171aadd9b")
(when (featurep! :completion company)
(package! company-inf-ruby :pin "fe3e4863bc971fbb81edad447efad5795ead1b17"))
;; Programming environment
(package! rubocop :pin "03bf15558a6eb65e4f74000cab29412efd46660e")
(package! robe :pin "68503b32bb3a005787ecb7a7fdeb3bb4a2317e2b")
(package! robe :pin "082da38797d247f9c64568ad712a345e041d5c84")
;; Project tools
(package! bundler :pin "43efb6be4ed118b06d787ce7fbcffd68a31732a7")
@@ -22,12 +22,12 @@
(when (featurep! +rbenv)
(package! rbenv :pin "2ea1a5bdc1266caef1dd77700f2c8f42429b03f1"))
(when (featurep! +rvm)
(package! rvm :pin "134497bc460990c71ab8fa75431156e62c17da2d"))
(package! rvm :pin "081d5173158054c6d0780b9462c74c5697eac1fc"))
(when (featurep! +chruby)
(package! chruby :pin "42bc6d521f832eca8e2ba210f30d03ad5529788f"))
;; Testing frameworks
(package! rspec-mode :pin "9a2a9d2935ae17b8570485bdea7c347533b464f6")
(package! rspec-mode :pin "f1029cad2a8d9fd096e9a0f1ae9e7d7e2c8bd1ec")
(package! minitest :pin "ddd152c990a528ad09a696bfad23afa4330ea4d7")
;; Rails

View File

@@ -12,6 +12,7 @@
:commands rustic-run-cargo-command rustic-cargo-outdated
:init
(after! org-src
(defalias 'org-babel-execute:rust #'org-babel-execute:rustic)
(add-to-list 'org-src-lang-modes '("rust" . rustic)))
:config
(set-docsets! 'rustic-mode "Rust")

View File

@@ -1,6 +1,6 @@
;; -*- no-byte-compile: t; -*-
;;; lang/rust/packages.el
(package! rustic :pin "f7a94c4f914f4037fb84d50e91b3de90f606efda")
(package! rustic :pin "0ec0688c83cdf70be5eaaeacd96b067125fe968e")
(unless (featurep! +lsp)
(package! racer :pin "a0bdf778f01e8c4b8a92591447257422ac0b455b"))

View File

@@ -3,3 +3,6 @@
(package! sbt-mode :pin "633a315ad4")
(package! scala-mode :pin "46bb948345")
(when (featurep! +lsp)
(package! lsp-metals :pin "3d4d4b7b14d6f1041f75ddb45f36ca4cf9a6d854"))

View File

@@ -6,7 +6,7 @@
(use-package! geiser
:hook (scheme-mode . geiser-mode)
:defer t
:init
(setq geiser-active-implementations '(guile chicken mit chibi chez)
geiser-autodoc-identifier-format "%s → %s"
@@ -25,7 +25,7 @@
("^\\*Geiser dbg\\*$" :slot 1 :vslot -1)
("^\\*Geiser xref\\*$" :slot 1 :vslot -1)
("^\\*Geiser documentation\\*$" :slot 2 :vslot 2 :select t :size 0.35)
("^\\* [A-Za-z0-9_-]+ REPL \\*$" :quit nil :ttl nil)))
("^\\* [A-Za-z0-9_-]+ REPL \\*" :size 0.3 :quit nil :ttl nil)))
(map! :localleader
:map scheme-mode-map
"'" #'geiser-mode-switch-to-repl

View File

@@ -16,6 +16,19 @@
:config
(set-electric! 'sh-mode :words '("else" "elif" "fi" "done" "then" "do" "esac" ";;"))
(set-repl-handler! 'sh-mode #'+sh/open-repl)
(set-pretty-symbols! 'sh-mode
;; Functional
:def "function"
;; Types
:true "true" :false "false"
;; Flow
:not "!"
:and "&&" :or "||"
:in "in"
:for "for"
:return "return"
;; Other
:dot "." :dot "source")
(when (featurep! +lsp)
(add-hook 'sh-mode-local-vars-hook #'lsp!))

View File

@@ -32,38 +32,3 @@ already there)."
(interactive)
(goto-char (point-max))
(evil-append 1))
;;;###autoload (autoload '+eshell/evil-change "term/eshell/autoload/evil" nil t)
(evil-define-operator +eshell/evil-change (beg end type register yank-handler delete-func)
"Like `evil-change' but will not delete/copy the prompt."
(interactive "<R><x><y>")
(save-restriction
(narrow-to-region eshell-last-output-end (point-max))
(evil-change (max beg (point-min))
(if (eq type 'line) (point-max) (min (or end (point-max)) (point-max)))
type register yank-handler delete-func)))
;;;###autoload (autoload '+eshell/evil-change-line "term/eshell/autoload/evil" nil t)
(evil-define-operator +eshell/evil-change-line (beg end type register yank-handler)
"Change to end of line."
:motion evil-end-of-line
(interactive "<R><x><y>")
(+eshell/evil-change beg end type register yank-handler #'evil-delete-line))
;;;###autoload (autoload '+eshell/evil-delete "term/eshell/autoload/evil" nil t)
(evil-define-operator +eshell/evil-delete (beg end type register yank-handler)
"Like `evil-delete' but will not delete/copy the prompt."
(interactive "<R><x><y>")
(save-restriction
(narrow-to-region eshell-last-output-end (point-max))
(evil-delete (if beg (max beg (point-min)) (point-min))
(if (eq type 'line) (point-max) (min (or end (point-max)) (point-max)))
type register yank-handler)))
;;;###autoload (autoload '+eshell/evil-delete-line "term/eshell/autoload/evil" nil t)
(evil-define-operator +eshell/evil-delete-line (_beg end type register yank-handler)
"Change to end of line."
:motion nil
:keep-visual t
(interactive "<R><x>")
(+eshell/evil-delete (point) end type register yank-handler))

View File

@@ -126,10 +126,6 @@ You should use `set-eshell-alias!' to change this.")
(map! :map eshell-mode-map
:n "RET" #'+eshell/goto-end-of-prompt
:n [return] #'+eshell/goto-end-of-prompt
:n "c" #'+eshell/evil-change
:n "C" #'+eshell/evil-change-line
:n "d" #'+eshell/evil-delete
:n "D" #'+eshell/evil-delete-line
:ni "C-j" #'eshell-next-matching-input-from-input
:ni "C-k" #'eshell-previous-matching-input-from-input
:ig "C-d" #'+eshell/quit-or-delete-char

View File

@@ -10,4 +10,4 @@
(unless IS-WINDOWS
(when (featurep! :completion company)
(package! fish-completion :pin "10384881817b5ae38cf6197a077a663420090d2c")
(package! bash-completion :pin "96ce14af9674f3e605bacca87abc0c23b8f13cd5")))
(package! bash-completion :pin "d47edb9d4142a22746009c1f680df93a4fefd107")))

View File

@@ -6,6 +6,18 @@
:preface (setq vterm-install t) ; compile the package when you load vterm
:hook (vterm-mode . doom-mark-buffer-as-real-h)
:hook (vterm-mode . hide-mode-line-mode) ; modeline serves no purpose in vterm
:preface
(when! (fboundp 'native-compile)
;; HACK Fix #3683: `vterm-module-compile' uses `locate-library' to determine
;; where vterm-module.so should be, but an eln file (for emacsGcc
;; users) reports a subdirectory that will never contain it; rendering
;; vterm unable to build itself.
;; REVIEW Remove this when akermu/emacs-libvterm#363 is resolved.
(defadvice! +vterm--dont-resolve-to-eln-file-a (orig-fn &rest args)
:around #'vterm-module-compile
(let ((load-suffixes (remove ".eln" load-suffixes)))
(apply orig-fn args))))
:config
(set-popup-rule! "^vterm" :size 0.25 :vslot -4 :select t :quit nil :ttl 0)

View File

@@ -1,8 +1,5 @@
;;; term/vterm/doctor.el -*- lexical-binding: t; -*-
(unless (executable-find "vterm-ctrl")
(warn! "Couldn't find libvterm. Vterm module won't compile"))
(unless (executable-find "make")
(warn! "Couldn't find make command. Vterm module won't compile"))

View File

@@ -13,11 +13,19 @@
:desc "Encrypt buffer" "e" #'ansible-encrypt-buffer
:desc "Look up in Ansible docs" "h" #'ansible-doc))
(after! ansible-doc
(set-evil-initial-state! '(ansible-doc-module-mode) 'emacs))
(use-package! jinja2-mode
:mode "\\.j2$")
:mode "\\.j2$"
:config
;; The default behavior is to reindent the whole buffer on save. This is
;; disruptive and imposing. There are indentation commands available; the user
;; can decide when they want their code reindented.
(setq jinja2-enable-indent-on-save nil))
(def-project-mode! +ansible-yaml-mode
:modes '(yaml-mode)

View File

@@ -1,9 +1,9 @@
;; -*- no-byte-compile: t; -*-
;;; tools/ansible/packages.el
(package! ansible :recipe (:nonrecursive t) :pin "c6532e52161a381ed3dddfeaa7c92ae636d3f052")
(package! ansible :recipe (:nonrecursive t) :pin "b5ef59406604bc5027f4d816d90e633feef0149c")
(package! ansible-doc :pin "86083a7bb2ed0468ca64e52076b06441a2f8e9e0")
(package! jinja2-mode :pin "4540f99a3e363403a633587e05a9707605c16473")
(package! jinja2-mode :pin "ecd19a40b7832bb00f0a2244e3b0713d0bf3850d")
(package! yaml-mode :pin "34648f2502f52f4744d62758fa381fa35db1da49")
(when (featurep! :completion company)

View File

@@ -16,6 +16,20 @@
(realgud:trepanpl :modes (perl-mode perl6-mode))
(realgud:zshdb :modes (sh-mode))))
(defvar +debugger--dap-alist
`(((:lang cc +lsp) :after ccls :require (dap-lldb dap-gdb-lldb))
((:lang elixir +lsp) :after elixir-mode :require dap-elixir)
((:lang go +lsp) :after go-mode :require dap-go)
((:lang java +lsp) :after java-mode :require lsp-java)
((:lang php +lsp) :after php-mode :require dap-php)
((:lang python +lsp) :after python :require dap-python)
((:lang ruby +lsp) :after ruby-mode :require dap-ruby)
((:lang rust +lsp) :after rust-mode :require dap-lldb)
((:lang javascript +lsp)
:after (js2-mode typescript-mode)
:require (dap-node dap-chrome dap-firefox ,@(if IS-WINDOWS '(dap-edge)))))
"TODO")
;;
;;; Packages
@@ -97,30 +111,21 @@
(setq dap-breakpoints-file (concat doom-etc-dir "dap-breakpoints")
dap-utils-extension-path (concat doom-etc-dir "dap-extension/"))
:config
(dolist (module '(((:lang . cc) ccls dap-lldb dap-gdb-lldb)
((:lang . elixir) elixir-mode dap-elixir)
((:lang . go) go-mode dap-go)
((:lang . java) lsp-java dap-java)
((:lang . php) php-mode dap-php)
((:lang . python) python dap-python)
((:lang . ruby) ruby-mode dap-ruby)
((:lang . rust) rust-mode dap-lldb)))
(when (doom-module-p (caar module) (cdar module) '+lsp)
(with-eval-after-load (nth 1 module)
(mapc #'require (cddr module)))))
(pcase-dolist (`((,category . ,modules) :after ,after :require ,libs)
+debugger--dap-alist)
(when (doom-module-p category (car modules) (cadr modules))
(dolist (lib (doom-enlist after))
(with-eval-after-load lib
(mapc #'require (doom-enlist libs))))))
(when (featurep! :lang javascript +lsp)
(after! (:or js2-mode typescript-mode)
(require 'dap-node)
(require 'dap-chrome)
(require 'dap-firefox)
(when IS-WINDOWS
(require 'dap-edge))))
(dap-mode 1)
(dap-mode 1))
(map! :localleader
:map dap-mode-map
"d" #'dap-hydra))
(use-package! dap-ui-mode
(use-package! dap-ui
:when (featurep! +lsp)
:hook (dap-mode . dap-ui-mode)
:hook (dap-ui-mode . dap-ui-controls-mode))

View File

@@ -1,10 +1,10 @@
;; -*- no-byte-compile: t; -*-
;;; tools/debugger/packages.el
(when (package! realgud :pin "1238d8e72945a84bb06cd39d7ded75f37105d4d2")
(when (package! realgud :pin "5b0ed08364b1f5e2df2f3f7d5a6e7a2fedb5189a")
(when (featurep! :lang javascript)
(package! realgud-trepan-ni :pin "6e9cac5e8097018aadf41c88de541168036cc227")))
(package! realgud-trepan-ni :pin "6e38cf838c7b47b5f1353d00901b939ffa36d707")))
(when (featurep! +lsp)
(package! dap-mode :pin "7ad915794b75481f12b3f02ac8f5c9bcfddd6938")
(package! posframe :pin "6285217711bc846e565940261829b523e298f82e"))
(package! dap-mode :pin "85a61630499bb836bdb378fb62ea4ddd4f61a2dd")
(package! posframe :pin "6d604a71deb45295f7b6ff3f98e06aeece9888be"))

View File

@@ -1,4 +1,4 @@
;; -*- no-byte-compile: t; -*-
;;; tools/ein/packages.el
(package! ein :pin "ee31cdb77de397bdff01abf5ffa087f384517f0c")
(package! ein :pin "ccbed30c991623d56a310d02c76f03d571e90e82")

View File

@@ -77,7 +77,7 @@
(get-buffer-window (or (+eval--ensure-in-repl-buffer)
t))))
(+eval/send-region-to-repl beg end)
(if-let (runner (cdr (assq major-mode +eval-runners)))
(if-let (runner (alist-get major-mode +eval-runners))
(funcall runner beg end)
(quickrun-region beg end)))))

View File

@@ -51,7 +51,7 @@
(defun +eval-open-repl (prompt-p &optional displayfn)
(cl-destructuring-bind (_mode fn . plist)
(or (assq major-mode +eval-repls)
(list))
(list nil nil))
(when (or (not fn) prompt-p)
(let* ((choices (or (cl-loop for sym being the symbols
for sym-name = (symbol-name sym)

View File

@@ -1,6 +1,6 @@
;; -*- no-byte-compile: t; -*-
;;; tools/eval/packages.el
(package! quickrun :pin "c6ce1f315b768af8688d06bc57d2eb403f875a63")
(package! quickrun :pin "ce7383c53215077f7e1d258d389cf8731309fbe9")
(when (featurep! +overlay)
(package! eros :pin "dd8910279226259e100dab798b073a52f9b4233a"))

View File

@@ -21,6 +21,7 @@
- [[#associating-lookup-handlers-with-major-modes][Associating lookup handlers with major modes]]
- [[#associating-dash-docsets-with-major-modes][Associating Dash docsets with major modes]]
- [[#open-in-eww-instead-of-browser][Open in eww instead of browser]]
- [[#open-in-xwidget-webkit-instead-of-browser][Open in Xwidget WebKit instead of browser]]
- [[#appendix][Appendix]]
- [[#commands][Commands]]
@@ -40,7 +41,6 @@ or synonyms.
+ ~+dictionary~ Enable word definition and thesaurus lookup functionality.
+ ~+offline~ Install and prefer offline dictionary/thesaurus.
+ ~+docsets~ Enable integration with Dash.app docsets.
+ ~+xwidget~ Enable integration with [[https://www.gnu.org/software/emacs/manual/html_node/emacs/Embedded-WebKit-Widgets.html][Embedded Webkit Widgets]].
** Plugins
+ [[https://github.com/jacktasia/dumb-jump][dumb-jump]]
@@ -208,13 +208,23 @@ This determines what docsets to implicitly search for when you use
docsets must be installed with ~+lookup/install-docset~.
** Open in eww instead of browser
To open results from ~+lookup/online~ in EWW instead of your system browser,
change ~+lookup-open-url-fn~ (default: ~#'browse-url~):
To open results from ~+lookup/online~ or ~+lookup/in-docsets~ in EWW instead
of your system browser, change ~+lookup-open-url-fn~ (default:
~#'browse-url~):
#+BEGIN_SRC emacs-lisp
(setq +lookup-open-url-fn #'eww)
#+END_SRC
** Open in Xwidget WebKit instead of browser
To open results from ~+lookup/online~ or ~+lookup/in-docsets~ in Xwidget
WebKit instead of your system browser, set ~+lookup-open-url-fn~ to
~+lookup-xwidget-webkit-open-url-fn~ (needs Emacs with Xwidgets support):
#+BEGIN_SRC emacs-lisp
(setq +lookup-open-url-fn #'+lookup-xwidget-webkit-open-url-fn)
#+END_SRC
* Appendix
** Commands
+ ~+lookup/definition~

View File

@@ -192,6 +192,18 @@ This can be passed nil as its second argument to unset handlers for MODES. e.g.
'deferred
t))))
(defun +lookup-dictionary-definition-backend-fn (identifier)
"Look up dictionary definition for IDENTIFIER."
(when (derived-mode-p 'text-mode)
(+lookup/dictionary-definition identifier)
'deferred))
(defun +lookup-thesaurus-definition-backend-fn (identifier)
"Look up synonyms for IDENTIFIER."
(when (derived-mode-p 'text-mode)
(+lookup/synonyms identifier)
'deferred))
(defun +lookup-xref-definitions-backend-fn (identifier)
"Non-interactive wrapper for `xref-find-definitions'"
(+lookup--xref-show 'xref-backend-definitions identifier #'xref--show-defs))
@@ -343,7 +355,7 @@ Otherwise, falls back on `find-file-at-point'."
(list (or (doom-thing-at-point-or-region 'word)
(read-string "Look up in dictionary: "))
current-prefix-arg))
(message "Looking up definition for %S" identifier)
(message "Looking up dictionary definition for %S" identifier)
(cond ((and IS-MAC (require 'osx-dictionary nil t))
(osx-dictionary--view-result identifier))
((and +lookup-dictionary-prefer-offline

View File

@@ -16,24 +16,23 @@
;;;###autoload
(defun +lookup-online-backend-fn (identifier)
"Opens the browser and searches for IDENTIFIER online.
Will prompt for which search engine to use the first time (or if the universal
argument is non-nil)."
"Open the browser and search for IDENTIFIER online.
When called for the first time, or with a non-nil prefix argument, prompt for
the search engine to use."
(+lookup/online
identifier
(+lookup--online-provider (not current-prefix-arg))))
;;;###autoload
(defun +lookup/online (query provider)
"Looks up QUERY (a string) in you browser usin PROVIDER.
"Look up QUERY in the browser using PROVIDER.
When called interactively, prompt for a query and, when called for the first
time, the provider from `+lookup-provider-url-alist'. In subsequent calls, reuse
the previous provider. With a non-nil prefix argument, always prompt for the
provider.
PROVIDER should be a key of `+lookup-provider-url-alist'.
When used interactively, it will prompt for a query and, for the first time, the
provider from `+lookup-provider-url-alist'. On consecutive uses, the last
provider will be reused. If the universal argument is supplied, always prompt
for the provider."
QUERY must be a string, and PROVIDER must be a key of
`+lookup-provider-url-alist'."
(interactive
(list (if (use-region-p) (doom-thing-at-point-or-region))
(+lookup--online-provider current-prefix-arg)))
@@ -64,7 +63,7 @@ for the provider."
;;;###autoload
(defun +lookup/online-select ()
"Runs `+lookup/online', but always prompts for the provider to use."
"Run `+lookup/online', but always prompt for the provider to use."
(interactive)
(let ((current-prefix-arg t))
(call-interactively #'+lookup/online)))
@@ -77,7 +76,7 @@ for the provider."
(defvar counsel-search-engine)
;;;###autoload
(defun +lookup--online-backend-google (query)
"Search google, starting with QUERY, with live autocompletion."
"Search Google, starting with QUERY, with live autocompletion."
(cond ((fboundp 'counsel-search)
(let ((ivy-initial-inputs-alist `((t . ,query)))
(counsel-search-engine 'google))
@@ -91,7 +90,7 @@ for the provider."
;;;###autoload
(defun +lookup--online-backend-duckduckgo (query)
"Search duckduckgo, starting with QUERY, with live autocompletion."
"Search DuckDuckGo, starting with QUERY, with live autocompletion."
(cond ((fboundp 'counsel-search)
(let ((ivy-initial-inputs-alist `((t . ,query)))
(counsel-search-engine 'ddg))

Some files were not shown because too many files have changed in this diff Show More