Merge branch 'develop' of https://github.com/hlissner/doom-emacs into add-lsp-command-map
This commit is contained in:
commit
fb3c6f9d78
205 changed files with 2592 additions and 1819 deletions
|
@ -42,10 +42,10 @@
|
|||
org-gcal-fetch
|
||||
org-gcal-post-at-point
|
||||
org-gcal-delete-at-point)
|
||||
:init
|
||||
(defvar org-gcal-dir (concat doom-cache-dir "org-gcal/"))
|
||||
(defvar org-gcal-token-file (concat org-gcal-dir "token.gpg"))
|
||||
:config
|
||||
;; hack to avoid the deferred.el error
|
||||
(defun org-gcal--notify (title mes)
|
||||
(message "org-gcal::%s - %s" title mes)))
|
||||
|
||||
|
||||
;; (use-package! alert)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
;; -*- no-byte-compile: t; -*-
|
||||
;;; app/calendar/packages.el
|
||||
|
||||
(package! calfw :pin "03abce9762")
|
||||
(package! calfw-org :pin "03abce9762")
|
||||
(package! org-gcal :pin "6821e34967")
|
||||
(package! calfw :pin "03abce97620a4a7f7ec5f911e669da9031ab9088")
|
||||
(package! calfw-org :pin "03abce97620a4a7f7ec5f911e669da9031ab9088")
|
||||
(package! org-gcal :pin "2ee2b31547e6f4e33db70fb812d552e55d612fd6")
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
;; -*- no-byte-compile: t; -*-
|
||||
;;; app/irc/packages.el
|
||||
|
||||
(package! circe :pin "e5bf5f8974")
|
||||
(package! circe-notifications :pin "291149ac12")
|
||||
(package! circe :pin "e5bf5f89741a9c43aa406491e94dd8d58c302fb4")
|
||||
(package! circe-notifications :pin "291149ac12877bbd062da993479d3533a26862b0")
|
||||
|
|
|
@ -101,10 +101,9 @@
|
|||
;;;###autoload
|
||||
(defun +rss-put-sliced-image-fn (spec alt &optional flags)
|
||||
"TODO"
|
||||
(cl-letf (((symbol-function #'insert-image)
|
||||
(lambda (image &optional alt _area _slice)
|
||||
(let ((height (cdr (image-size image t))))
|
||||
(insert-sliced-image image alt nil (max 1 (/ height 20.0)) 1)))))
|
||||
(letf! (defun insert-image (image &optional alt _area _slice)
|
||||
(let ((height (cdr (image-size image t))))
|
||||
(insert-sliced-image image alt nil (max 1 (/ height 20.0)) 1)))
|
||||
(shr-put-image spec alt flags)))
|
||||
|
||||
;;;###autoload
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
;; -*- no-byte-compile: t; -*-
|
||||
;;; app/rss/packages.el
|
||||
|
||||
(package! elfeed :pin "d0405e6386")
|
||||
(package! elfeed-org :pin "77b6bbf222")
|
||||
(package! elfeed :pin "d0405e63863e54a01200740a6717ac875eceabc1")
|
||||
(package! elfeed-org :pin "77b6bbf222487809813de260447d31c4c59902c9")
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
;; -*- no-byte-compile: t; -*-
|
||||
;;; app/twitter/packages.el
|
||||
|
||||
(package! twittering-mode :pin "114891e8fd")
|
||||
(package! avy :pin "3bf83140fa")
|
||||
(package! twittering-mode :pin "114891e8fdb4f06b1326a6cf795e49c205cf9e29")
|
||||
(package! avy :pin "509471bad0e8094b8639729ec39ca141fae7d4bd")
|
||||
|
|
|
@ -8,15 +8,16 @@
|
|||
:init (setq langtool-default-language "en-US")
|
||||
:config
|
||||
(unless (or langtool-bin
|
||||
langtool-language-tool-jar)
|
||||
(setq langtool-language-tool-jar
|
||||
(cond (IS-MAC
|
||||
langtool-language-tool-jar
|
||||
langtool-java-classpath)
|
||||
(cond (IS-MAC
|
||||
(setq langtool-language-tool-jar
|
||||
(locate-file "libexec/languagetool-commandline.jar"
|
||||
(doom-files-in "/usr/local/Cellar/languagetool"
|
||||
:type 'dirs
|
||||
:depth 2)))
|
||||
(IS-LINUX
|
||||
"/usr/share/java/languagetool/languagetool-commandline.jar")))))
|
||||
:depth 2))))
|
||||
(IS-LINUX
|
||||
(setq langtool-java-classpath "/usr/share/languagetool:/usr/share/java/languagetool/*")))))
|
||||
|
||||
|
||||
;; Detects weasel words, passive voice and duplicates. Proselint would be a
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
;; -*- no-byte-compile: t; -*-
|
||||
;;; checkers/grammar/packages.el
|
||||
|
||||
(package! langtool :pin "a71ed02ce0")
|
||||
(package! writegood-mode :pin "b71757ec33")
|
||||
(package! langtool :pin "a71ed02ce06920ae3cafd6708de1c21811ce14c3")
|
||||
(package! writegood-mode :pin "b71757ec337e226909fb0422f0224e31acc71733")
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
;; -*- no-byte-compile: t; -*-
|
||||
;;; checkers/spell/packages.el
|
||||
|
||||
(package! flyspell-correct :pin "e765d1a3d9")
|
||||
(package! flyspell-correct :pin "fd8ac7a4f922ce5ea1cc5d4583a7d584847cb6b5")
|
||||
(cond ((featurep! :completion ivy)
|
||||
(package! flyspell-correct-ivy :pin "e765d1a3d9"))
|
||||
(package! flyspell-correct-ivy))
|
||||
((featurep! :completion helm)
|
||||
(package! flyspell-correct-helm :pin "e765d1a3d9"))
|
||||
((package! flyspell-correct-popup :pin "e765d1a3d9")))
|
||||
(package! flyspell-correct-helm))
|
||||
((package! flyspell-correct-popup)))
|
||||
|
||||
(package! flyspell-lazy :pin "3ebf68cc9e")
|
||||
(package! flyspell-lazy :pin "3ebf68cc9eb10c972a2de8d7861cbabbbce69570")
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
;; -*- no-byte-compile: t; -*-
|
||||
;;; checkers/syntax/packages.el
|
||||
|
||||
(package! flycheck :pin "f19a51c0f1")
|
||||
(package! flycheck-popup-tip :pin "ef86aad907")
|
||||
(package! flycheck :pin "246e1d4380721ca03962464f11d02dd1372860ce")
|
||||
(package! flycheck-popup-tip :pin "ef86aad907f27ca076859d8d9416f4f7727619c6")
|
||||
(when (featurep! +childframe)
|
||||
(package! flycheck-posframe :pin "2b3e94c2e4"))
|
||||
(package! flycheck-posframe :pin "2b3e94c2e427ec9831c513007460c5ea9e2225a3"))
|
||||
|
||||
;; TODO flymake?
|
||||
|
|
|
@ -11,9 +11,26 @@
|
|||
company-require-match 'never
|
||||
company-global-modes
|
||||
'(not erc-mode message-mode help-mode gud-mode eshell-mode)
|
||||
company-backends '(company-capf)
|
||||
company-frontends '(company-pseudo-tooltip-frontend
|
||||
company-echo-metadata-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 overrides `company-active-map' based on
|
||||
;; `company-auto-complete-chars'; no magic please!
|
||||
company-auto-complete-chars nil
|
||||
|
||||
;; Only search the current buffer for `company-dabbrev' (a backend that
|
||||
;; suggests text your open buffers). This prevents Company from causing
|
||||
;; lag once you have a lot of buffers open.
|
||||
company-dabbrev-other-buffers nil
|
||||
;; Make `company-dabbrev' fully case-sensitive, to improve UX with
|
||||
;; domain-specific words with particular casing.
|
||||
company-dabbrev-ignore-case nil
|
||||
company-dabbrev-downcase nil)
|
||||
|
||||
:config
|
||||
(when (featurep! :editor evil)
|
||||
(add-hook 'company-mode-hook #'evil-normalize-keymaps)
|
||||
|
@ -106,6 +123,8 @@
|
|||
(ElispFeature . ,(all-the-icons-material "stars" :face 'all-the-icons-orange))
|
||||
(ElispFace . ,(all-the-icons-material "format_paint" :face 'all-the-icons-pink)))))
|
||||
|
||||
(delq! 'company-echo-metadata-frontend company-frontends)
|
||||
|
||||
(defun +company-box-icons--elisp-fn (candidate)
|
||||
(when (derived-mode-p 'emacs-lisp-mode)
|
||||
(let ((sym (intern candidate)))
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
;; -*- no-byte-compile: t; -*-
|
||||
;;; completion/company/packages.el
|
||||
|
||||
(package! company :pin "61ddd9afb5")
|
||||
(package! company-dict :pin "cd7b8394f6")
|
||||
(package! company-prescient :pin "53307731f3")
|
||||
(package! company :pin "6333fc4ebbbf4d28e834de8715561e984f149ecb")
|
||||
(package! company-dict :pin "cd7b8394f6014c57897f65d335d6b2bd65dab1f4")
|
||||
(package! company-prescient :pin "0f4a89bdec61395138d968a38d375e63ccfbed63")
|
||||
(when (featurep! +childframe)
|
||||
(package! company-box :pin "8fc6168f2d"))
|
||||
(package! company-box :pin "3814fcb14e92f4b85b19e664e216a7c8d5c7144d"))
|
||||
|
|
|
@ -101,14 +101,7 @@ be negative.")
|
|||
:config
|
||||
(set-popup-rule! "^\\*helm" :vslot -100 :size 0.22 :ttl nil)
|
||||
|
||||
;; HACK Doom doesn't support these commands, which invite the user to install
|
||||
;; the package via ELPA. Force them to use +helm/* instead, because they work
|
||||
;; out of the box.
|
||||
(advice-add #'helm-projectile-rg :override #'+helm/project-search)
|
||||
(advice-add #'helm-projectile-ag :override #'+helm/project-search)
|
||||
(advice-add #'helm-projectile-grep :override #'+helm/project-search)
|
||||
|
||||
;; Hide the modeline
|
||||
;; Hide the modeline in helm windows as it serves little purpose.
|
||||
(defun +helm--hide-mode-line (&rest _)
|
||||
(with-current-buffer (helm-buffer-get)
|
||||
(unless helm-mode-line-string
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
;; -*- no-byte-compile: t; -*-
|
||||
;;; completion/helm/packages.el
|
||||
|
||||
(package! helm :pin "d978f20f4c")
|
||||
(package! helm-rg :pin "785a80fe5c")
|
||||
(package! helm-c-yasnippet :pin "65ca732b51")
|
||||
(package! helm-company :pin "6eb5c2d730")
|
||||
(package! helm :pin "b6db9fb47a8900704394e63b795f4a54cb4701a8")
|
||||
(package! helm-rg :pin "785a80fe5cc87e27c5ea3d00a70049028d9e2847")
|
||||
(package! helm-c-yasnippet :pin "65ca732b510bfc31636708aebcfe4d2d845b59b0")
|
||||
(package! helm-company :pin "6eb5c2d730a60e394e005b47c1db018697094dde")
|
||||
(package! helm-describe-modes
|
||||
:recipe (:host github :repo "emacs-helm/helm-describe-modes")
|
||||
:pin "11fb36af11")
|
||||
(package! helm-projectile :pin "5328b74ddd")
|
||||
(package! swiper-helm :pin "93fb6db87b")
|
||||
:pin "11fb36af119b784539d31c6160002de1957408aa")
|
||||
(package! helm-projectile :pin "5328b74dddcee8d1913803ca8167868831a07463")
|
||||
(package! swiper-helm :pin "93fb6db87bc6a5967898b5fd3286954cc72a0008")
|
||||
(when (featurep! +fuzzy)
|
||||
(package! helm-flx :pin "6640fac5cb"))
|
||||
(package! helm-flx :pin "6640fac5cb16bee73c95b8ed1248a4e5e113690e"))
|
||||
(when (featurep! +childframe)
|
||||
(package! posframe :pin "e62e584268"))
|
||||
(package! posframe :pin "093b29a53cbeda6d637ccc9ef4dfc47123e79b9e"))
|
||||
(when (featurep! :lang org)
|
||||
(package! helm-org :pin "b7a18dfc17"))
|
||||
(package! helm-descbinds :pin "b725159823")
|
||||
(package! helm-org :pin "b7a18dfc17e8b933956d61d68c435eee03a96c24"))
|
||||
(package! helm-descbinds :pin "b72515982396b6e336ad7beb6767e95a80fca192")
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
;; -*- no-byte-compile: t; -*-
|
||||
;;; completion/ido/packages.el
|
||||
|
||||
(package! flx-ido :pin "17f5c9cb2a")
|
||||
(package! ido-completing-read+ :pin "98d3a6e56b")
|
||||
(package! ido-sort-mtime :pin "f638ff0c92")
|
||||
(package! ido-vertical-mode :pin "16c4c1a112")
|
||||
(package! crm-custom :pin "f1aaccf643")
|
||||
(package! flx-ido :pin "17f5c9cb2af18aa6f52910ff4a5a63591261ced5")
|
||||
(package! ido-completing-read+ :pin "98d3a6e56b1d3652da7b47f49f76d77f82ea80ba")
|
||||
(package! ido-sort-mtime :pin "f638ff0c922af862f5211779f2311a27fde428eb")
|
||||
(package! ido-vertical-mode :pin "16c4c1a112796ee0bcf401ea39d3e2643a89feaf")
|
||||
(package! crm-custom :pin "f1aaccf64306a5f99d9bf7ba815d7ea41c15518d")
|
||||
|
|
|
@ -129,7 +129,11 @@ evil-ex-specific constructs, so we disable it solely in evil-ex."
|
|||
(ivy-rich-counsel-function-docstring (:face font-lock-doc-face))))
|
||||
;; Apply switch buffer transformers to `counsel-projectile-switch-to-buffer' as well
|
||||
'counsel-projectile-switch-to-buffer
|
||||
(plist-get ivy-rich-display-transformers-list 'ivy-switch-buffer))
|
||||
(plist-get ivy-rich-display-transformers-list 'ivy-switch-buffer)
|
||||
'counsel-bookmark
|
||||
'(:columns
|
||||
((ivy-rich-candidate (:width 0.5))
|
||||
(ivy-rich-bookmark-filename (:width 60)))))
|
||||
|
||||
;; Remove built-in coloring of buffer list; we do our own
|
||||
(setq ivy-switch-buffer-faces-alist nil)
|
||||
|
@ -260,9 +264,15 @@ evil-ex-specific constructs, so we disable it solely in evil-ex."
|
|||
:override #'counsel--find-return-list
|
||||
(cl-destructuring-bind (find-program . args)
|
||||
(cond ((executable-find doom-projectile-fd-binary)
|
||||
(cons doom-projectile-fd-binary (list "-t" "f" "-E" ".git")))
|
||||
(cons doom-projectile-fd-binary
|
||||
(list "--color=never" "-E" ".git"
|
||||
"--type" "file" "--type" "symlink" "--follow")))
|
||||
((executable-find "rg")
|
||||
(split-string (format counsel-rg-base-command "--files --no-messages") " " t))
|
||||
(append (list "rg" "--files" "--follow" "--color=never" "--hidden" "--no-messages")
|
||||
(cl-loop for dir in projectile-globally-ignored-directories
|
||||
collect "--glob"
|
||||
collect (concat "!" dir))
|
||||
(if IS-WINDOWS (list "--path-separator" "/"))))
|
||||
((cons find-program args)))
|
||||
(unless (listp args)
|
||||
(user-error "`counsel-file-jump-args' is a list now, please customize accordingly."))
|
||||
|
@ -328,7 +338,9 @@ evil-ex-specific constructs, so we disable it solely in evil-ex."
|
|||
;; posframe.
|
||||
(dolist (fn '(swiper counsel-rg counsel-grep counsel-git-grep))
|
||||
(setf (alist-get fn ivy-posframe-display-functions-alist)
|
||||
#'ivy-display-function-fallback)))
|
||||
#'ivy-display-function-fallback))
|
||||
|
||||
(add-hook 'doom-reload-hook #'posframe-delete-all))
|
||||
|
||||
|
||||
(use-package! flx
|
||||
|
|
|
@ -1,23 +1,23 @@
|
|||
;; -*- no-byte-compile: t; -*-
|
||||
;;; completion/ivy/packages.el
|
||||
|
||||
(package! swiper :pin "64f05f4735")
|
||||
(package! swiper :pin "9e0803cdb5b47e4e1844e8281516b46589ef26c7")
|
||||
(package! ivy)
|
||||
(package! ivy-hydra)
|
||||
(package! counsel)
|
||||
|
||||
(package! amx :pin "e512e74e83")
|
||||
(package! counsel-projectile :pin "b556ed8995")
|
||||
(package! ivy-rich :pin "596874d146")
|
||||
(package! wgrep :pin "5977b8e000")
|
||||
(package! amx :pin "7fb7b874291e0cdeb1f0acb18564a686ec86788d")
|
||||
(package! counsel-projectile :pin "b556ed8995f375e57496f3482aef4b0def565de8")
|
||||
(package! ivy-rich :pin "3f818b201769bc13cc75aa73645217e374136aca")
|
||||
(package! wgrep :pin "5977b8e00051c9003ca96e9d35133e0dea68db2c")
|
||||
|
||||
(if (featurep! +prescient)
|
||||
(package! ivy-prescient :pin "53307731f3")
|
||||
(package! ivy-prescient :pin "0f4a89bdec61395138d968a38d375e63ccfbed63")
|
||||
(when (featurep! +fuzzy)
|
||||
(package! flx :pin "17f5c9cb2a")))
|
||||
(package! flx :pin "17f5c9cb2af18aa6f52910ff4a5a63591261ced5")))
|
||||
|
||||
(when (featurep! +childframe)
|
||||
(package! ivy-posframe :pin "ae9bafe94f"))
|
||||
(package! ivy-posframe :pin "ae9bafe94fe6b77b6fe45766ae6172646f6a5d50"))
|
||||
|
||||
(when (featurep! +icons)
|
||||
(package! all-the-icons-ivy :pin "a70cbfa1ef"))
|
||||
(package! all-the-icons-ivy :pin "a70cbfa1effe36efc946a823a580cec686d5e88d"))
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
: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
|
||||
(:when (featurep! :tools flycheck)
|
||||
(:when (featurep! :checkers syntax)
|
||||
:desc "List errors" "x" #'flycheck-list-errors)
|
||||
(:when (featurep! :tools lsp)
|
||||
:desc "LSP Code actions" "a" #'lsp-execute-code-action
|
||||
|
@ -159,7 +159,7 @@
|
|||
: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-show
|
||||
:desc "Show graph" "g" #'org-roam-graph
|
||||
:desc "Insert" "i" #'org-roam-insert
|
||||
:desc "Org Roam" "r" #'org-roam
|
||||
(:prefix ("d" . "by date")
|
||||
|
@ -182,7 +182,7 @@
|
|||
:desc "Find file in project sidebar" "P" #'+neotree/find-this-file)
|
||||
(:when (featurep! :ui treemacs)
|
||||
:desc "Project sidebar" "p" #'+treemacs/toggle
|
||||
:desc "Find file in project rsidebar" "P" #'+treemacs/find-file)
|
||||
:desc "Find file in project rsidebar" "P" #'treemacs-find-file)
|
||||
(:when (featurep! :term shell)
|
||||
:desc "Toggle shell popup" "t" #'+shell/toggle
|
||||
:desc "Open shell here" "T" #'+shell/here)
|
||||
|
@ -249,14 +249,14 @@
|
|||
:desc "Indent style" "I" #'doom/toggle-indent-style
|
||||
:desc "Line numbers" "l" #'doom/toggle-line-numbers
|
||||
:desc "Word-wrap mode" "w" #'+word-wrap-mode
|
||||
(:when (featurep! :tools flycheck)
|
||||
(:when (featurep! :checkers syntax)
|
||||
:desc "Flycheck" "f" #'flycheck-mode)
|
||||
(:when (featurep! :ui indent-guides)
|
||||
:desc "Indent guides" "i" #'highlight-indent-guides-mode)
|
||||
(:when (featurep! :lang org +present)
|
||||
:desc "org-tree-slide mode" "p" #'+org-present/start)
|
||||
:desc "Read-only mode" "r" #'read-only-mode
|
||||
(:when (featurep! :tools flyspell)
|
||||
(:when (featurep! :checkers spell)
|
||||
:desc "Flyspell" "s" #'flyspell-mode)
|
||||
(:when (featurep! :lang org +pomodoro)
|
||||
:desc "Pomodoro timer" "t" #'org-pomodoro)
|
||||
|
@ -543,14 +543,4 @@
|
|||
;;; treemacs
|
||||
(:when (featurep! :ui treemacs)
|
||||
"<f9>" #'+treemacs/toggle
|
||||
"<C-f9>" #'+treemacs/find-file)
|
||||
|
||||
;;; yasnippet
|
||||
(:after yasnippet
|
||||
:map yas-keymap ; keymap while editing an inserted snippet
|
||||
"C-e" #'+snippets/goto-end-of-field
|
||||
"C-a" #'+snippets/goto-start-of-field
|
||||
"<S-tab>" #'yas-prev-field
|
||||
"<M-backspace>" #'+snippets/delete-to-start-of-field
|
||||
[backspace] #'+snippets/delete-backward-char
|
||||
[delete] #'+snippets/delete-forward-char-or-field))
|
||||
"<C-f9>" #'treemacs-find-file))
|
||||
|
|
|
@ -4,9 +4,12 @@
|
|||
;; NOTE SPC u replaces C-u as the universal argument.
|
||||
|
||||
;; Minibuffer
|
||||
(define-key! evil-ex-completion-map
|
||||
(define-key! :keymaps '(evil-ex-completion-map evil-ex-search-keymap)
|
||||
"C-a" #'evil-beginning-of-line
|
||||
"C-b" #'evil-backward-char)
|
||||
"C-b" #'evil-backward-char
|
||||
"C-f" #'evil-forward-char
|
||||
"C-j" #'next-complete-history-element
|
||||
"C-k" #'previous-complete-history-element)
|
||||
|
||||
(define-key! :keymaps +default-minibuffer-maps
|
||||
[escape] #'abort-recursive-edit
|
||||
|
@ -15,16 +18,20 @@
|
|||
"C-u" #'evil-delete-back-to-indentation
|
||||
"C-v" #'yank
|
||||
"C-w" #'doom/delete-backward-word
|
||||
"C-z" (λ! (ignore-errors (call-interactively #'undo)))
|
||||
;; Scrolling lines
|
||||
"C-j" #'next-line
|
||||
"C-k" #'previous-line
|
||||
"C-S-j" #'scroll-up-command
|
||||
"C-S-k" #'scroll-down-command)
|
||||
"C-z" (λ! (ignore-errors (call-interactively #'undo))))
|
||||
|
||||
(define-key! read-expression-map
|
||||
"C-j" #'next-line-or-history-element
|
||||
"C-k" #'previous-line-or-history-element))
|
||||
(when (featurep! :editor evil +everywhere)
|
||||
(define-key! :keymaps +default-minibuffer-maps
|
||||
"C-j" #'next-line
|
||||
"C-k" #'previous-line
|
||||
"C-S-j" #'scroll-up-command
|
||||
"C-S-k" #'scroll-down-command)
|
||||
(define-key! :states 'insert :keymaps +default-minibuffer-maps
|
||||
"C-j" #'next-line
|
||||
"C-k" #'previous-line)
|
||||
(define-key! read-expression-map
|
||||
"C-j" #'next-line-or-history-element
|
||||
"C-k" #'previous-line-or-history-element)))
|
||||
|
||||
|
||||
;;
|
||||
|
@ -186,9 +193,9 @@
|
|||
|
||||
;;; :ui
|
||||
(map! (:when (featurep! :ui popup)
|
||||
:n "C-`" #'+popup/toggle
|
||||
:n "C-~" #'+popup/raise
|
||||
:g "C-x p" #'+popup/other)
|
||||
"C-`" #'+popup/toggle
|
||||
"C-~" #'+popup/raise
|
||||
"C-x p" #'+popup/other)
|
||||
|
||||
(:when (featurep! :ui workspaces)
|
||||
:n "C-t" #'+workspace/new
|
||||
|
@ -489,7 +496,7 @@
|
|||
: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-show
|
||||
:desc "Show graph" "g" #'org-roam-graph
|
||||
:desc "Insert" "i" #'org-roam-insert
|
||||
:desc "Org Roam" "r" #'org-roam
|
||||
(:prefix ("d" . "by date")
|
||||
|
@ -522,7 +529,7 @@
|
|||
:desc "Find file in project sidebar" "P" #'+neotree/find-this-file)
|
||||
(:when (featurep! :ui treemacs)
|
||||
:desc "Project sidebar" "p" #'+treemacs/toggle
|
||||
:desc "Find file in project sidebar" "P" #'+treemacs/find-file)
|
||||
:desc "Find file in project sidebar" "P" #'treemacs-find-file)
|
||||
(:when (featurep! :term shell)
|
||||
:desc "Toggle shell popup" "t" #'+shell/toggle
|
||||
:desc "Open shell here" "T" #'+shell/here)
|
||||
|
|
|
@ -27,11 +27,15 @@
|
|||
;;;###autoload
|
||||
(defun +default/browse-notes ()
|
||||
"Browse files from `org-directory'."
|
||||
(interactive) (doom-project-browse org-directory))
|
||||
(interactive)
|
||||
(require 'org)
|
||||
(doom-project-browse org-directory))
|
||||
;;;###autoload
|
||||
(defun +default/find-in-notes ()
|
||||
"Find a file under `org-directory', recursively."
|
||||
(interactive) (doom-project-find-file org-directory))
|
||||
(interactive)
|
||||
(require 'org)
|
||||
(doom-project-find-file org-directory))
|
||||
|
||||
;;;###autoload
|
||||
(defun +default/find-file-under-here ()
|
||||
|
|
|
@ -25,7 +25,8 @@ If prefix ARG is set, prompt for a directory to search from."
|
|||
"Conduct a text search in the current project root.
|
||||
If prefix ARG is set, prompt for a known project to search from."
|
||||
(interactive "P")
|
||||
(let* ((disabled-command-function nil)
|
||||
(let* ((projectile-project-root nil)
|
||||
(disabled-command-function nil)
|
||||
(default-directory
|
||||
(if arg
|
||||
(if-let (projects (projectile-relevant-known-projects))
|
||||
|
@ -51,13 +52,14 @@ If prefix ARG is set, prompt for a known project to search from."
|
|||
(interactive
|
||||
(list (rxt-quote-pcre (or (doom-thing-at-point-or-region) ""))
|
||||
current-prefix-arg))
|
||||
(let ((default-directory
|
||||
(if arg
|
||||
(if-let (projects (projectile-relevant-known-projects))
|
||||
(completing-read "Switch to project: " projects
|
||||
nil t nil nil (doom-project-root))
|
||||
(user-error "There are no known projects"))
|
||||
default-directory)))
|
||||
(let* ((projectile-project-root nil)
|
||||
(default-directory
|
||||
(if arg
|
||||
(if-let (projects (projectile-relevant-known-projects))
|
||||
(completing-read "Switch to project: " projects
|
||||
nil t nil nil (doom-project-root))
|
||||
(user-error "There are no known projects"))
|
||||
default-directory)))
|
||||
(cond ((featurep! :completion ivy)
|
||||
(+ivy/project-search nil symbol))
|
||||
((featurep! :completion helm)
|
||||
|
|
|
@ -50,21 +50,6 @@ If `buffer-file-name' isn't set, uses `default-directory'."
|
|||
(abbreviate-file-name path)
|
||||
(file-name-nondirectory path)))))
|
||||
|
||||
;;;###autoload
|
||||
(defun +default--newline-indent-and-continue-comments-a ()
|
||||
"A replacement for `newline-and-indent'.
|
||||
|
||||
Continues comments if executed from a commented line, with special support for
|
||||
languages with weak native comment continuation support (like C-family
|
||||
languages)."
|
||||
(interactive)
|
||||
(if (and (sp-point-in-comment)
|
||||
comment-line-break-function)
|
||||
(funcall comment-line-break-function nil)
|
||||
(delete-horizontal-space t)
|
||||
(newline nil t)
|
||||
(indent-according-to-mode)))
|
||||
|
||||
|
||||
(defun doom--backward-delete-whitespace-to-column ()
|
||||
"Delete back to the previous column of whitespace, or as much whitespace as
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
;;; config/default/config.el -*- lexical-binding: t; -*-
|
||||
|
||||
(defvar +default-want-RET-continue-comments t
|
||||
"If non-nil, RET will continue commented lines.")
|
||||
|
||||
(defvar +default-minibuffer-maps
|
||||
(append '(minibuffer-local-map
|
||||
minibuffer-local-ns-map
|
||||
|
@ -31,7 +34,10 @@
|
|||
(after! epa
|
||||
;; With GPG 2.1+, this forces gpg-agent to use the Emacs minibuffer to prompt
|
||||
;; for the key passphrase.
|
||||
(setq epa-pinentry-mode 'loopback)
|
||||
(set (if EMACS27+
|
||||
'epg-pinentry-mode
|
||||
'epa-pinentry-mode) ; DEPRECATED `epa-pinentry-mode'
|
||||
'loopback)
|
||||
;; Default to the first secret key available in your keyring.
|
||||
(setq-default
|
||||
epa-file-encrypt-to
|
||||
|
@ -217,8 +223,28 @@
|
|||
;; f) do none of this when inside a string
|
||||
(advice-add #'delete-backward-char :override #'+default--delete-backward-char-a))
|
||||
|
||||
;; Makes `newline-and-indent' continue comments (and more reliably)
|
||||
(advice-add #'newline-and-indent :override #'+default--newline-indent-and-continue-comments-a))
|
||||
;; HACK Makes `newline-and-indent' continue comments (and more reliably).
|
||||
;; Consults `doom-point-in-comment-functions' to detect a commented
|
||||
;; region and uses that mode's `comment-line-break-function' to continue
|
||||
;; comments. If neither exists, it will fall back to the normal behavior
|
||||
;; of `newline-and-indent'.
|
||||
;;
|
||||
;; We use an advice here instead of a remapping because many modes define
|
||||
;; and remap to their own newline-and-indent commands, and tackling all
|
||||
;; those cases was judged to be more work than dealing with the edge
|
||||
;; cases on a case by case basis.
|
||||
(defadvice! +default--newline-indent-and-continue-comments-a (&rest _)
|
||||
"A replacement for `newline-and-indent'.
|
||||
|
||||
Continues comments if executed from a commented line. Consults
|
||||
`doom-point-in-comment-functions' to determine if in a comment."
|
||||
:before-until #'newline-and-indent
|
||||
(interactive "*")
|
||||
(when (and +default-want-RET-continue-comments
|
||||
(doom-point-in-comment-p)
|
||||
(fboundp comment-line-break-function))
|
||||
(funcall comment-line-break-function nil)
|
||||
t)))
|
||||
|
||||
|
||||
;;
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
;; -*- no-byte-compile: t; -*-
|
||||
;;; config/default/packages.el
|
||||
|
||||
(package! avy :pin "3bf83140fa")
|
||||
(package! drag-stuff :pin "6d06d846cd")
|
||||
(package! link-hint :pin "0d9cabcdb7")
|
||||
(package! avy :pin "509471bad0e8094b8639729ec39ca141fae7d4bd")
|
||||
(package! drag-stuff :pin "6d06d846cd37c052d79acd0f372c13006aa7e7c8")
|
||||
(package! link-hint :pin "7440704cacb5c0fab35fff8ec59d30fbea17f44a")
|
||||
|
||||
(unless (featurep! :editor evil)
|
||||
(package! expand-region :pin "ea6b4cbb99"))
|
||||
(package! expand-region :pin "ea6b4cbb9985ddae532bd2faf9bb00570c9f2781"))
|
||||
|
|
|
@ -98,7 +98,7 @@
|
|||
(evil-ex-define-cmd "tabsave" #'+workspace:save)
|
||||
|
||||
;;; Org-mode
|
||||
(evil-ex-define-cmd "cap" #'org-capture)
|
||||
(evil-ex-define-cmd "cap[ture]" #'org-capture)
|
||||
|
||||
;;; ibuffer
|
||||
(when (featurep! :emacs ibuffer)
|
||||
|
|
|
@ -71,6 +71,7 @@ The following vim plugins have been ported to evil:
|
|||
| vim-lion | evil-lion | omap =gl= / =gL= |
|
||||
| vim-seek or vim-sneak | evil-snipe | mmap =s= / =S=, omap =z= / =Z= & =x= / =X= |
|
||||
| vim-surround | evil-embrace and evil-surround | vmap =S=, omap =ys= |
|
||||
| vim-unimpaired | (provided by Doom) | [[https://github.com/hlissner/doom-emacs/blob/develop/modules/editor/evil/config.el#L413-L460][see the list]] |
|
||||
|
||||
This module has also ported vim-unimpaired keybinds to Emacs.
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
(call-interactively #'doom/escape)))
|
||||
|
||||
;;;###autoload
|
||||
(defun +evil-resolve-vim-path-a (file-name)
|
||||
(defun +evil-replace-filename-modifiers-a (file-name)
|
||||
"Take a path and resolve any vim-like filename modifiers in it. This adds
|
||||
support for most vim file modifiers, as well as:
|
||||
|
||||
|
@ -15,66 +15,65 @@ support for most vim file modifiers, as well as:
|
|||
|
||||
See http://vimdoc.sourceforge.net/htmldoc/cmdline.html#filename-modifiers for
|
||||
more information on modifiers."
|
||||
(let (case-fold-search)
|
||||
(let ((origin-buffer (current-buffer))
|
||||
case-fold-search)
|
||||
(with-temp-buffer
|
||||
(save-excursion (insert file-name))
|
||||
(while (re-search-forward "\\(^\\|[^\\\\]\\)\\(\\([%#]\\)\\(:\\([PphtreS~.]\\|g?s\\)\\)*\\)" nil t)
|
||||
(catch 'continue
|
||||
(unless buffer-file-name
|
||||
(replace-match (match-string 1) t t nil 2)
|
||||
(throw 'continue t))
|
||||
(let ((beg (match-beginning 2))
|
||||
(end (match-end 3))
|
||||
(path (pcase (match-string 3)
|
||||
("%" (file-relative-name buffer-file-name))
|
||||
("#" (and (other-buffer)
|
||||
(buffer-file-name (other-buffer)))))))
|
||||
(save-match-data
|
||||
(goto-char beg)
|
||||
(while (re-search-forward ":\\([PphtreS~.]\\|g?s\\)" (+ (point) 3) t)
|
||||
(let* ((modifier (match-string 1))
|
||||
(global (string-prefix-p "gs" modifier)))
|
||||
(when global
|
||||
(setq modifier (substring modifier 1)))
|
||||
(setq end (match-end 1)
|
||||
path
|
||||
(or (when path
|
||||
(pcase (substring modifier 0 1)
|
||||
("p" (expand-file-name path))
|
||||
("~" (concat "~/" (file-relative-name path "~")))
|
||||
("." (file-relative-name path default-directory))
|
||||
("t" (file-name-nondirectory (directory-file-name path)))
|
||||
("r" (file-name-sans-extension path))
|
||||
("e" (file-name-extension path))
|
||||
("S" (shell-quote-argument path))
|
||||
("h"
|
||||
(let ((parent (file-name-directory (expand-file-name path))))
|
||||
(unless (file-equal-p path parent)
|
||||
(if (file-name-absolute-p path)
|
||||
(directory-file-name parent)
|
||||
(file-relative-name parent)))))
|
||||
("s"
|
||||
(if (featurep 'evil)
|
||||
(when-let (args (evil-delimited-arguments (substring modifier 1) 2))
|
||||
(let ((pattern (evil-transform-vim-style-regexp (car args)))
|
||||
(replace (cadr args)))
|
||||
(replace-regexp-in-string
|
||||
(if global pattern (concat "\\(" pattern "\\).*\\'"))
|
||||
(evil-transform-vim-style-regexp replace) path t t
|
||||
(unless global 1))))
|
||||
path))
|
||||
("P"
|
||||
(let ((project-root (doom-project-root (file-name-directory (expand-file-name path)))))
|
||||
(unless project-root
|
||||
(user-error "Not in a project"))
|
||||
(abbreviate-file-name project-root)))))
|
||||
""))
|
||||
;; strip trailing slash, if applicable
|
||||
(or (string-empty-p path)
|
||||
(not (equal (substring path -1) "/"))
|
||||
(setq path (substring path 0 -1))))))
|
||||
(replace-match path t t nil 2))))
|
||||
(replace-regexp-in-string "\\\\\\([#%]\\)" "\\1" (buffer-string) t))))
|
||||
(let ((buffer-file-name (buffer-file-name origin-buffer)))
|
||||
(save-excursion (insert file-name))
|
||||
(while (re-search-forward "\\(^\\|[^\\\\]\\)\\(\\([%#]\\)\\(:\\([PphtreS~.]\\|g?s\\)\\)*\\)" nil t)
|
||||
(if (null buffer-file-name)
|
||||
(replace-match (match-string 1) t t nil 2)
|
||||
(let ((beg (match-beginning 2))
|
||||
(end (match-end 3))
|
||||
(path (pcase (match-string 3)
|
||||
("%" (file-relative-name buffer-file-name default-directory))
|
||||
("#" (and (other-buffer origin-buffer)
|
||||
(buffer-file-name (other-buffer origin-buffer)))))))
|
||||
(save-match-data
|
||||
(goto-char beg)
|
||||
(while (re-search-forward ":\\([PphtreS~.]\\|g?s\\)" (+ (point) 3) t)
|
||||
(let* ((modifier (match-string 1))
|
||||
(global (string-prefix-p "gs" modifier)))
|
||||
(when global
|
||||
(setq modifier (substring modifier 1)))
|
||||
(setq end (match-end 1)
|
||||
path
|
||||
(pcase (and path (substring modifier 0 1))
|
||||
(`nil "")
|
||||
("p" (expand-file-name path))
|
||||
("~" (concat "~/" (file-relative-name path "~")))
|
||||
("." (file-relative-name path))
|
||||
("t" (file-name-nondirectory (directory-file-name path)))
|
||||
("r" (file-name-sans-extension path))
|
||||
("e" (file-name-extension path))
|
||||
("S" (shell-quote-argument path))
|
||||
("h"
|
||||
(let ((parent (file-name-directory (expand-file-name path))))
|
||||
(unless (file-equal-p path parent)
|
||||
(if (file-name-absolute-p path)
|
||||
(directory-file-name parent)
|
||||
(file-relative-name parent)))))
|
||||
("s"
|
||||
(if (featurep 'evil)
|
||||
(when-let (args (evil-delimited-arguments (substring modifier 1) 2))
|
||||
(let ((pattern (evil-transform-vim-style-regexp (car args)))
|
||||
(replace (cadr args)))
|
||||
(replace-regexp-in-string
|
||||
(if global pattern (concat "\\(" pattern "\\).*\\'"))
|
||||
(evil-transform-vim-style-regexp replace) path t t
|
||||
(unless global 1))))
|
||||
path))
|
||||
("P"
|
||||
(let ((project-root (doom-project-root (file-name-directory (expand-file-name path)))))
|
||||
(unless project-root
|
||||
(user-error "Not in a project"))
|
||||
(abbreviate-file-name project-root)))))
|
||||
;; strip trailing slash, if applicable
|
||||
(or (string-empty-p path)
|
||||
(not (equal (substring path -1) "/"))
|
||||
(setq path (substring path 0 -1))))))
|
||||
(replace-match path t t nil 2))))
|
||||
(replace-regexp-in-string "\\\\\\([#%]\\)" "\\1" (buffer-string) t)))))
|
||||
|
||||
(defun +evil--insert-newline (&optional above _noextranewline)
|
||||
(let ((pos (save-excursion (beginning-of-line-text) (point)))
|
||||
|
@ -124,8 +123,7 @@ more information on modifiers."
|
|||
(not (eq this-command 'evil-open-below))
|
||||
(evil-insert-state-p))
|
||||
(funcall orig-fn count)
|
||||
(cl-letf (((symbol-function 'evil-insert-newline-below)
|
||||
(lambda () (+evil--insert-newline))))
|
||||
(letf! (defun evil-insert-newline-below () (+evil--insert-newline))
|
||||
(let ((evil-auto-indent evil-auto-indent))
|
||||
(funcall orig-fn count)))))
|
||||
|
||||
|
@ -135,8 +133,7 @@ more information on modifiers."
|
|||
(not (eq this-command 'evil-open-above))
|
||||
(evil-insert-state-p))
|
||||
(funcall orig-fn count)
|
||||
(cl-letf (((symbol-function 'evil-insert-newline-above)
|
||||
(lambda () (+evil--insert-newline 'above))))
|
||||
(letf! (defun evil-insert-newline-above () (+evil--insert-newline 'above))
|
||||
(let ((evil-auto-indent evil-auto-indent))
|
||||
(funcall orig-fn count)))))
|
||||
|
||||
|
|
|
@ -108,7 +108,7 @@ g Repeat alignment on all matches in each line"
|
|||
If BANG is non-nil, open compilation output in a comint buffer.
|
||||
|
||||
If BANG, then run ARGUMENTS as a full command. This command understands vim file
|
||||
modifiers (like %:p:h). See `+evil-resolve-vim-path-a' for details."
|
||||
modifiers (like %:p:h). See `+evil-replace-filename-modifiers-a' for details."
|
||||
(interactive "<sh><!>")
|
||||
(let ((compile-command "make"))
|
||||
(+evil:compile (if (stringp arguments)
|
||||
|
@ -122,7 +122,7 @@ modifiers (like %:p:h). See `+evil-resolve-vim-path-a' for details."
|
|||
If BANG is non-nil, open compilation output in a comint buffer.
|
||||
|
||||
This command understands vim file modifiers (like %:p:h). See
|
||||
`+evil-resolve-vim-path-a' for details."
|
||||
`+evil-replace-filename-modifiers-a' for details."
|
||||
(interactive "<sh><!>")
|
||||
(compile (evil-ex-replace-special-filenames
|
||||
(format "%s %s"
|
||||
|
|
|
@ -6,8 +6,7 @@
|
|||
kills the buffer. If FORCE-P, force the deletion (don't ask for confirmation)."
|
||||
:repeat nil
|
||||
(interactive "<f><!>")
|
||||
(doom/delete-this-file (or filename (file-truename buffer-file-name))
|
||||
force-p))
|
||||
(doom/delete-this-file filename force-p))
|
||||
|
||||
;;;###autoload (autoload '+evil:move-this-file "editor/evil/autoload/files" nil t)
|
||||
(evil-define-command +evil:move-this-file (new-path &optional force-p)
|
||||
|
@ -30,4 +29,3 @@ overwrite the destination file if it exists, without confirmation."
|
|||
(when (or (not new-path) (string-empty-p new-path))
|
||||
(user-error "No new path was specified"))
|
||||
(doom/copy-this-file new-path force-p))
|
||||
|
||||
|
|
|
@ -159,7 +159,7 @@ directives. By default, this only recognizes C directives.")
|
|||
;; monkey patch `evil-ex-replace-special-filenames' to improve support for
|
||||
;; file modifiers like %:p:h. This adds support for most of vim's modifiers,
|
||||
;; and one custom one: %:P (expand to the project root).
|
||||
(advice-add #'evil-ex-replace-special-filenames :override #'+evil-resolve-vim-path-a)
|
||||
(advice-add #'evil-ex-replace-special-filenames :override #'+evil-replace-filename-modifiers-a)
|
||||
|
||||
;; make `try-expand-dabbrev' (from `hippie-expand') work in minibuffer
|
||||
(add-hook 'minibuffer-inactive-mode-hook #'+evil--fix-dabbrev-in-minibuffer-h)
|
||||
|
@ -280,8 +280,13 @@ directives. By default, this only recognizes C directives.")
|
|||
evil-escape-delay 0.15)
|
||||
(evil-define-key* '(insert replace visual operator) 'global "\C-g" #'evil-escape)
|
||||
:config
|
||||
;; no `evil-escape' in minibuffer
|
||||
(add-hook 'evil-escape-inhibit-functions #'minibufferp)
|
||||
;; no `evil-escape' in minibuffer, unless `evil-collection-setup-minibuffer'
|
||||
;; is enabled, where we could be in insert mode in the minibuffer.
|
||||
(add-hook! 'evil-escape-inhibit-functions
|
||||
(defun +evil-inhibit-escape-in-minibuffer-fn ()
|
||||
(and (minibufferp)
|
||||
(or (not (bound-and-true-p evil-collection-setup-minibuffer))
|
||||
(evil-normal-state-p)))))
|
||||
;; so that evil-escape-mode-hook runs, and can be toggled by evil-mc
|
||||
(evil-escape-mode +1))
|
||||
|
||||
|
|
|
@ -258,6 +258,10 @@ and complains if a module is loaded too early (during startup)."
|
|||
(+evil-collection-init 'elisp-mode))
|
||||
(add-transient-hook! 'occur-mode
|
||||
(+evil-collection-init '(occur replace)))
|
||||
(add-transient-hook! 'minibuffer-setup-hook
|
||||
(when evil-collection-setup-minibuffer
|
||||
(+evil-collection-init 'minibuffer)
|
||||
(evil-collection-minibuffer-insert)))
|
||||
|
||||
;; HACK Do this ourselves because evil-collection break's `eval-after-load'
|
||||
;; load order by loading their target plugin before applying keys. This
|
||||
|
|
|
@ -1,27 +1,29 @@
|
|||
;; -*- no-byte-compile: t; -*-
|
||||
;;; editor/evil/packages.el
|
||||
|
||||
(package! evil :pin "8aa6337fa8")
|
||||
(package! evil-args :pin "758ad5ae54")
|
||||
(package! evil-easymotion :pin "79c13ed3bc")
|
||||
(package! evil-embrace :pin "4379adea03")
|
||||
(package! evil-escape :pin "f4e9116bfb")
|
||||
(package! evil-exchange :pin "3030e21ee1")
|
||||
(package! evil-indent-plus :pin "0c7501e6ef")
|
||||
(package! evil-lion :pin "6b03593f5d")
|
||||
(package! evil-nerd-commenter :pin "747e346f11")
|
||||
(package! evil :pin "d243eae8649272799ec3864fde14c1164f036940")
|
||||
(package! evil-args :pin "758ad5ae54ad34202064fec192c88151c08cb387")
|
||||
(package! evil-easymotion :pin "f96c2ed38ddc07908db7c3c11bcd6285a3e8c2e9")
|
||||
(package! evil-embrace :pin "4379adea032b25e359d01a36301b4a5afdd0d1b7")
|
||||
(package! evil-escape
|
||||
:recipe (:host github :repo "hlissner/evil-escape")
|
||||
:pin "819f1ee1cf3f69a1ae920e6004f2c0baeebbe077")
|
||||
(package! evil-exchange :pin "3030e21ee16a42dfce7f7cf86147b778b3f5d8c1")
|
||||
(package! evil-indent-plus :pin "0c7501e6efed661242c3a20e0a6c79a6455c2c40")
|
||||
(package! evil-lion :pin "6b03593f5dd6e7c9ca02207f9a73615cf94c93ab")
|
||||
(package! evil-nerd-commenter :pin "1bd2de52011c39777a3e8779b14cee2790dc873b")
|
||||
(package! evil-numbers
|
||||
:recipe (:host github :repo "janpath/evil-numbers")
|
||||
:pin "c2cfdd1eb1")
|
||||
(package! evil-snipe :pin "3ec8adfd49")
|
||||
(package! evil-surround :pin "9b0b17f06c")
|
||||
(package! evil-textobj-anyblock :pin "ff00980f06")
|
||||
(package! evil-traces :pin "bc25cae9fa")
|
||||
(package! evil-visualstar :pin "06c053d8f7")
|
||||
(package! exato :pin "d5daea3017")
|
||||
:pin "c2cfdd1eb1f193bea28ee79b191b78309677058a")
|
||||
(package! evil-snipe :pin "2ba6353bb9253dbbc4193f1d35403e7dcc1317b1")
|
||||
(package! evil-surround :pin "9b0b17f06cef9bac81ee4800d121265e54718a17")
|
||||
(package! evil-textobj-anyblock :pin "ff00980f0634f95bf2ad9956b615a155ea8743be")
|
||||
(package! evil-traces :pin "bc25cae9fa5ab0ba1507827f0944f52ce0ca7462")
|
||||
(package! evil-visualstar :pin "06c053d8f7381f91c53311b1234872ca96ced752")
|
||||
(package! exato :pin "d5daea30176d48e74c9d063ac9bfc240ebeb97d0")
|
||||
(package! evil-quick-diff
|
||||
:recipe (:host github :repo "rgrinberg/evil-quick-diff")
|
||||
:pin "69c883720b")
|
||||
:pin "69c883720b30a892c63bc89f49d4f0e8b8028908")
|
||||
|
||||
;;
|
||||
(when (featurep! +everywhere)
|
||||
|
@ -31,4 +33,4 @@
|
|||
(package! neotree)
|
||||
(autoload 'neotree-make-executor "neotree" nil nil 'macro))
|
||||
|
||||
(package! evil-collection :pin "493d523c9b"))
|
||||
(package! evil-collection :pin "ba3630476b3927d9d2e3ec75308a28e3a5bd54a8"))
|
||||
|
|
|
@ -9,10 +9,10 @@
|
|||
(load! "../autoload/evil")
|
||||
|
||||
(before-each
|
||||
(fset 'resv #'+evil-resolve-vim-path-a)
|
||||
(fset 'resv #'+evil-replace-filename-modifiers-a)
|
||||
(spy-on 'doom-project-root :and-call-fake (lambda () project-root)))
|
||||
|
||||
;; `evil-ex-replace-special-filenames' / `+evil-resolve-vim-path-a'
|
||||
;; `evil-ex-replace-special-filenames' / `+evil-replace-filename-modifiers-a'
|
||||
(describe "file modifiers"
|
||||
(it "supports basic vim file modifiers"
|
||||
(let ((buffer-file-name "~/.emacs.d/test/modules/feature/test-evil.el")
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
;; -*- no-byte-compile: t; -*-
|
||||
;;; editor/file-templates/packages.el
|
||||
|
||||
(package! yasnippet :pin "ac03c2f192")
|
||||
(package! yasnippet :pin "5b1217ab085fab4abeb1118dccb260691b446703")
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
(match-string 2 buffer-file-name))
|
||||
"")`}
|
||||
#+DATE: `(format (format-time-string "%B %%s, %Y") (string-to-number (format-time-string "%d")))`
|
||||
#+SINCE: ${2:{replace with next tagged release version}}
|
||||
#+SINCE: ${2:<replace with next tagged release version>}
|
||||
#+STARTUP: inlineimages nofold
|
||||
|
||||
* Table of Contents :TOC_3:noexport:
|
||||
|
|
|
@ -3,6 +3,6 @@
|
|||
|
||||
(package! hideshow :built-in t)
|
||||
|
||||
(package! vimish-fold :pin "d3248a41a7")
|
||||
(package! vimish-fold :pin "63685239655a151181b9152e45478dad587f86f2")
|
||||
(when (featurep! :editor evil)
|
||||
(package! evil-vimish-fold :pin "b6e0e6b91b"))
|
||||
(package! evil-vimish-fold :pin "b6e0e6b91b8cd047e80debef1a536d9d49eef31a"))
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
;; -*- no-byte-compile: t; -*-
|
||||
;;; editor/god/packages.el
|
||||
|
||||
(package! god-mode :pin "1eb6ef3a4f")
|
||||
(package! god-mode :pin "1eb6ef3a4f67a805c5d6deb1e3895b6c853707d7")
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
;; -*- no-byte-compile: t; -*-
|
||||
;;; editor/lispyville/packages.el
|
||||
|
||||
(package! lispy :pin "c7e282ae06")
|
||||
(package! lispy :pin "cdaa9c70ca39a880163cbbce924bb46cc56b9fa4")
|
||||
(when (featurep! :editor evil)
|
||||
(package! lispyville :pin "25a70126ea"))
|
||||
(package! lispyville :pin "25a70126ea807653e0a8c512d4128c90ed673d7a"))
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
(cond
|
||||
((featurep! :editor evil)
|
||||
(package! evil-multiedit :pin "9f271e0e60")
|
||||
(package! evil-mc :pin "4d4c0172e4"))
|
||||
(package! evil-multiedit :pin "9f271e0e6048297692f80ed6c5ae8994ac523abc")
|
||||
(package! evil-mc :pin "4d4c0172e4c7f80acc1d0e73d5fb3e536929b262"))
|
||||
|
||||
((package! multiple-cursors :pin "b880554d04")))
|
||||
((package! multiple-cursors :pin "b880554d04b8f61165afba7d4de19ac9e39bb7ab")))
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
;; -*- no-byte-compile: t; -*-
|
||||
;;; editor/objed/packages.el
|
||||
|
||||
(package! objed :pin "8dc17701d1")
|
||||
(package! objed :pin "e89d8dae3b2d4331a4455d2a7b203500537d184d")
|
||||
|
|
|
@ -11,4 +11,4 @@
|
|||
;; separate session:
|
||||
(autoload 'evil-define-key "evil-core" nil nil 'macro))
|
||||
|
||||
(package! parinfer :pin "eaad857ae4")
|
||||
(package! parinfer :pin "eaad857ae4351f72a561ee3dec8943713510003f")
|
||||
|
|
|
@ -3,4 +3,4 @@
|
|||
|
||||
(package! rotate-text
|
||||
:recipe (:host github :repo "debug-ito/rotate-text.el")
|
||||
:pin "48f193697d")
|
||||
:pin "48f193697db996855aee1ad2bc99b38c6646fe76")
|
||||
|
|
|
@ -20,8 +20,7 @@
|
|||
;; Remove default ~/.emacs.d/snippets
|
||||
(defvar yas-snippet-dirs nil)
|
||||
|
||||
(if (daemonp)
|
||||
(after! yasnippet (yas-reload-all))
|
||||
(unless (daemonp)
|
||||
;; Ensure `yas-reload-all' is called as late as possible. Other modules
|
||||
;; could have additional configuration for yasnippet. For example,
|
||||
;; file-templates.
|
||||
|
@ -88,7 +87,10 @@
|
|||
;; Replace commands with superior alternatives
|
||||
:map yas-minor-mode-map
|
||||
[remap yas-new-snippet] #'+snippets/new
|
||||
[remap yas-visit-snippet-file] #'+snippets/edit))
|
||||
[remap yas-visit-snippet-file] #'+snippets/edit)
|
||||
|
||||
;; If in a daemon session, front-load this expensive work:
|
||||
(if (daemonp) (yas-reload-all)))
|
||||
|
||||
|
||||
(use-package! auto-yasnippet
|
||||
|
@ -100,6 +102,6 @@
|
|||
us who use yas-minor-mode and enable yasnippet more selectively. This advice
|
||||
swaps `yas-global-mode' with `yas-minor-mode'."
|
||||
:around '(aya-expand aya-open-line)
|
||||
(cl-letf (((symbol-function #'yas-global-mode) #'yas-minor-mode)
|
||||
(yas-global-mode yas-minor-mode))
|
||||
(letf! ((#'yas-global-mode #'yas-minor-mode)
|
||||
(yas-global-mode yas-minor-mode))
|
||||
(apply orig-fn args))))
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
;; -*- no-byte-compile: t; -*-
|
||||
;;; editor/snippets/packages.el
|
||||
|
||||
(package! yasnippet :pin "5b1217ab08")
|
||||
(package! auto-yasnippet :pin "db9e0dd433")
|
||||
(package! yasnippet :pin "5b1217ab085fab4abeb1118dccb260691b446703")
|
||||
(package! auto-yasnippet :pin "db9e0dd4335b2202cd5dac95bbbc87a1032d9bbe")
|
||||
(package! doom-snippets
|
||||
:recipe (:host github
|
||||
:repo "hlissner/doom-snippets"
|
||||
:files ("*.el" "*"))
|
||||
:pin "feaedeb550")
|
||||
:pin "422f683adfbec1b01fe00524690b64dc9e702ae0")
|
||||
|
|
|
@ -24,3 +24,7 @@ Otherwise no extra indentation will be used.")
|
|||
'(text-mode markdown-mode markdown-view-mode gfm-mode gfm-view-mode rst-mode
|
||||
latex-mode LaTeX-mode)
|
||||
"Major-modes where `+word-wrap-mode' should not provide extra indentation.")
|
||||
|
||||
(when (memq 'visual-line-mode text-mode-hook)
|
||||
(remove-hook 'text-mode-hook #'visual-line-mode)
|
||||
(add-hook 'text-mode-hook #'+word-wrap-mode))
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
;; -*- no-byte-compile: t; -*-
|
||||
;;; editor/word-wrap/packages.el
|
||||
|
||||
(package! adaptive-wrap :pin "1810c0ee8d")
|
||||
(package! adaptive-wrap :pin "1810c0ee8d827dd502ddeaae5bd759d4811fcbce")
|
||||
|
|
16
modules/emacs/dired/config.el
Executable file → Normal file
16
modules/emacs/dired/config.el
Executable file → Normal file
|
@ -31,20 +31,16 @@
|
|||
(setq insert-directory-program gls)
|
||||
;; BSD ls doesn't support --group-directories-first
|
||||
(setq args (delete "--group-directories-first" args))))
|
||||
(setq dired-listing-switches (string-join args " ")))
|
||||
(setq dired-listing-switches (string-join args " "))
|
||||
|
||||
(add-hook! 'dired-mode-hook
|
||||
(defun +dired-disable-gnu-ls-flags-in-tramp-buffers-h ()
|
||||
"Fix #1703: dired over TRAMP displays a blank screen.
|
||||
(add-hook! 'dired-mode-hook
|
||||
(defun +dired-disable-gnu-ls-flags-in-tramp-buffers-h ()
|
||||
"Fix #1703: dired over TRAMP displays a blank screen.
|
||||
|
||||
This is because there's no guarantee the remote system has GNU ls, which is the
|
||||
only variant that supports --group-directories-first."
|
||||
(when (file-remote-p default-directory)
|
||||
(setq-local dired-listing-switches
|
||||
(string-join
|
||||
(split-string dired-listing-switches
|
||||
"--group-directories-first")
|
||||
" ")))))
|
||||
(when (file-remote-p default-directory)
|
||||
(setq-local dired-listing-switches (car args))))))
|
||||
|
||||
;; Don't complain about this command being disabled when we use it
|
||||
(put 'dired-find-alternate-file 'disabled nil)
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
;; -*- no-byte-compile: t; -*-
|
||||
;;; emacs/dired/packages.el
|
||||
|
||||
(package! diredfl :pin "83567d00af")
|
||||
(package! dired-git-info :pin "b47f2b0c3a")
|
||||
(package! diff-hl :pin "2cf8b489f3")
|
||||
(package! dired-rsync :pin "bfd5c155be")
|
||||
(package! diredfl :pin "83567d00affce66a4e501563eddd0bd436ac48d0")
|
||||
(package! dired-git-info :pin "b47f2b0c3a6cb9b7a62a4ee2605a492e512d40a9")
|
||||
(package! diff-hl :pin "a625033fb1dde83f6e4c2fc21f632b22ec34b609")
|
||||
(package! dired-rsync :pin "bfd5c155be1cb6b71c83e5f41116c81b6532b6d5")
|
||||
(when (featurep! +ranger)
|
||||
(package! ranger :pin "af6f781a60"))
|
||||
(package! ranger :pin "ae9b3816a6da927cca5beb62c45400103797a2da"))
|
||||
(when (featurep! +icons)
|
||||
(package! all-the-icons-dired :pin "816987d339"))
|
||||
(package! fd-dired :pin "fd4c3f490b")
|
||||
(package! all-the-icons-dired :pin "fc2dfa1e9eb8bf1c402a675e7089638d702a27a5"))
|
||||
(package! fd-dired :pin "001cc95effdd5c4d9974b3f2c40b2ddf1f0e3de2")
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
;; -*- no-byte-compile: t; -*-
|
||||
;;; emacs/ibuffer/packages.el
|
||||
|
||||
(package! ibuffer-projectile :pin "504b0edaa0")
|
||||
(package! ibuffer-vc :pin "1249c1e30c")
|
||||
(package! ibuffer-projectile :pin "504b0edaa0d937ce60ccc8fdf09f2dae0a90fbaf")
|
||||
(package! ibuffer-vc :pin "1249c1e30cf11badfe032ac3b1058f24ba510ace")
|
||||
|
|
|
@ -2,6 +2,6 @@
|
|||
;;; emacs/undo/packages.el
|
||||
|
||||
(if (featurep! +tree)
|
||||
(package! undo-tree :pin "5b6df03781")
|
||||
(package! undo-fu :pin "0c34b6747e")
|
||||
(package! undo-fu-session :pin "b808ef0cdc"))
|
||||
(package! undo-tree :pin "5b6df03781495d8a25695d846b0cce496d3d3058")
|
||||
(package! undo-fu :pin "0ce9ac36144e80316fff50bfe1bc5dd7e5e7ded6")
|
||||
(package! undo-fu-session :pin "b808ef0cdcdd2eef221c67eda567eed7fcb3d4af"))
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
(package! vc-annotate :built-in t)
|
||||
(package! smerge-mode :built-in t)
|
||||
|
||||
(package! browse-at-remote :pin "6aecae4b5d")
|
||||
(package! git-timemachine :pin "391eb61050")
|
||||
(package! gitconfig-mode :pin "55468314a5")
|
||||
(package! gitignore-mode :pin "55468314a5")
|
||||
(package! browse-at-remote :pin "6aecae4b5d202e582425fc8aa2c9c2b6a4779f25")
|
||||
(package! git-timemachine :pin "391eb61050de321101e631fcf373fc70ec6e7700")
|
||||
(package! gitconfig-mode :pin "55468314a5f6b77d2c96be62c7005ac94545e217")
|
||||
(package! gitignore-mode :pin "55468314a5f6b77d2c96be62c7005ac94545e217")
|
||||
|
|
|
@ -12,11 +12,12 @@
|
|||
- [[#arch-linux][Arch Linux]]
|
||||
- [[#nixos][NixOS]]
|
||||
- [[#opensuse][openSUSE]]
|
||||
- [[Debian/Ubuntu]]
|
||||
- [[#debianubuntu][Debian/Ubuntu]]
|
||||
- [[#features][Features]]
|
||||
- [[#configuration][Configuration]]
|
||||
- [[#offlineimap][offlineimap]]
|
||||
- [[#mbsync][mbsync]]
|
||||
- [[#mu-and-mu4e][mu and mu4e]]
|
||||
- [[#troubleshooting][Troubleshooting]]
|
||||
- [[#no-such-file-or-directory-mu4e][=No such file or directory, mu4e=]]
|
||||
- [[#void-function-org-time-add-error-on-gentoo][~(void-function org-time-add)~ error on Gentoo]]
|
||||
|
@ -37,13 +38,13 @@ via IMAP) and ~mu~ (to index my mail into a format ~mu4e~ can understand).
|
|||
+ ~+gmail~ Enables gmail-specific configuration.
|
||||
|
||||
** Plugins
|
||||
+ [[https://github.com/agpchil/mu4e-maildirs-extension][mu4e-maildirs-extension]]
|
||||
This module install no plugins.
|
||||
|
||||
* Prerequisites
|
||||
This module requires:
|
||||
|
||||
+ Either ~mbsync~ (default) or ~offlineimap~ (to sync mail with)
|
||||
+ ~mu~ (to index your downloaded messages)
|
||||
+ ~mu~, to index your downloaded messages and to provide the ~mu4e~ package.
|
||||
|
||||
** MacOS
|
||||
#+BEGIN_SRC sh
|
||||
|
@ -105,20 +106,53 @@ sudo apt-get install maildir-utils # mu
|
|||
|
||||
* Configuration
|
||||
** offlineimap
|
||||
This module uses =mbsync= by default. To change this, change ~+mu4e-backend~:
|
||||
This module uses =mbsync= by default. To use =offlineimap=, change ~+mu4e-backend~:
|
||||
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(setq +mu4e-backend 'offlineimap)
|
||||
#+END_SRC
|
||||
|
||||
Then you must set up offlineimap and index your mail:
|
||||
Next, you need to write a configuration file for =offlineimap=. Mine can be found
|
||||
[[https://github.com/hlissner/dotfiles/tree/master/shell/mu][in my dotfiles repository]]. It is configured to download mail to ~\~/.mail~. I
|
||||
use [[https://www.passwordstore.org/][unix pass]] to securely store my login credentials. You can find a *very*
|
||||
detailed configuration [[https://github.com/OfflineIMAP/offlineimap/blob/master/offlineimap.conf][here]].
|
||||
|
||||
1. Write a ~\~/.offlineimaprc~. Mine can be found [[https://github.com/hlissner/dotfiles/tree/master/shell/mu][in my dotfiles repository]]. It
|
||||
is configured to download mail to ~\~/.mail~. I use [[https://www.passwordstore.org/][unix pass]] to securely
|
||||
store my login credentials. You can find a *very* detailed configuration
|
||||
[[https://github.com/OfflineIMAP/offlineimap/blob/master/offlineimap.conf][here]].
|
||||
2. Download your email: ~offlineimap -o~ (may take a while)
|
||||
3. Index it with mu: ~mu index --maildir ~/.mail~
|
||||
Next you can download your email with ~offlineimap -o~. This may take a while,
|
||||
especially if you have thousands of mails.
|
||||
|
||||
You can now proceed with the [[*mu and mu4e][mu and mu4e]] section.
|
||||
|
||||
** mbsync
|
||||
The steps needed to set up =mu4e= with =mbsync= are very similar to the ones for
|
||||
[[*offlineimap][offlineimap]].
|
||||
|
||||
Start with writing a ~\~/.mbsyncrc~. An example for GMAIL can be found on
|
||||
[[http://pragmaticemacs.com/emacs/migrating-from-offlineimap-to-mbsync-for-mu4e/][pragmaticemacs.com]]. A non-GMAIL example is available as a gist [[https://gist.github.com/agraul/60977cc497c3aec44e10591f94f49ef0][here]]. The [[http://isync.sourceforge.net/mbsync.html][manual
|
||||
page]] contains all needed information to set up your own.
|
||||
|
||||
Next you can download your email with ~mbsync --all~. This may take a while, but
|
||||
should be quicker than =offlineimap= ;).
|
||||
|
||||
You can now proceed with the [[*mu and mu4e][mu and mu4e]] section.
|
||||
|
||||
** mu and mu4e
|
||||
You should have your email downloaded already. If you have not, you need to set
|
||||
=offlineimap= or =mbsync= up before you proceed.
|
||||
|
||||
Before you can use =mu4e= or the cli program =mu=, you need to index your email
|
||||
initially. How to do that differs a little depending on the version of =mu= you
|
||||
use. You can check your version with ~mu --version~.
|
||||
|
||||
For =mu= *>=1.4* you need to run two commands:
|
||||
#+BEGIN_SRC sh
|
||||
mu init --maildir ~/.mail --my-address email@example.com
|
||||
mu index
|
||||
#+END_SRC
|
||||
|
||||
=mu= *<1.4* only requires one command:
|
||||
#+BEGIN_SRC sh
|
||||
mu index --maildir ~/.mail
|
||||
#+END_SRC
|
||||
|
||||
Then configure Emacs to use your email address:
|
||||
|
||||
|
@ -130,12 +164,11 @@ Then configure Emacs to use your email address:
|
|||
(mu4e-trash-folder . "/Lissner.net/Trash")
|
||||
(mu4e-refile-folder . "/Lissner.net/All Mail")
|
||||
(smtpmail-smtp-user . "henrik@lissner.net")
|
||||
(user-mail-address . "henrik@lissner.net")
|
||||
(user-mail-address . "henrik@lissner.net") ;; only needed for mu < 1.4
|
||||
(mu4e-compose-signature . "---\nHenrik Lissner"))
|
||||
t)
|
||||
#+END_SRC
|
||||
|
||||
** TODO mbsync
|
||||
* Troubleshooting
|
||||
** =No such file or directory, mu4e=
|
||||
You will get =No such file or directory, mu4e= errors if you don't run ~doom
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
list of cons cells (VARIABLE . VALUE) -- you may want to modify:
|
||||
|
||||
+ `user-full-name' (this or the global `user-full-name' is required)
|
||||
+ `user-mail-address' (required)
|
||||
+ `user-mail-address' (required in mu4e < 1.4)
|
||||
+ `smtpmail-smtp-user' (required for sending mail from Emacs)
|
||||
|
||||
OPTIONAL:
|
||||
|
@ -19,8 +19,9 @@ OPTIONAL:
|
|||
DEFAULT-P is a boolean. If non-nil, it marks that email account as the
|
||||
default/fallback account."
|
||||
(after! mu4e
|
||||
(when-let (address (cdr (assq 'user-mail-address letvars)))
|
||||
(add-to-list 'mu4e-user-mail-address-list address))
|
||||
(when (version< mu4e-mu-version "1.4")
|
||||
(when-let (address (cdr (assq 'user-mail-address letvars)))
|
||||
(add-to-list 'mu4e-user-mail-address-list address)))
|
||||
(setq mu4e-contexts
|
||||
(cl-loop for context in mu4e-contexts
|
||||
unless (string= (mu4e-context-name context) label)
|
||||
|
|
|
@ -14,9 +14,11 @@
|
|||
:commands mu4e mu4e-compose-new
|
||||
:init
|
||||
(provide 'html2text) ; disable obsolete package
|
||||
(setq mu4e-maildir "~/.mail"
|
||||
mu4e-attachment-dir "~/.mail/.attachments"
|
||||
mu4e-user-mail-address-list nil)
|
||||
(when (or (not (require 'mu4e-meta nil t))
|
||||
(version< mu4e-mu-version "1.4"))
|
||||
(setq mu4e-maildir "~/.mail"
|
||||
mu4e-user-mail-address-list nil))
|
||||
(setq mu4e-attachment-dir "~/.mail/.attachments")
|
||||
:config
|
||||
(pcase +mu4e-backend
|
||||
(`mbsync
|
||||
|
@ -90,6 +92,9 @@
|
|||
;; Wrap text in messages
|
||||
(setq-hook! 'mu4e-view-mode-hook truncate-lines nil)
|
||||
|
||||
;; Html mails might be better rendered in a browser
|
||||
(add-to-list 'mu4e-view-actions '("View in browser" . mu4e-action-view-in-browser))
|
||||
|
||||
(when (fboundp 'imagemagick-register-types)
|
||||
(imagemagick-register-types))
|
||||
|
||||
|
@ -104,13 +109,13 @@
|
|||
(use-package! org-mu4e
|
||||
:hook (mu4e-compose-mode . org-mu4e-compose-org-mode)
|
||||
:config
|
||||
(setq org-mu4e-link-query-in-headers-mode nil
|
||||
org-mu4e-convert-to-html t)
|
||||
(setq org-mu4e-convert-to-html t)
|
||||
(when (version< mu4e-mu-version "1.4")
|
||||
(setq org-mu4e-link-query-in-headers-mode nil))
|
||||
|
||||
;; Only render to html once. If the first send fails for whatever reason,
|
||||
;; org-mu4e would do so each time you try again.
|
||||
(add-hook! 'message-send-hook
|
||||
(setq-local org-mu4e-convert-to-html nil)))
|
||||
(setq-hook! 'message-send-hook org-mu4e-convert-to-html nil))
|
||||
|
||||
|
||||
;;
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
;; -*- no-byte-compile: t; -*-
|
||||
;;; email/notmuch/packages.el
|
||||
|
||||
(package! notmuch :pin "aba7fb375b")
|
||||
(package! org-mime :pin "b189976217")
|
||||
(package! notmuch :pin "ad9c2e91a012920bebfe70bc472d44678abc3259")
|
||||
(package! org-mime :pin "9f8444603806e6baa94b2b67a23aab0ea52fef97")
|
||||
(when (featurep! :completion ivy)
|
||||
(package! counsel-notmuch :pin "a4a1562935"))
|
||||
(package! counsel-notmuch :pin "a4a1562935e4180c42524c51609d1283e9be0688"))
|
||||
(when (featurep! :completion helm)
|
||||
(package! helm-notmuch :pin "97a01497e0"))
|
||||
(package! helm-notmuch :pin "97a01497e079a7b6505987e9feba6b603bbec288"))
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
;; HACK These are wanderlust's dependencies (wanderlust depends on semi, semi
|
||||
;; depends on flim, flim on apel), but they all have non-standard default
|
||||
;; branches which straight cannot detect without our help.
|
||||
(package! apel :recipe (:branch "apel-wl") :pin "d146ddbf88")
|
||||
(package! flim :recipe (:branch "flim-1_14-wl") :pin "e4bd54fd7d")
|
||||
(package! semi :recipe (:branch "semi-1_14-wl") :pin "16228dc2d1")
|
||||
(package! apel :recipe (:branch "apel-wl") :pin "d146ddbf8818e81d3577d5eee7825d377bec0c73")
|
||||
(package! flim :recipe (:branch "flim-1_14-wl") :pin "f303f2f6c124bc8635add96d3326a2209749437b")
|
||||
(package! semi :recipe (:branch "semi-1_14-wl") :pin "57a948c5f07e57e78ab3c0e6fd76ffcd591bb4ac")
|
||||
|
||||
(package! wanderlust :pin "7a919e422a")
|
||||
(package! wanderlust :pin "7af0d582cd48a37469e0606ea35887740d78c8b5")
|
||||
|
|
|
@ -2,9 +2,10 @@
|
|||
|
||||
(use-package! pyim
|
||||
:after-call after-find-file pre-command-hook
|
||||
:init
|
||||
(setq pyim-dcache-directory (concat doom-cache-dir "pyim/"))
|
||||
:config
|
||||
(setq pyim-dcache-directory (concat doom-cache-dir "pyim/")
|
||||
pyim-page-tooltip t
|
||||
(setq pyim-page-tooltip t
|
||||
default-input-method "pyim"))
|
||||
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
;; -*- no-byte-compile: t; -*-
|
||||
;;; input/chinese/packages.el
|
||||
|
||||
(package! pyim :pin "77170724fa")
|
||||
(package! fcitx :pin "12dc2638dd")
|
||||
(package! ace-pinyin :pin "8b2e9335b0")
|
||||
(package! pangu-spacing :pin "f92898949b")
|
||||
(package! pyim :pin "b934273bb33d6be6aea6e20e68930bc5aaf4a48a")
|
||||
(package! fcitx :pin "12dc2638ddd15c8f6cfaecb20e1f428ab2bb5624")
|
||||
(package! ace-pinyin :pin "8b2e9335b02486730ea4ceee790130cc5328f9ea")
|
||||
(package! pangu-spacing :pin "f92898949ba3bf991fd229416f3bbb54e9c6c223")
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
;; -*- no-byte-compile: t; -*-
|
||||
;;; input/japanese/packages.el
|
||||
|
||||
(package! migemo :pin "f42832c8ac")
|
||||
(package! avy-migemo :pin "922a6dd82c")
|
||||
(package! ddskk :pin "f9a2333ec3")
|
||||
(package! pangu-spacing :pin "f92898949b")
|
||||
(package! migemo :pin "f42832c8ac462ecbec9a16eb781194f876fba64a")
|
||||
(package! avy-migemo :pin "922a6dd82c0bfa316b0fbb56a9d4dd4ffa5707e7")
|
||||
(package! ddskk :pin "11d91b4cce988e15d7c5fc4345535c9d7a92d53b")
|
||||
(package! pangu-spacing :pin "f92898949ba3bf991fd229416f3bbb54e9c6c223")
|
||||
|
|
|
@ -1,4 +0,0 @@
|
|||
;;; lang/assembly/autoload.el -*- lexical-binding: t; -*-
|
||||
|
||||
;;;###autoload
|
||||
(add-to-list 'auto-mode-alist '("\\.hax\\'" . haxor-mode))
|
|
@ -1,6 +0,0 @@
|
|||
;; -*- no-byte-compile: t; -*-
|
||||
;;; lang/assembly/packages.el
|
||||
|
||||
(package! mips-mode :pin "75152fc78b")
|
||||
(package! haxor-mode :pin "6fa25a8e6b")
|
||||
(package! nasm-mode :pin "65ca6546fc")
|
|
@ -11,21 +11,22 @@
|
|||
;;
|
||||
;;; Packages
|
||||
|
||||
;;;###package clojure-mode
|
||||
(add-hook 'clojure-mode-hook #'rainbow-delimiters-mode)
|
||||
(when (featurep! +lsp)
|
||||
(add-hook! '(clojure-mode-local-vars-hook
|
||||
clojurec-mode-local-vars-hook
|
||||
clojurescript-mode-local-vars-hook)
|
||||
(defun +clojure-disable-lsp-indentation-h ()
|
||||
(setq-local lsp-enable-indentation nil))
|
||||
#'lsp!)
|
||||
(after! lsp-clojure
|
||||
(dolist (m '(clojure-mode
|
||||
clojurec-mode
|
||||
clojurescript-mode
|
||||
clojurex-mode))
|
||||
(add-to-list 'lsp-language-id-configuration (cons m "clojure")))))
|
||||
(use-package! clojure-mode
|
||||
:hook (clojure-mode . rainbow-delimiters-mode)
|
||||
:config
|
||||
(when (featurep! +lsp)
|
||||
(add-hook! '(clojure-mode-local-vars-hook
|
||||
clojurec-mode-local-vars-hook
|
||||
clojurescript-mode-local-vars-hook)
|
||||
(defun +clojure-disable-lsp-indentation-h ()
|
||||
(setq-local lsp-enable-indentation nil))
|
||||
#'lsp!)
|
||||
(after! lsp-clojure
|
||||
(dolist (m '(clojure-mode
|
||||
clojurec-mode
|
||||
clojurescript-mode
|
||||
clojurex-mode))
|
||||
(add-to-list 'lsp-language-id-configuration (cons m "clojure"))))))
|
||||
|
||||
|
||||
(use-package! cider
|
||||
|
@ -58,13 +59,18 @@
|
|||
cider-repl-history-quit-action 'delete-and-restore
|
||||
cider-repl-history-highlight-inserted-item t
|
||||
cider-repl-history-size 1000
|
||||
cider-repl-pop-to-buffer-on-connect 'display-only
|
||||
cider-repl-result-prefix ";; => "
|
||||
cider-repl-print-length 100
|
||||
cider-repl-use-clojure-font-lock t
|
||||
cider-repl-use-pretty-printing t
|
||||
cider-repl-wrap-history nil
|
||||
cider-stacktrace-default-filters '(tooling dup))
|
||||
cider-stacktrace-default-filters '(tooling dup)
|
||||
|
||||
;; Don't focus the CIDER REPL when it starts. Since it can take so long
|
||||
;; to start up, you either wait for a minute doing nothing or be
|
||||
;; prepared for your cursor to suddenly change buffers without warning.
|
||||
;; See https://github.com/clojure-emacs/cider/issues/1872
|
||||
cider-repl-pop-to-buffer-on-connect 'display-only)
|
||||
|
||||
;; Error messages emitted from CIDER is silently funneled into *nrepl-server*
|
||||
;; rather than the *cider-repl* buffer. How silly. We might want to see that
|
||||
|
|
|
@ -73,26 +73,36 @@
|
|||
((message "WARNING: Couldn't find `inferior-lisp-program' (%s)"
|
||||
inferior-lisp-program)))))
|
||||
|
||||
(map! :localleader
|
||||
:map lisp-mode-map
|
||||
:desc "Sly" "'" #'sly
|
||||
:desc "Sly (ask)" ";" (λ!! #'sly '-)
|
||||
:desc "Expand macro" "m" #'macrostep-expand
|
||||
(:prefix ("c" . "compile")
|
||||
(map! (:map sly-db-mode-map
|
||||
:n "gr" #'sly-db-restart-frame)
|
||||
(:map sly-inspector-mode-map
|
||||
:n "gr" #'sly-inspector-reinspect
|
||||
:n "gR" #'sly-inspector-fetch-all
|
||||
:n "K" #'sly-inspector-describe-inspectee)
|
||||
(:map sly-xref-mode-map
|
||||
:n "gr" #'sly-recompile-xref
|
||||
:n "gR" #'sly-recompile-all-xrefs)
|
||||
|
||||
(:localleader
|
||||
:map lisp-mode-map
|
||||
:desc "Sly" "'" #'sly
|
||||
:desc "Sly (ask)" ";" (λ!! #'sly '-)
|
||||
:desc "Expand macro" "m" #'macrostep-expand
|
||||
(:prefix ("c" . "compile")
|
||||
:desc "Compile file" "c" #'sly-compile-file
|
||||
:desc "Compile/load file" "C" #'sly-compile-and-load-file
|
||||
:desc "Compile toplevel form" "f" #'sly-compile-defun
|
||||
:desc "Load file" "l" #'sly-load-file
|
||||
:desc "Remove notes" "n" #'sly-remove-notes
|
||||
:desc "Compile region" "r" #'sly-compile-region)
|
||||
(:prefix ("e" . "evaluate")
|
||||
(:prefix ("e" . "evaluate")
|
||||
:desc "Evaulate buffer" "b" #'sly-eval-buffer
|
||||
:desc "Evaluate last" "e" #'sly-eval-last-expression
|
||||
:desc "Evaluate/print last" "E" #'sly-eval-print-last-expression
|
||||
:desc "Evaluate defun" "f" #'sly-eval-defun
|
||||
:desc "Undefine function" "F" #'sly-undefine-function
|
||||
:desc "Evaluate region" "r" #'sly-eval-region)
|
||||
(:prefix ("g" . "goto")
|
||||
(:prefix ("g" . "goto")
|
||||
:desc "Go back" "b" #'sly-pop-find-definition-stack
|
||||
:desc "Go to" "d" #'sly-edit-definition
|
||||
:desc "Go to (other window)" "D" #'sly-edit-definition-other-window
|
||||
|
@ -100,7 +110,7 @@
|
|||
:desc "Previous note" "N" #'sly-previous-note
|
||||
:desc "Next sticker" "s" #'sly-stickers-next-sticker
|
||||
:desc "Previous sticker" "S" #'sly-stickers-prev-sticker)
|
||||
(:prefix ("h" . "help")
|
||||
(:prefix ("h" . "help")
|
||||
:desc "Who calls" "<" #'sly-who-calls
|
||||
:desc "Calls who" ">" #'sly-calls-who
|
||||
:desc "Lookup format directive" "~" #'hyperspec-lookup-format
|
||||
|
@ -115,22 +125,22 @@
|
|||
:desc "Who references" "r" #'sly-who-references
|
||||
:desc "Who specializes" "s" #'sly-who-specializes
|
||||
:desc "Who sets" "S" #'sly-who-sets)
|
||||
(:prefix ("r" . "repl")
|
||||
(:prefix ("r" . "repl")
|
||||
:desc "Clear REPL" "c" #'sly-mrepl-clear-repl
|
||||
:desc "Quit connection" "q" #'sly-quit-lisp
|
||||
:desc "Restart connection" "r" #'sly-restart-inferior-lisp
|
||||
:desc "Sync REPL" "s" #'sly-mrepl-sync)
|
||||
(:prefix ("s" . "stickers")
|
||||
(:prefix ("s" . "stickers")
|
||||
:desc "Toggle breaking stickers" "b" #'sly-stickers-toggle-break-on-stickers
|
||||
:desc "Clear defun stickers" "c" #'sly-stickers-clear-defun-stickers
|
||||
:desc "Clear buffer stickers" "C" #'sly-stickers-clear-buffer-stickers
|
||||
:desc "Fetch stickers" "f" #'sly-stickers-fetch
|
||||
:desc "Replay stickers" "r" #'sly-stickers-replay
|
||||
:desc "Add/remove sticker" "s" #'sly-stickers-dwim)
|
||||
(:prefix ("t" . "trace")
|
||||
(:prefix ("t" . "trace")
|
||||
:desc "Toggle" "t" #'sly-toggle-trace-fdefinition
|
||||
:desc "Toggle (fancy)" "T" #'sly-toggle-fancy-trace
|
||||
:desc "Untrace all" "u" #'sly-untrace-all))
|
||||
:desc "Untrace all" "u" #'sly-untrace-all)))
|
||||
|
||||
(when (featurep! :editor evil +everywhere)
|
||||
(add-hook 'sly-mode-hook #'evil-normalize-keymaps)))
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
(package! dart-mode :pin "04fcd649f1")
|
||||
|
||||
(when (featurep! +lsp)
|
||||
(package! lsp-dart :pin "064d47bad3"))
|
||||
(package! lsp-dart :pin "80f8ecaf62"))
|
||||
|
||||
(when (featurep! +flutter)
|
||||
(package! flutter :pin "ec92a4df84")
|
||||
(package! flutter :pin "293b7225b9")
|
||||
(package! hover :pin "6f9ed1a651"))
|
||||
|
|
|
@ -1,9 +1,5 @@
|
|||
;;; lang/data/config.el -*- lexical-binding: t; -*-
|
||||
|
||||
;; Built in plugins
|
||||
(add-to-list 'auto-mode-alist '("/sxhkdrc\\'" . conf-mode))
|
||||
(add-to-list 'auto-mode-alist '("\\.\\(?:hex\\|nes\\)\\'" . hexl-mode))
|
||||
|
||||
(use-package! nxml-mode
|
||||
:mode "\\.p\\(?:list\\|om\\)\\'" ; plist, pom
|
||||
:mode "\\.xs\\(?:d\\|lt\\)\\'" ; xslt, xsd
|
||||
|
@ -16,9 +12,6 @@
|
|||
(setq-hook! 'nxml-mode-hook tab-width nxml-child-indent))
|
||||
|
||||
|
||||
;;
|
||||
;;; Third-party plugins
|
||||
|
||||
;;;###package csv-mode
|
||||
(map! :after csv-mode
|
||||
:localleader
|
||||
|
@ -29,25 +22,3 @@
|
|||
"S" #'csv-sort-numeric-fields
|
||||
"k" #'csv-kill-fields
|
||||
"t" #'csv-transpose)
|
||||
|
||||
(use-package! graphql-mode
|
||||
:mode "\\.gql\\'"
|
||||
:config (setq-hook! 'graphql-mode-hook tab-width graphql-indent-level))
|
||||
|
||||
(use-package! json-mode
|
||||
:mode "\\.js\\(?:on\\|[hl]int\\(?:rc\\)?\\)\\'"
|
||||
:config
|
||||
(set-electric! 'json-mode :chars '(?\n ?: ?{ ?})))
|
||||
|
||||
(after! jsonnet-mode
|
||||
(set-electric! 'jsonnet-mode :chars '(?\n ?: ?{ ?})))
|
||||
|
||||
(after! yaml-mode
|
||||
(setq-hook! 'yaml-mode-hook tab-width yaml-indent-offset))
|
||||
|
||||
|
||||
;;
|
||||
;;; Frameworks
|
||||
|
||||
(def-project-mode! +data-vagrant-mode
|
||||
:files ("Vagrantfile"))
|
||||
|
|
|
@ -1,12 +1,4 @@
|
|||
;; -*- no-byte-compile: t; -*-
|
||||
;;; lang/data/packages.el
|
||||
|
||||
(package! graphql-mode :pin "7c37aee28b")
|
||||
(package! json-mode :pin "0e819e519a")
|
||||
(package! jsonnet-mode :pin "d8b486c837")
|
||||
(package! yaml-mode :pin "cecf4b106b")
|
||||
(package! csv-mode :pin "635337407c")
|
||||
(package! dhall-mode :pin "ef4d33debe")
|
||||
(package! protobuf-mode
|
||||
:recipe (:host github :repo "emacsmirror/protobuf-mode" :files (:defaults "*"))
|
||||
:pin "94b7bd7e8b")
|
||||
|
|
|
@ -1,12 +1,10 @@
|
|||
;;; lang/elm/config.el -*- lexical-binding: t; -*-
|
||||
|
||||
(after! elm-mode
|
||||
(add-hook 'elm-mode-hook #'rainbow-delimiters-mode)
|
||||
|
||||
(when (featurep! +lsp)
|
||||
(add-hook 'elm-mode-local-vars-hook #'lsp!))
|
||||
|
||||
(set-company-backend! 'elm-mode 'company-elm)
|
||||
(if (featurep! +lsp)
|
||||
(add-hook 'elm-mode-local-vars-hook #'lsp!)
|
||||
(set-company-backend! 'elm-mode 'company-elm))
|
||||
|
||||
(set-repl-handler! 'elm-mode #'run-elm-interactive)
|
||||
(set-pretty-symbols! 'elm-mode
|
||||
:null "null"
|
||||
|
@ -22,4 +20,4 @@
|
|||
(use-package! flycheck-elm
|
||||
:when (featurep! :checkers syntax)
|
||||
:after elm-mode
|
||||
:config (add-to-list 'flycheck-checkers 'elm nil #'eq))
|
||||
:config (add-to-list 'flycheck-checkers 'elm))
|
||||
|
|
|
@ -221,6 +221,66 @@ verbosity when editing a file in `doom-private-dir' or `doom-emacs-dir'."
|
|||
(default-value 'flycheck-emacs-lisp-check-form)
|
||||
")"))))
|
||||
|
||||
;;;###autoload
|
||||
(defun +emacs-lisp-truncate-pin ()
|
||||
"Truncates long SHA1 hashes in `package!' :pin's."
|
||||
(save-excursion
|
||||
(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))
|
||||
(finish (and (re-search-forward "\"" (line-end-position) t)
|
||||
(match-beginning 0))))
|
||||
(when (and start finish)
|
||||
(put-text-property start finish 'display "...")))))
|
||||
nil)
|
||||
|
||||
;;;###autoload
|
||||
(defun +emacs-lisp-indent-function (indent-point state)
|
||||
"A replacement for `lisp-indent-function'.
|
||||
|
||||
Indents plists more sensibly. Adapted from
|
||||
https://emacs.stackexchange.com/questions/10230/how-to-indent-keywords-aligned"
|
||||
(let ((normal-indent (current-column))
|
||||
(orig-point (point))
|
||||
;; TODO Refactor `target' usage (ew!)
|
||||
target)
|
||||
(goto-char (1+ (elt state 1)))
|
||||
(parse-partial-sexp (point) calculate-lisp-indent-last-sexp 0 t)
|
||||
(cond ((and (elt state 2)
|
||||
(or (not (looking-at-p "\\sw\\|\\s_"))
|
||||
(eq (char-after) ?:)))
|
||||
(unless (> (save-excursion (forward-line 1) (point))
|
||||
calculate-lisp-indent-last-sexp)
|
||||
(goto-char calculate-lisp-indent-last-sexp)
|
||||
(beginning-of-line)
|
||||
(parse-partial-sexp (point) calculate-lisp-indent-last-sexp 0 t))
|
||||
(backward-prefix-chars)
|
||||
(current-column))
|
||||
((and (save-excursion
|
||||
(goto-char indent-point)
|
||||
(skip-syntax-forward " ")
|
||||
(not (eq (char-after) ?:)))
|
||||
(save-excursion
|
||||
(goto-char orig-point)
|
||||
(and (eq (char-after) ?:)
|
||||
(setq target (current-column)))))
|
||||
(save-excursion
|
||||
(move-to-column target t)
|
||||
target))
|
||||
((let* ((function (buffer-substring (point) (progn (forward-sexp 1) (point))))
|
||||
(method (or (function-get (intern-soft function) 'lisp-indent-function)
|
||||
(get (intern-soft function) 'lisp-indent-hook))))
|
||||
(cond ((or (eq method 'defun)
|
||||
(and (null method)
|
||||
(> (length function) 3)
|
||||
(string-match-p "\\`def" function)))
|
||||
(lisp-indent-defform state indent-point))
|
||||
((integerp method)
|
||||
(lisp-indent-specform method state indent-point normal-indent))
|
||||
(method
|
||||
(funcall method indent-point state))))))))
|
||||
|
||||
;;;###autoload
|
||||
(defun +emacs-lisp/edebug-instrument-defun-on ()
|
||||
"Toggle on instrumentalisation for the function under `defun'."
|
||||
|
|
|
@ -43,7 +43,9 @@ This marks a foldable marker for `outline-minor-mode' in elisp buffers.")
|
|||
mode-name "Elisp"
|
||||
;; Don't treat autoloads or sexp openers as outline headers, we have
|
||||
;; hideshow for that.
|
||||
outline-regexp +emacs-lisp-outline-regexp)
|
||||
outline-regexp +emacs-lisp-outline-regexp
|
||||
;; Fixed indenter that intends plists sensibly.
|
||||
lisp-indent-function #'+emacs-lisp-indent-function)
|
||||
|
||||
;; variable-width indentation is superior in elisp
|
||||
(add-to-list 'doom-detect-indentation-excluded-modes 'emacs-lisp-mode nil #'eq)
|
||||
|
@ -75,7 +77,9 @@ This marks a foldable marker for `outline-minor-mode' in elisp buffers.")
|
|||
("^;;;###\\(autodef\\|if\\|package\\)[ \n]" (1 font-lock-warning-face t)))
|
||||
;; highlight defined, special variables & functions
|
||||
(when +emacs-lisp-enable-extra-fontification
|
||||
`((+emacs-lisp-highlight-vars-and-faces . +emacs-lisp--face)))))
|
||||
`((+emacs-lisp-highlight-vars-and-faces . +emacs-lisp--face)))
|
||||
|
||||
`(("(package!\\_>" (0 (+emacs-lisp-truncate-pin))))))
|
||||
|
||||
;; Recenter window after following definition
|
||||
(advice-add #'elisp-def :after #'doom-recenter-a)
|
||||
|
|
|
@ -4,6 +4,8 @@
|
|||
(package! elisp-mode :built-in t)
|
||||
|
||||
(package! highlight-quoted :pin "2410347815")
|
||||
|
||||
;; Tools
|
||||
(package! macrostep :pin "424e3734a1")
|
||||
(package! overseer :pin "02d49f582e")
|
||||
(package! elisp-def :pin "368b04da68")
|
||||
|
@ -11,4 +13,5 @@
|
|||
(when (featurep! :checkers syntax)
|
||||
(package! flycheck-cask :pin "3457ae553c"))
|
||||
|
||||
;; Libraries
|
||||
(package! buttercup :pin "a91f282025")
|
||||
|
|
114
modules/lang/java/README.org
Normal file
114
modules/lang/java/README.org
Normal file
|
@ -0,0 +1,114 @@
|
|||
#+TITLE: lang/java
|
||||
#+DATE: January 16, 2017
|
||||
#+SINCE: v1.3
|
||||
#+STARTUP: inlineimages
|
||||
|
||||
* Table of Contents :TOC_3:noexport:
|
||||
- [[#description][Description]]
|
||||
- [[#module-flags][Module Flags]]
|
||||
- [[#prerequisites][Prerequisites]]
|
||||
- [[#openjdk-11][OpenJDK 11]]
|
||||
- [[#ubuntu][Ubuntu]]
|
||||
- [[#fedora][Fedora]]
|
||||
- [[#oracle-jdk-11][Oracle JDK 11]]
|
||||
- [[#ubuntu-1][Ubuntu]]
|
||||
- [[#fedora-1][Fedora]]
|
||||
- [[#features][Features]]
|
||||
- [[#lsp-features][=+lsp= features]]
|
||||
- [[#meghanada-features][=+meghanada= features]]
|
||||
- [[#configuration][Configuration]]
|
||||
|
||||
* Description
|
||||
This module adds [[https://www.java.com][java]] support to Doom Emacs, including =android-mode= and
|
||||
=groovy-mode=.
|
||||
|
||||
** Module Flags
|
||||
+ =+lsp= Enables integration for the eclipse.jdt.ls LSP server.
|
||||
+ =+meghanada= Enables the [[https://github.com/mopemope/meghanada-emacs/tree/master][meghanada-mode]]
|
||||
|
||||
The =+lsp= and =+meghanada= packages are mutually exclusive and do not work
|
||||
together. At the time of writing the =+meghanada= is already configured whereas
|
||||
=+lsp= needs to manual configuring.
|
||||
|
||||
* Prerequisites
|
||||
This module requires the Java SDK.
|
||||
|
||||
** OpenJDK 11
|
||||
*** Ubuntu
|
||||
#+BEGIN_SRC sh
|
||||
sudo apt-get install openjdk-11-jdk-headless
|
||||
#+END_SRC
|
||||
*** Fedora
|
||||
#+BEGIN_SRC sh
|
||||
sudo dnf install java-11-openjdk
|
||||
#+END_SRC
|
||||
|
||||
** Oracle JDK 11
|
||||
*** Ubuntu
|
||||
#+BEGIN_SRC sh
|
||||
sudo add-apt-repository ppa:linuxuprising/java
|
||||
sudo apt update
|
||||
sudo apt install oracle-java11-installer
|
||||
sudo apt install oracle-java11-set-default
|
||||
#+END_SRC
|
||||
*** Fedora
|
||||
#+BEGIN_SRC sh
|
||||
curl -O https://download.java.net/java/GA/jdk11/9/GPL/openjdk-11.0.2_linux-x64_bin.tar.gz
|
||||
tar zxvf openjdk-11.0.2_linux-x64_bin.tar.gz
|
||||
sudo mv jdk-11.0.2/ /usr/local/
|
||||
#+END_SRC
|
||||
|
||||
Open =/etc/profile.d/jdk11.sh= as root and add
|
||||
|
||||
#+BEGIN_SRC sh
|
||||
export JAVA_HOME=/usr/local/jdk-11.0.2
|
||||
export PATH=$PATH:$JAVA_HOME/bin
|
||||
#+END_SRC
|
||||
|
||||
Save the file and source the file
|
||||
|
||||
#+BEGIN_SRC sh
|
||||
source /etc/profile.d/jdk11.sh
|
||||
java -version
|
||||
#+END_SRC
|
||||
|
||||
* Features
|
||||
** =+lsp= features
|
||||
According to [[https://github.com/emacs-lsp/lsp-java]] it adds
|
||||
|
||||
+ As you type reporting of parsing and compilation errors (via flycheck/[[https://github.com/emacs-lsp/lsp-ui][lsp-ui]])
|
||||
+ Code completion - using [[https://github.com/tigersoldier/company-lsp][company-lsp]] or builtin complete-at-point
|
||||
+ Javadoc hovers - using [[https://github.com/emacs-lsp/lsp-ui][lsp-ui]]
|
||||
+ Code actions - using [[https://github.com/emacs-lsp/lsp-ui][lsp-ui]]
|
||||
+ Code outline - using builtin [[https://www.gnu.org/software/emacs/manual/html_node/emacs/Imenu.html][imenu]]
|
||||
+ Code navigation - using builtin [[https://www.gnu.org/software/emacs/manual/html_node/emacs/Xref.html][xref]]
|
||||
+ Code lens (references/implementations) - using builtin [[https://www.gnu.org/software/emacs/manual/html_node/emacs/Xref.html][xref]]
|
||||
+ Highlights
|
||||
+ Code formatting
|
||||
+ Maven pom.xml project support
|
||||
+ Limited Gradle support
|
||||
+ Visual debugger - [[https://github.com/yyoncho/dap-mode/][dap-mode]]
|
||||
+ Test runner - [[https://github.com/yyoncho/dap-mode/][dap-mode]]
|
||||
+ Project explorer integration - [[https://github.com/Alexander-Miller/treemacs][treemacs]]
|
||||
+ Integration with [[https://start.spring.io/][Spring Initializr]]
|
||||
|
||||
** =+meghanada= features
|
||||
According to [[https://github.com/mopemope/meghanada-emacs/]] it adds
|
||||
|
||||
+ Auto-update server module
|
||||
+ [[https://gradle.org/][Gradle]] and [[http://maven.apache.org/][Maven]] and Eclipse project support
|
||||
+ No need build tool's plugin
|
||||
+ Run build tool task
|
||||
+ Compile your project
|
||||
+ Syntax check and analyze java source (=flycheck-meghanada=)
|
||||
+ Support =Generic Types=
|
||||
+ Code completion with [[http://company-mode.github.io/][company-mode]] (=company-meghanada=)
|
||||
+ Optimize import and sort
|
||||
+ Jump declaration
|
||||
+ Run [[http://www.junit.org/][JUnit]] test (include test runner)
|
||||
+ Diagnostic reporting with [[http://flycheck.org/][flycheck]] (=flycheck-meghanada=)
|
||||
+ Show symbol's type info with =el-doc=
|
||||
+ Search references
|
||||
+ Full-featured text search
|
||||
|
||||
* TODO Configuration
|
|
@ -22,7 +22,7 @@ If the depth is 2, the first two directories are removed: net.lissner.game.")
|
|||
|
||||
|
||||
;;
|
||||
;; java-mode
|
||||
;;; java-mode
|
||||
|
||||
(add-hook 'java-mode-hook #'rainbow-delimiters-mode)
|
||||
|
||||
|
@ -31,7 +31,7 @@ If the depth is 2, the first two directories are removed: net.lissner.game.")
|
|||
|
||||
|
||||
;;
|
||||
;; Common packages
|
||||
;;; Common packages
|
||||
|
||||
(use-package! android-mode
|
||||
:commands android-mode
|
||||
|
|
|
@ -37,7 +37,6 @@ This module adds JavaScript and TypeScript support.
|
|||
+ [[https://github.com/mooz/js2-mode][js2-mode]]
|
||||
+ [[https://github.com/felipeochoa/rjsx-mode][rjsx-mode]]
|
||||
+ [[https://github.com/emacs-typescript/typescript.el][typescript-mode]]
|
||||
+ [[https://github.com/aaronjensen/eslintd-fix][eslintd-fix]]
|
||||
+ [[https://github.com/magnars/js2-refactor.el][js2-refactor]]
|
||||
+ [[https://github.com/mojochao/npm-mode][npm-mode]]
|
||||
+ [[https://github.com/abicky/nodejs-repl.el][nodejs-repl]]
|
||||
|
|
|
@ -83,18 +83,6 @@ Run this for any buffer you want to skewer."
|
|||
;;
|
||||
;; Hooks
|
||||
|
||||
;;;###autoload
|
||||
(defun +javascript-add-node-modules-path-h ()
|
||||
"Add current project's `node_modules/.bin` to `exec-path', so js tools
|
||||
prioritize project-local packages over global ones."
|
||||
(make-local-variable 'exec-path)
|
||||
(cl-pushnew (expand-file-name "node_modules/.bin/"
|
||||
(or (locate-dominating-file
|
||||
(or (buffer-file-name) default-directory)
|
||||
"node_modules")
|
||||
(doom-project-root)))
|
||||
exec-path :test #'string=))
|
||||
|
||||
;;;###autoload
|
||||
(defun +javascript-cleanup-tide-processes-h ()
|
||||
"Clean up dangling tsserver processes if there are no more buffers with
|
||||
|
|
|
@ -133,7 +133,9 @@
|
|||
;;
|
||||
;;; Tools
|
||||
|
||||
(add-hook! '(js-mode-hook typescript-mode-hook web-mode-hook)
|
||||
(add-hook! '(js2-mode-local-vars-hook
|
||||
typescript-mode-local-vars-hook
|
||||
web-mode-local-vars-hook)
|
||||
(defun +javascript-init-lsp-or-tide-maybe-h ()
|
||||
"Start `lsp' or `tide' in the current buffer.
|
||||
|
||||
|
@ -177,9 +179,11 @@ to tide."
|
|||
(setq-default company-backends (delq 'company-tide (default-value 'company-backends))))
|
||||
(set-company-backend! 'tide-mode 'company-tide)
|
||||
;; navigation
|
||||
(set-lookup-handlers! 'tide-mode
|
||||
:definition '(tide-jump-to-definition :async t)
|
||||
:references '(tide-references :async t))
|
||||
(set-lookup-handlers! 'tide-mode :async t
|
||||
:definition #'tide-jump-to-definition
|
||||
:references #'tide-references
|
||||
:documentation #'tide-documentation-at-point)
|
||||
(set-popup-rule! "^\\*tide-documentation" :quit t)
|
||||
;; resolve to `doom-project-root' if `tide-project-root' fails
|
||||
(advice-add #'tide-project-root :override #'+javascript-tide-project-root-a)
|
||||
;; cleanup tsserver when no tide buffers are left
|
||||
|
@ -192,8 +196,6 @@ to tide."
|
|||
;; `tide-mode-hook' is too early, so...
|
||||
(advice-add #'tide-setup :after #'eldoc-mode)
|
||||
|
||||
(define-key tide-mode-map [remap +lookup/documentation] #'tide-documentation-at-point)
|
||||
|
||||
(map! :localleader
|
||||
:map tide-mode-map
|
||||
"R" #'tide-restart-server
|
||||
|
@ -239,13 +241,6 @@ to tide."
|
|||
(js2r-add-keybindings-with-prefix (format "%s r" doom-localleader-key)))))
|
||||
|
||||
|
||||
(use-package! eslintd-fix
|
||||
:commands eslintd-fix
|
||||
:config
|
||||
(setq-hook! 'eslintd-fix-mode-hook
|
||||
flycheck-javascript-eslint-executable eslintd-fix-executable))
|
||||
|
||||
|
||||
;;;###package skewer-mode
|
||||
(map! :localleader
|
||||
(:after js2-mode
|
||||
|
@ -292,10 +287,11 @@ to tide."
|
|||
web-mode
|
||||
markdown-mode
|
||||
js-mode
|
||||
json-mode
|
||||
typescript-mode
|
||||
solidity-mode)
|
||||
:when (locate-dominating-file default-directory "package.json")
|
||||
:add-hooks '(+javascript-add-node-modules-path-h npm-mode))
|
||||
:add-hooks '(add-node-modules-path npm-mode))
|
||||
|
||||
(def-project-mode! +javascript-gulp-mode
|
||||
:when (locate-dominating-file default-directory "gulpfile.js"))
|
||||
|
|
|
@ -2,21 +2,21 @@
|
|||
;;; lang/javascript/packages.el
|
||||
|
||||
;; Major modes
|
||||
(package! coffee-mode :pin "35a41c7d82")
|
||||
(package! js2-mode :pin "fe53814dc2")
|
||||
(package! rjsx-mode :pin "0061587a06")
|
||||
(package! typescript-mode :pin "102587e458")
|
||||
(package! coffee-mode :pin "35a41c7d8233eac0b267d9593e67fb8b6235e134")
|
||||
(package! js2-mode :pin "fe53814dc2a0db2e95ac06083362e43923bf83fc")
|
||||
(package! rjsx-mode :pin "0061587a06cdc2579a8d0e90863498d96bf982d8")
|
||||
(package! typescript-mode :pin "102587e458d48ece6335cd708300647f22ec8b8d")
|
||||
|
||||
;; Tools
|
||||
(package! eslintd-fix :pin "0c431141be")
|
||||
(package! js2-refactor :pin "d4c40b5fc8")
|
||||
(package! npm-mode :pin "3ee7c0bad5")
|
||||
(package! js2-refactor :pin "d4c40b5fc86d3edd7c6a7d83ac86483ee1cb7a28")
|
||||
(package! npm-mode :pin "3ee7c0bad5b7a041d4739ef3aaa06a3dc764e5eb")
|
||||
(package! add-node-modules-path :pin "f31e69ccb681f882aebb806ce6e9478e3ac39708")
|
||||
|
||||
;; Eval
|
||||
(package! nodejs-repl :pin "6fad7d764f")
|
||||
(package! skewer-mode :pin "e5bed35193")
|
||||
(package! nodejs-repl :pin "6fad7d764fa0d818ba497450bd722ae10cb8efed")
|
||||
(package! skewer-mode :pin "e5bed351939c92a1f788f78398583c2f83f1bb3c")
|
||||
|
||||
;; Programming environment
|
||||
(package! tide :pin "3b45610faa")
|
||||
(package! tide :pin "3b45610faaab33bc53ae2d44e1e573f19f35a74a")
|
||||
(when (featurep! :tools lookup)
|
||||
(package! xref-js2 :pin "6f1ed5dae0"))
|
||||
(package! xref-js2 :pin "6f1ed5dae0c2485416196a51f2fa92f32e4b8262"))
|
||||
|
|
40
modules/lang/json/README.org
Normal file
40
modules/lang/json/README.org
Normal file
|
@ -0,0 +1,40 @@
|
|||
#+TITLE: lang/json
|
||||
#+DATE: April 23, 2020
|
||||
#+SINCE: v3.0.0
|
||||
#+STARTUP: inlineimages nofold
|
||||
|
||||
* Table of Contents :TOC_3:noexport:
|
||||
- [[#description][Description]]
|
||||
- [[#maintainers][Maintainers]]
|
||||
- [[#module-flags][Module Flags]]
|
||||
- [[#plugins][Plugins]]
|
||||
- [[#prerequisites][Prerequisites]]
|
||||
- [[#features][Features]]
|
||||
- [[#configuration][Configuration]]
|
||||
- [[#troubleshooting][Troubleshooting]]
|
||||
|
||||
* Description
|
||||
This module provides JSON support.
|
||||
|
||||
** Maintainers
|
||||
This module has no dedicated maintainers.
|
||||
|
||||
** Module Flags
|
||||
+ =+lsp= Enable integration with LSP servers, if one is available. Requires the
|
||||
=:tools lsp= module to be enabled.
|
||||
|
||||
** Plugins
|
||||
+ [[https://github.com/joshwnj/json-mode][json-mode]]
|
||||
+ [[https://github.com/Sterlingg/json-snatcher][json-snatcher]]
|
||||
|
||||
* Prerequisites
|
||||
This module has no prereqisites.
|
||||
|
||||
* TODO Features
|
||||
# An in-depth list of features, how to use them, and their dependencies.
|
||||
|
||||
* TODO Configuration
|
||||
# How to configure this module, including common problems and how to address them.
|
||||
|
||||
* TODO Troubleshooting
|
||||
# Common issues and their solution, or places to look for help.
|
14
modules/lang/json/config.el
Normal file
14
modules/lang/json/config.el
Normal file
|
@ -0,0 +1,14 @@
|
|||
;;; lang/json/config.el -*- lexical-binding: t; -*-
|
||||
|
||||
(use-package! json-mode
|
||||
:mode "\\.js\\(?:on\\|[hl]int\\(?:rc\\)?\\)\\'"
|
||||
:init
|
||||
(when (featurep! +lsp)
|
||||
(add-hook 'json-mode-local-vars-hook #'lsp!))
|
||||
:config
|
||||
(set-electric! 'json-mode :chars '(?\n ?: ?{ ?}))
|
||||
|
||||
(map! :after json-mode
|
||||
:map json-mode-map
|
||||
:localleader
|
||||
"s" #'jsons-print-path))
|
5
modules/lang/json/packages.el
Normal file
5
modules/lang/json/packages.el
Normal file
|
@ -0,0 +1,5 @@
|
|||
;; -*- no-byte-compile: t; -*-
|
||||
;;; lang/json/packages.el
|
||||
|
||||
(package! json-mode :pin "0e819e519a")
|
||||
(package! json-snatcher :pin "c4cecc0a50")
|
|
@ -10,7 +10,8 @@
|
|||
"Run an inferior instance of `julia' inside Emacs."
|
||||
(interactive)
|
||||
(if (require 'julia-repl nil t)
|
||||
(julia-repl)
|
||||
(prog1 (julia-repl)
|
||||
(julia-repl-use-emacsclient))
|
||||
(let ((buffer (get-buffer-create "*Julia*")))
|
||||
(unless (comint-check-proc "*Julia*")
|
||||
(apply #'make-comint-in-buffer "Julia" "*Julia*" julia-program julia-arguments))
|
||||
|
|
|
@ -33,6 +33,8 @@ Provide a helping hand when working with LaTeX documents.
|
|||
** Module Flags
|
||||
+ =+latexmk= Use LatexMk instead of LaTeX to compile documents.
|
||||
+ =+cdlatex= Enable [[https://github.com/cdominik/cdlatex][cdlatex]] for fast math insertion.
|
||||
+ =+lsp= Start LSP automatically in `tex-mode-hook`. This requires the =:tools
|
||||
lsp= module. Supported servers are `digestif` and `TexLab`.
|
||||
+ =+fold= Use TeX-fold (from auctex) to fold LaTeX macros to unicode, and make
|
||||
folding hook-based and less manual.
|
||||
|
||||
|
|
|
@ -70,7 +70,12 @@ If no viewers are found, `latex-preview-pane' is used.")
|
|||
(sp-local-pair modes open nil :actions :rem))
|
||||
;; And tweak these so that users can decide whether they want use latex
|
||||
;; quotes or not, via `+latex-enable-plain-double-quotes'
|
||||
(sp-local-pair modes "``" nil :unless '(:add sp-in-math-p)))))
|
||||
(sp-local-pair modes "``" nil :unless '(:add sp-in-math-p))))
|
||||
;; Hook lsp if enabled
|
||||
(when (featurep! +lsp)
|
||||
(add-hook! '(tex-mode-local-vars-hook
|
||||
latex-mode-local-vars-hook)
|
||||
#'lsp!)))
|
||||
|
||||
|
||||
(use-package! tex-fold
|
||||
|
@ -209,6 +214,7 @@ is mostly for \\section etc."
|
|||
(add-to-list '+latex--company-backends #'company-auctex-environments nil #'eq)
|
||||
(add-to-list '+latex--company-backends #'company-auctex-macros nil #'eq))
|
||||
|
||||
|
||||
(use-package! company-math
|
||||
:when (featurep! :completion company)
|
||||
:defer t
|
||||
|
|
|
@ -27,11 +27,17 @@ capture, the end position, and the output buffer.")
|
|||
markdown-gfm-additional-languages '("sh")
|
||||
markdown-make-gfm-checkboxes-buttons t
|
||||
|
||||
;; Preview/compilation defaults
|
||||
;; `+markdown-compile' offers support for many transpilers (see
|
||||
;; `+markdown-compile-functions'), which it tries until one succeeds.
|
||||
markdown-command #'+markdown-compile
|
||||
;; This is set to `nil' by default, which causes a wrong-type-arg error
|
||||
;; when you use `markdown-open'. These are more sensible defaults.
|
||||
markdown-open-command
|
||||
(cond (IS-MAC "open")
|
||||
(IS-LINUX "xdg-open"))
|
||||
|
||||
;; A sensible and simple default preamble for markdown exports that
|
||||
;; takes after the github asthetic (plus highlightjs syntax coloring).
|
||||
markdown-content-type "application/xhtml+xml"
|
||||
markdown-css-paths
|
||||
'("https://cdn.jsdelivr.net/npm/github-markdown-css/github-markdown.min.css"
|
||||
|
@ -57,6 +63,7 @@ capture, the end position, and the output buffer.")
|
|||
(sp-local-pair '(markdown-mode gfm-mode) "`" "`"
|
||||
:unless '(:add sp-point-before-word-p sp-point-before-same-p))
|
||||
|
||||
;; Don't trigger autofill in code blocks (see `auto-fill-mode')
|
||||
(setq-hook! 'markdown-mode-hook
|
||||
fill-nobreak-predicate (cons #'markdown-code-block-at-point-p
|
||||
fill-nobreak-predicate))
|
||||
|
@ -70,6 +77,7 @@ capture, the end position, and the output buffer.")
|
|||
|
||||
(map! :map markdown-mode-map
|
||||
:localleader
|
||||
"'" #'markdown-edit-code-block
|
||||
"o" #'markdown-open
|
||||
"p" #'markdown-preview
|
||||
"e" #'markdown-export
|
||||
|
|
|
@ -1,13 +1,14 @@
|
|||
;; -*- no-byte-compile: t; -*-
|
||||
;;; lang/markdown/packages.el
|
||||
|
||||
(package! markdown-mode :pin "e9dff50d57")
|
||||
(package! markdown-toc :pin "7038f4f6d5")
|
||||
(package! edit-indirect :pin "935ded353b")
|
||||
(package! markdown-mode :pin "c927a114b1b23cf7538181d62fd14679cce7fa25")
|
||||
(package! markdown-toc :pin "eda9650a1bf0015e52e9678bd92b0a8beb1d7d71")
|
||||
(package! edit-indirect :pin "935ded353b9ed3da67bc61abf245c21b58d88864")
|
||||
|
||||
(when (featurep! +grip)
|
||||
(package! grip-mode :pin "9615c47747"))
|
||||
(package! grip-mode :pin "9615c4774727a719d38313a679d70f2a2c6aca68"))
|
||||
|
||||
(when (featurep! :editor evil +everywhere)
|
||||
(package! evil-markdown
|
||||
:recipe (:host github :repo "Somelauw/evil-markdown") :pin "46cd81b379"))
|
||||
:recipe (:host github :repo "Somelauw/evil-markdown")
|
||||
:pin "46cd81b37991c4325fc24015a610f832b0ff995d"))
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
;; -*- no-byte-compile: t; -*-
|
||||
;;; lang/nix/packages.el
|
||||
|
||||
(package! nix-mode :pin "5b5961780f")
|
||||
(package! nix-update :pin "fc6c39c2da")
|
||||
(package! nix-mode :pin "5b5961780f3b1c1b62453d2087f775298980f10d")
|
||||
(package! nix-update :pin "fc6c39c2da3fcfa62f4796816c084a6389c8b6e7")
|
||||
|
||||
(when (featurep! :completion company)
|
||||
(package! company-nixos-options :pin "977b9a505f"))
|
||||
(package! company-nixos-options :pin "977b9a505ffc8b33b70ec7742f90e469b3168297"))
|
||||
|
||||
(when (featurep! :completion helm)
|
||||
(package! helm-nixos-options :pin "977b9a505f"))
|
||||
(package! helm-nixos-options :pin "977b9a505ffc8b33b70ec7742f90e469b3168297"))
|
||||
|
|
|
@ -42,7 +42,7 @@ PATH (a string) can be an url, a local file path, or a base64 encoded datauri."
|
|||
(unless (eq major-mode 'org-mode)
|
||||
(user-error "Not in an org buffer"))
|
||||
(require 'org-download)
|
||||
(condition-case ex
|
||||
(condition-case-unless-debug e
|
||||
(let ((raw-uri (url-unhex-string path)))
|
||||
(cond ((string-match-p "^data:image/png;base64," path)
|
||||
(org-download-dnd-base64 path nil))
|
||||
|
@ -56,4 +56,4 @@ PATH (a string) can be an url, a local file path, or a base64 encoded datauri."
|
|||
;; insert the link
|
||||
(org-download-insert-link raw-uri new-path)))))
|
||||
(error
|
||||
(user-error "Failed to attach file: %s" (error-message-string ex)))))
|
||||
(user-error "Failed to attach file: %s" (error-message-string e)))))
|
||||
|
|
|
@ -50,7 +50,7 @@ you're done. This can be called from an external shell script."
|
|||
(with-selected-frame frame
|
||||
(require 'org-capture)
|
||||
(condition-case ex
|
||||
(cl-letf (((symbol-function #'pop-to-buffer) #'switch-to-buffer))
|
||||
(letf! ((#'pop-to-buffer #'switch-to-buffer))
|
||||
(switch-to-buffer (doom-fallback-buffer))
|
||||
(let ((org-capture-initial initial-input)
|
||||
org-capture-entry)
|
||||
|
|
|
@ -1,43 +1,72 @@
|
|||
;;; lang/org/autoload/org-link.el -*- lexical-binding: t; -*-
|
||||
|
||||
(defun +org--relpath (path root)
|
||||
(defun +org--relative-path (path root)
|
||||
(if (and buffer-file-name (file-in-directory-p buffer-file-name root))
|
||||
(file-relative-name path)
|
||||
path))
|
||||
|
||||
;;;###autoload
|
||||
(defun +org-def-link (key dir)
|
||||
(org-link-set-parameters
|
||||
key
|
||||
:complete (lambda () (+org--relpath (+org-link-read-file key dir) dir))
|
||||
:follow (lambda (link) (find-file (expand-file-name link dir)))
|
||||
:face (lambda (link)
|
||||
(if (file-exists-p (expand-file-name link dir))
|
||||
'org-link
|
||||
'error))))
|
||||
(defun +org--read-link-path (key dir &optional fn)
|
||||
(let ((file (funcall (or fn #'read-file-name) (format "%s: " (capitalize key)) dir)))
|
||||
(format "%s:%s" key (file-relative-name file dir))))
|
||||
|
||||
;;;###autoload
|
||||
(defun +org-link-read-file (key dir)
|
||||
(let ((file (read-file-name (format "%s: " (capitalize key)) dir)))
|
||||
(format "%s:%s"
|
||||
key
|
||||
(file-relative-name file dir))))
|
||||
(defun +org-define-basic-link (key dir-var &rest plist)
|
||||
"Define a link with some basic completion & fontification.
|
||||
|
||||
KEY is the name of the link type. DIR-VAR is the directory variable to resolve
|
||||
links relative to. PLIST is passed to `org-link-set-parameters' verbatim.
|
||||
|
||||
Links defined with this will be rendered in the `error' face if the file doesn't
|
||||
exist, and `org-link' otherwise."
|
||||
(declare (indent 2))
|
||||
(let ((requires (plist-get plist :requires))
|
||||
(dir-fn (if (functionp dir-var)
|
||||
dir-var
|
||||
(lambda () (symbol-value dir-var)))))
|
||||
(apply #'org-link-set-parameters
|
||||
key
|
||||
:complete (lambda ()
|
||||
(if requires (mapc #'require (doom-enlist requires)))
|
||||
(+org--relative-path (+org--read-link-path key (funcall dir-fn))
|
||||
(funcall dir-fn)))
|
||||
:follow (lambda (link)
|
||||
(org-link-open-as-file (expand-file-name link (funcall dir-fn)) nil))
|
||||
:face (lambda (link)
|
||||
(if (file-exists-p (expand-file-name link (funcall dir-fn)))
|
||||
'org-link
|
||||
'error))
|
||||
(doom-plist-delete plist :requires))))
|
||||
|
||||
|
||||
;;
|
||||
;;; Image data functions (for custom inline images)
|
||||
|
||||
;;;###autoload
|
||||
(defun +org-link-read-directory (key dir)
|
||||
(let ((file (read-directory-name (format "%s: " (capitalize key)) dir)))
|
||||
(format "%s:%s"
|
||||
key
|
||||
(file-relative-name file dir))))
|
||||
(defun +org-image-file-data-fn (protocol link _description)
|
||||
"Intepret LINK as an image file path and return its data."
|
||||
(setq
|
||||
link (expand-file-name
|
||||
link
|
||||
(pcase protocol
|
||||
("download" (or org-download-image-dir org-attach-id-dir default-directory))
|
||||
("attachment" org-attach-id-dir)
|
||||
(_ default-directory))))
|
||||
(when (and (file-exists-p link)
|
||||
(image-type-from-file-name link))
|
||||
(with-temp-buffer
|
||||
(set-buffer-multibyte nil)
|
||||
(setq buffer-file-coding-system 'binary)
|
||||
(insert-file-contents-literally link)
|
||||
(buffer-substring-no-properties (point-min) (point-max)))))
|
||||
|
||||
;;;###autoload
|
||||
(defun +org-inline-data-image (_protocol link _description)
|
||||
(defun +org-inline-image-data-fn (_protocol link _description)
|
||||
"Interpret LINK as base64-encoded image data."
|
||||
(base64-decode-string link))
|
||||
|
||||
;;;###autoload
|
||||
(defun +org-image-link (protocol link _description)
|
||||
"Interpret LINK as base64-encoded image data."
|
||||
(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))))
|
||||
(with-current-buffer buf
|
||||
|
|
|
@ -65,6 +65,12 @@ Is relative to `org-directory', unless it is absolute. Is used in Doom's default
|
|||
;;
|
||||
;;; `org-load' hooks
|
||||
|
||||
(defun +org-init-org-directory-h ()
|
||||
(unless org-directory
|
||||
(setq org-directory "~/org"))
|
||||
(setq org-id-locations-file (expand-file-name ".orgids" org-directory)))
|
||||
|
||||
|
||||
(defun +org-init-agenda-h ()
|
||||
(unless org-agenda-files
|
||||
(setq org-agenda-files (list org-directory)))
|
||||
|
@ -88,14 +94,11 @@ 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-hide-leading-stars-before-indent-mode t
|
||||
org-image-actual-width nil
|
||||
org-list-description-max-indent 4
|
||||
org-priority-faces
|
||||
'((?A . error)
|
||||
(?B . warning)
|
||||
|
@ -114,9 +117,6 @@ Is relative to `org-directory', unless it is absolute. Is used in Doom's default
|
|||
org-refile-use-outline-path 'file
|
||||
org-outline-path-complete-in-steps nil)
|
||||
|
||||
;; Fontify latex blocks and entities, but not natively -- that's too slow
|
||||
(setq org-highlight-latex-and-related '(latex script entities))
|
||||
|
||||
(plist-put org-format-latex-options :scale 1.5) ; larger previews
|
||||
(add-hook! 'doom-load-theme-hook
|
||||
(defun +org-refresh-latex-background-h ()
|
||||
|
@ -162,12 +162,11 @@ This forces it to read the background before rendering."
|
|||
("HOLD" . +org-todo-onhold)
|
||||
("PROJ" . +org-todo-project)))
|
||||
|
||||
(defadvice! +org-display-link-in-eldoc-a (orig-fn &rest args)
|
||||
(defadvice! +org-display-link-in-eldoc-a (&rest args)
|
||||
"Display full link in minibuffer when cursor/mouse is over it."
|
||||
:around #'org-eldoc-documentation-function
|
||||
(or (when-let (link (org-element-property :raw-link (org-element-context)))
|
||||
(format "Link: %s" link))
|
||||
(apply orig-fn args)))
|
||||
:before-until #'org-eldoc-documentation-function
|
||||
(when-let (link (org-element-property :raw-link (org-element-context)))
|
||||
(format "Link: %s" link)))
|
||||
|
||||
;; Automatic indent detection in org files is meaningless
|
||||
(add-to-list 'doom-detect-indentation-excluded-modes 'org-mode)
|
||||
|
@ -340,7 +339,7 @@ relative to `org-directory', unless it is an absolute path."
|
|||
(defadvice! +org--prevent-save-prompts-when-refiling-a (&rest _)
|
||||
"Fix #462: when refiling from org-capture, Emacs prompts to kill the
|
||||
underlying, modified buffer. This fixes that."
|
||||
:after 'org-refile
|
||||
:after #'org-refile
|
||||
(when (bound-and-true-p org-capture-is-refiling)
|
||||
(org-save-all-org-buffers)))
|
||||
|
||||
|
@ -366,14 +365,15 @@ underlying, modified buffer. This fixes that."
|
|||
|
||||
(defun +org-init-attachments-h ()
|
||||
"Sets up org's attachment system."
|
||||
(setq org-attach-store-link-p t ; store link after attaching files
|
||||
org-attach-use-inheritance t) ; inherit properties from parent nodes
|
||||
|
||||
;; Centralized attachments directory
|
||||
(setq org-attach-id-dir (doom-path org-directory org-attach-id-dir)
|
||||
;; Store a link to attachments when they are attached
|
||||
org-attach-store-link-p t
|
||||
;; Inherit attachment properties from parent nodes
|
||||
org-attach-use-inheritance t)
|
||||
(after! projectile
|
||||
(add-to-list 'projectile-globally-ignored-directories org-attach-id-dir)))
|
||||
(after! org-attach
|
||||
(unless org-attach-id-dir
|
||||
(setq org-attach-id-dir (expand-file-name ".attach/" org-directory)))
|
||||
(after! projectile
|
||||
(add-to-list 'projectile-globally-ignored-directories org-attach-id-dir))))
|
||||
|
||||
|
||||
(defun +org-init-custom-links-h ()
|
||||
|
@ -397,15 +397,15 @@ underlying, modified buffer. This fixes that."
|
|||
'("wolfram" . "https://wolframalpha.com/input/?i=%s")
|
||||
'("doom-repo" . "https://github.com/hlissner/doom-emacs/%s"))
|
||||
|
||||
(+org-def-link "org" org-directory)
|
||||
(+org-def-link "doom" doom-emacs-dir)
|
||||
(+org-def-link "doom-docs" doom-docs-dir)
|
||||
(+org-def-link "doom-modules" doom-modules-dir)
|
||||
(+org-define-basic-link "org" 'org-directory)
|
||||
(+org-define-basic-link "doom" 'doom-emacs-dir)
|
||||
(+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
|
||||
(org-link-set-parameters "http" :image-data-fun #'+org-image-link)
|
||||
(org-link-set-parameters "https" :image-data-fun #'+org-image-link)
|
||||
(org-link-set-parameters "img" :image-data-fun #'+org-inline-data-image)
|
||||
(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))
|
||||
|
@ -458,9 +458,9 @@ underlying, modified buffer. This fixes that."
|
|||
|
||||
(defun +org-init-hacks-h ()
|
||||
"Getting org to behave."
|
||||
;; Don't open separate windows
|
||||
;; Open file links in current window, rather than new ones
|
||||
(setf (alist-get 'file org-link-frame-setup) #'find-file)
|
||||
;; Open directory links in Emacs
|
||||
;; Open directory links in dired
|
||||
(add-to-list 'org-file-apps '(directory . emacs))
|
||||
|
||||
;; When you create a sparse tree and `org-indent-mode' is enabled, the
|
||||
|
@ -489,6 +489,13 @@ eldoc string."
|
|||
nil 'face `(:foreground ,(face-foreground face nil t) :weight bold)))
|
||||
width prefix separator))
|
||||
|
||||
(after! org-eldoc
|
||||
;; HACK Fix #2972: infinite recursion when eldoc kicks in in 'org' or
|
||||
;; 'python' src blocks.
|
||||
;; TODO Should be reported upstream!
|
||||
(puthash "org" #'ignore org-eldoc-local-functions-cache)
|
||||
(puthash "python" #'python-eldoc-function org-eldoc-local-functions-cache))
|
||||
|
||||
(defun +org--restart-mode-h ()
|
||||
"Restart `org-mode', but only once."
|
||||
(quiet! (org-mode-restart))
|
||||
|
@ -529,11 +536,9 @@ current workspace (and clean them up)."
|
|||
;; upstream (if ever).
|
||||
(defadvice! +org--fix-inline-images-for-imagemagick-users-a (orig-fn &rest args)
|
||||
:around #'org-display-inline-images
|
||||
(cl-letf* ((old-create-image (symbol-function #'create-image))
|
||||
((symbol-function #'create-image)
|
||||
(lambda (file-or-data &optional type data-p &rest props)
|
||||
(let ((type (if (plist-get props :width) type)))
|
||||
(apply old-create-image file-or-data type data-p props)))))
|
||||
(letf! (defun create-image (file-or-data &optional type data-p &rest props)
|
||||
(let ((type (if (plist-get props :width) type)))
|
||||
(apply create-image file-or-data type data-p props)))
|
||||
(apply orig-fn args)))
|
||||
|
||||
(defadvice! +org--fix-inconsistent-uuidgen-case-a (uuid)
|
||||
|
@ -568,6 +573,9 @@ between the two."
|
|||
"C-c C-S-l" #'+org/remove-link
|
||||
"C-c C-i" #'org-toggle-inline-images
|
||||
;; textmate-esque newline insertion
|
||||
"C-RET" #'+org/insert-item-below
|
||||
"C-S-RET" #'+org/insert-item-above
|
||||
"C-M-RET" #'org-insert-subheading
|
||||
[C-return] #'+org/insert-item-below
|
||||
[C-S-return] #'+org/insert-item-above
|
||||
[C-M-return] #'org-insert-subheading
|
||||
|
@ -580,7 +588,10 @@ between the two."
|
|||
[remap doom/forward-to-last-non-comment-or-eol] #'org-end-of-line
|
||||
|
||||
:localleader
|
||||
"#" #'org-update-statistics-cookies
|
||||
"'" #'org-edit-special
|
||||
"*" #'org-ctrl-c-star
|
||||
"+" #'org-ctrl-c-minus
|
||||
"," #'org-switchb
|
||||
"." #'org-goto
|
||||
(:when (featurep! :completion ivy)
|
||||
|
@ -590,7 +601,6 @@ between the two."
|
|||
"." #'helm-org-in-buffer-headings
|
||||
"/" #'helm-org-agenda-files-headings)
|
||||
"A" #'org-archive-subtree
|
||||
"d" #'org-deadline
|
||||
"e" #'org-export-dispatch
|
||||
"f" #'org-footnote-new
|
||||
"h" #'org-toggle-heading
|
||||
|
@ -600,7 +610,6 @@ between the two."
|
|||
"o" #'org-set-property
|
||||
"p" #'org-priority
|
||||
"q" #'org-set-tags-command
|
||||
"s" #'org-schedule
|
||||
"t" #'org-todo
|
||||
"T" #'org-todo-list
|
||||
(:prefix ("a" . "attachments")
|
||||
|
@ -623,24 +632,38 @@ between the two."
|
|||
(:prefix ("b" . "tables")
|
||||
"-" #'org-table-insert-hline
|
||||
"a" #'org-table-align
|
||||
"b" #'org-table-blank-field
|
||||
"c" #'org-table-create-or-convert-from-region
|
||||
"dc" #'org-table-delete-column
|
||||
"dr" #'org-table-kill-row
|
||||
"e" #'org-table-edit-field
|
||||
"f" #'org-table-edit-formulas
|
||||
"h" #'org-table-field-info
|
||||
"s" #'org-table-sort-lines
|
||||
"r" #'org-table-recalculate
|
||||
"R" #'org-table-recalculate-buffer-tables
|
||||
(:when (featurep! +gnuplot)
|
||||
"p" #'org-plot/gnuplot))
|
||||
(:prefix ("c" . "clock")
|
||||
"c" #'org-clock-in
|
||||
"C" #'org-clock-out
|
||||
"c" #'org-clock-cancel
|
||||
"d" #'org-clock-mark-default-task
|
||||
"e" #'org-clock-modify-effort-estimate
|
||||
"E" #'org-set-effort
|
||||
"l" #'org-clock-in-last
|
||||
"g" #'org-clock-goto
|
||||
"G" (λ! (org-clock-goto 'select))
|
||||
"r" #'org-clock-report
|
||||
"x" #'org-clock-cancel
|
||||
"i" #'org-clock-in
|
||||
"I" #'org-clock-in-last
|
||||
"o" #'org-clock-out
|
||||
"r" #'org-resolve-clocks
|
||||
"R" #'org-clock-report
|
||||
"t" #'org-evaluate-time-range
|
||||
"=" #'org-clock-timestamps-up
|
||||
"-" #'org-clock-timestamps-down)
|
||||
(:prefix ("d" . "date/deadline")
|
||||
"d" #'org-deadline
|
||||
"s" #'org-schedule
|
||||
"t" #'org-time-stamp
|
||||
"T" #'org-time-stamp-inactive)
|
||||
(:prefix ("g" . "goto")
|
||||
"g" #'org-goto
|
||||
(:when (featurep! :completion ivy)
|
||||
|
@ -657,12 +680,13 @@ between the two."
|
|||
"x" #'org-capture-goto-last-stored)
|
||||
(:prefix ("l" . "links")
|
||||
"c" #'org-cliplink
|
||||
"d" #'+org/remove-link
|
||||
"i" #'org-id-store-link
|
||||
"l" #'org-insert-link
|
||||
"L" #'org-insert-all-links
|
||||
"s" #'org-store-link
|
||||
"S" #'org-insert-last-stored-link
|
||||
"i" #'org-id-store-link
|
||||
"d" #'+org/remove-link)
|
||||
"t" #'org-toggle-link-display)
|
||||
(:prefix ("r" . "refile")
|
||||
"." #'+org/refile-to-current-file
|
||||
"c" #'+org/refile-to-running-clock
|
||||
|
@ -782,11 +806,14 @@ compelling reason, so..."
|
|||
(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)
|
||||
:config
|
||||
(add-hook! 'org-mode-hook
|
||||
(add-hook 'before-save-hook 'org-encrypt-entries nil t))
|
||||
(add-to-list 'org-tags-exclude-from-inheritance "crypt")
|
||||
(setq org-crypt-key user-mail-address))
|
||||
:preface
|
||||
;; org-crypt falls back to CRYPTKEY property then `epa-file-encrypt-to', which
|
||||
;; is a better default than the empty string `org-crypt-key' defaults to.
|
||||
(defvar org-crypt-key nil)
|
||||
(after! org
|
||||
(add-to-list 'org-tags-exclude-from-inheritance "crypt")
|
||||
(add-hook! 'org-mode-hook
|
||||
(add-hook 'before-save-hook 'org-encrypt-entries nil t))))
|
||||
|
||||
|
||||
(use-package! org-clock ; built-in
|
||||
|
@ -915,10 +942,12 @@ compelling reason, so..."
|
|||
org-list org-pcomplete org-src org-footnote org-macro ob org org-agenda
|
||||
org-capture
|
||||
:preface
|
||||
;; Change org defaults (should be set before org loads)
|
||||
(setq org-directory "~/org/"
|
||||
org-attach-id-dir ".attach/"
|
||||
org-publish-timestamp-directory (concat doom-cache-dir "org-timestamps/")
|
||||
;; Set these to nil now 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/"))
|
||||
|
||||
;; Make most of the default modules opt-in, because I sincerely doubt most
|
||||
|
@ -960,6 +989,7 @@ compelling reason, so..."
|
|||
#'+org-unfold-to-2nd-level-or-point-h)
|
||||
|
||||
(add-hook! 'org-load-hook
|
||||
#'+org-init-org-directory-h
|
||||
#'+org-init-appearance-h
|
||||
#'+org-init-agenda-h
|
||||
#'+org-init-attachments-h
|
||||
|
@ -993,7 +1023,6 @@ compelling reason, so..."
|
|||
;; Global ID state means we can have ID links anywhere. This is required for
|
||||
;; `org-brain', however.
|
||||
(setq org-id-track-globally t
|
||||
org-id-locations-file (expand-file-name ".orgids" org-directory)
|
||||
org-id-locations-file-relative t)
|
||||
|
||||
;; HACK `org-id' doesn't check if `org-id-locations-file' exists or is
|
||||
|
|
|
@ -16,62 +16,52 @@
|
|||
|
||||
(after! org
|
||||
;; A shorter link to attachments
|
||||
(+org-def-link "download" org-attach-id-dir)
|
||||
(setf (alist-get "download" org-link-abbrev-alist nil nil #'equal)
|
||||
(abbreviate-file-name org-attach-id-dir)))
|
||||
(+org-define-basic-link "download" (lambda () (or org-download-image-dir org-attach-id-dir "."))
|
||||
:image-data-fun #'+org-image-file-data-fn
|
||||
:requires 'org-download))
|
||||
:config
|
||||
(setq org-download-image-dir org-attach-id-dir
|
||||
org-download-link-format "[[download:%s]]\n"
|
||||
org-download-method 'attach
|
||||
org-download-heading-lvl nil
|
||||
(unless org-download-image-dir
|
||||
(setq org-download-image-dir org-attach-id-dir))
|
||||
(setq org-download-method 'attach
|
||||
org-download-timestamp "_%Y%m%d_%H%M%S"
|
||||
org-download-screenshot-method
|
||||
(cond (IS-MAC "screencapture -i %s")
|
||||
(IS-LINUX
|
||||
(cond ((executable-find "maim") "maim -s %s")
|
||||
((executable-find "scrot") "scrot -s %s")
|
||||
((executable-find "gnome-screenshot") "gnome-screenshot -a -f %s")))))
|
||||
((executable-find "gnome-screenshot") "gnome-screenshot -a -f %s"))))
|
||||
|
||||
;; Handle non-image files a little differently. Images should be inserted
|
||||
;; as-is, as image previews. Other files, like pdfs or zips, should be linked
|
||||
;; to, with an icon indicating the type of file.
|
||||
(defadvice! +org--dragndrop-insert-link-a (_link filename)
|
||||
"Produces and inserts a link to FILENAME into the document.
|
||||
org-download-heading-lvl nil
|
||||
org-download-link-format "[[download:%s]]\n"
|
||||
org-download-annotate-function (lambda (_link) "")
|
||||
org-download-link-format-function
|
||||
(lambda (filename)
|
||||
(if (eq org-download-method 'attach)
|
||||
(format "[[attachment:%s]]\n"
|
||||
(org-link-escape
|
||||
(file-relative-name filename (org-attach-dir))))
|
||||
;; Handle non-image files a little differently. Images should be
|
||||
;; inserted as normal with previews. Other files, like pdfs or zips,
|
||||
;; should be linked to, with an icon indicating the type of file.
|
||||
(format (concat (unless (image-type-from-file-name filename)
|
||||
(concat (+org-attach-icon-for filename)
|
||||
" "))
|
||||
org-download-link-format)
|
||||
(org-link-escape
|
||||
(funcall org-download-abbreviate-filename-function filename)))))
|
||||
org-download-abbreviate-filename-function
|
||||
(lambda (path)
|
||||
(if (file-in-directory-p path org-download-image-dir)
|
||||
(file-relative-name path org-download-image-dir)
|
||||
path)))
|
||||
|
||||
If FILENAME is an image, produce an attach:%s path, otherwise use file:%s (with
|
||||
an file icon produced by `+org-attach-icon-for')."
|
||||
:override #'org-download-insert-link
|
||||
(if (looking-back "^[ \t]+" (line-beginning-position))
|
||||
(delete-region (match-beginning 0) (match-end 0))
|
||||
(newline))
|
||||
(cond ((image-type-from-file-name filename)
|
||||
(insert
|
||||
(concat
|
||||
(if (= org-download-image-html-width 0) ""
|
||||
(format "#+attr_html: :width %dpx\n" org-download-image-html-width))
|
||||
(if (= org-download-image-latex-width 0) ""
|
||||
(format "#+attr_latex: :width %dcm\n" org-download-image-latex-width))
|
||||
(if (= org-download-image-org-width 0) ""
|
||||
(format "#+attr_org: :width %dpx\n" org-download-image-org-width))
|
||||
(format org-download-link-format
|
||||
(cond ((file-in-directory-p filename org-attach-id-dir)
|
||||
(file-relative-name filename org-attach-id-dir))
|
||||
((file-in-directory-p filename org-directory)
|
||||
(file-relative-name filename org-directory))
|
||||
(filename)))))
|
||||
(org-display-inline-images))
|
||||
((insert
|
||||
(format "%s [[./%s][%s]] "
|
||||
(+org-attach-icon-for filename)
|
||||
(file-relative-name filename (file-name-directory buffer-file-name))
|
||||
(file-name-nondirectory (directory-file-name filename)))))))
|
||||
|
||||
(advice-add #'org-download--dir-2 :override #'ignore)
|
||||
(defadvice! +org--dragndrop-download-fullname-a (path)
|
||||
"Write PATH relative to current file."
|
||||
:filter-return #'org-download--fullname
|
||||
(let ((dir (or (if buffer-file-name (file-name-directory buffer-file-name))
|
||||
default-directory)))
|
||||
(if (file-in-directory-p dir org-directory)
|
||||
(file-relative-name path dir)
|
||||
path))))
|
||||
(defadvice! +org--dragndrop-then-display-inline-images-a (_link filename)
|
||||
:after #'org-download-insert-link
|
||||
(when (image-type-from-file-name filename)
|
||||
(save-excursion
|
||||
(org-display-inline-images
|
||||
t t
|
||||
(progn (org-back-to-heading t) (point))
|
||||
(progn (org-end-of-subtree t t)
|
||||
(when (and (org-at-heading-p) (not (eobp))) (backward-char 1))
|
||||
(point)))))))
|
||||
|
|
|
@ -41,20 +41,19 @@
|
|||
(defadvice! +org-present--narrow-to-subtree-a (orig-fn &rest args)
|
||||
"Narrow to the target subtree when you start the presentation."
|
||||
:around #'org-tree-slide--display-tree-with-narrow
|
||||
(cl-letf (((symbol-function #'org-narrow-to-subtree)
|
||||
(lambda ()
|
||||
(save-excursion
|
||||
(save-match-data
|
||||
(org-with-limited-levels
|
||||
(narrow-to-region
|
||||
(progn
|
||||
(when (org-before-first-heading-p)
|
||||
(org-next-visible-heading 1))
|
||||
(ignore-errors (org-up-heading-all 99))
|
||||
(forward-line 1)
|
||||
(point))
|
||||
(progn (org-end-of-subtree t t)
|
||||
(when (and (org-at-heading-p) (not (eobp)))
|
||||
(backward-char 1))
|
||||
(point)))))))))
|
||||
(letf! ((defun org-narrow-to-subtree ()
|
||||
(save-excursion
|
||||
(save-match-data
|
||||
(org-with-limited-levels
|
||||
(narrow-to-region
|
||||
(progn
|
||||
(when (org-before-first-heading-p)
|
||||
(org-next-visible-heading 1))
|
||||
(ignore-errors (org-up-heading-all 99))
|
||||
(forward-line 1)
|
||||
(point))
|
||||
(progn (org-end-of-subtree t t)
|
||||
(when (and (org-at-heading-p) (not (eobp)))
|
||||
(backward-char 1))
|
||||
(point))))))))
|
||||
(apply orig-fn args))))
|
||||
|
|
|
@ -1,12 +1,19 @@
|
|||
;;; lang/org/contrib/roam.el -*- lexical-binding: t; -*-
|
||||
;;;###if (featurep! +roam)
|
||||
|
||||
(defvar +org-roam-open-buffer-on-find-file t
|
||||
"If non-nil, open the org-roam buffer when opening an org roam file.")
|
||||
|
||||
|
||||
;;
|
||||
;;; Packages
|
||||
|
||||
(use-package! org-roam
|
||||
:hook (org-load . org-roam-mode)
|
||||
:hook (org-roam-backlinks-mode . turn-on-visual-line-mode)
|
||||
:commands (org-roam-buffer-toggle-display
|
||||
org-roam-find-file
|
||||
org-roam-graph-show
|
||||
org-roam-graph
|
||||
org-roam-insert
|
||||
org-roam-switch-to-buffer
|
||||
org-roam-dailies-date
|
||||
|
@ -24,7 +31,7 @@
|
|||
:prefix ("m" . "org-roam")
|
||||
"b" #'org-roam-switch-to-buffer
|
||||
"f" #'org-roam-find-file
|
||||
"g" #'org-roam-graph-show
|
||||
"g" #'org-roam-graph
|
||||
"i" #'org-roam-insert
|
||||
"m" #'org-roam
|
||||
(:prefix ("d" . "by date")
|
||||
|
@ -33,21 +40,32 @@
|
|||
:desc "Tomorrow" "m" #'org-roam-dailies-tomorrow
|
||||
:desc "Yesterday" "y" #'org-roam-dailies-yesterday))
|
||||
:config
|
||||
(setq org-roam-directory (expand-file-name (or org-roam-directory "")
|
||||
(setq org-roam-directory (expand-file-name (or org-roam-directory "roam")
|
||||
org-directory)
|
||||
org-roam-verbose nil ; https://youtu.be/fn4jIlFwuLU
|
||||
org-roam-buffer-no-delete-other-windows t ; make org-roam buffer sticky
|
||||
org-roam-completion-system
|
||||
(cond ((featurep! :completion helm) 'helm)
|
||||
((featurep! :completion ivy) 'ivy)
|
||||
((featurep! :completion ido) 'ido)
|
||||
('default)))
|
||||
|
||||
;; HACK Hide the mode line in the org-roam buffer, since it serves no purpose.
|
||||
;; This makes it easier to distinguish among other org buffers.
|
||||
(defadvice! +org--hide-mode-line-a (&rest _)
|
||||
:after #'org-roam-buffer--get-create
|
||||
(with-current-buffer org-roam-buffer
|
||||
(hide-mode-line-mode +1))))
|
||||
;; Normally, the org-roam buffer doesn't open until you explicitly call
|
||||
;; `org-roam'. If `+org-roam-open-buffer-on-find-file' is non-nil, the
|
||||
;; org-roam buffer will be opened for you when you use `org-roam-find-file'
|
||||
;; (but not `find-file', to limit the scope of this behavior).
|
||||
(add-hook! 'find-file-hook
|
||||
(defun +org-roam-open-buffer-maybe-h ()
|
||||
(and +org-roam-open-buffer-on-find-file
|
||||
(memq 'org-roam-buffer--update-maybe post-command-hook)
|
||||
(not (window-parameter nil 'window-side)) ; don't proc for popups
|
||||
(not (eq 'visible (org-roam-buffer--visibility)))
|
||||
(with-current-buffer (window-buffer)
|
||||
(org-roam-buffer--get-create)))))
|
||||
|
||||
;; Hide the mode line in the org-roam buffer, since it serves no purpose. This
|
||||
;; makes it easier to distinguish among other org buffers.
|
||||
(add-hook 'org-roam-buffer-prepare-hook #'hide-mode-line-mode))
|
||||
|
||||
|
||||
;; Since the org module lazy loads org-protocol (waits until an org URL is
|
||||
|
|
|
@ -27,84 +27,84 @@
|
|||
:recipe (:host github
|
||||
:repo "emacs-straight/org-mode"
|
||||
:files ("*.el" "lisp/*.el" "contrib/lisp/*.el"))
|
||||
:pin "9994e8ee89")
|
||||
:pin "e5eda0beeb3b6b0666550091bcc0df066d52c008")
|
||||
;; ...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 "86f22f211e")
|
||||
(package! org-superstar :pin "09ddc28383")
|
||||
(package! htmlize :pin "86f22f211e9230857197c42a9823d3f05381deed")
|
||||
(package! org-superstar :pin "09ddc28383d363a4b353348a433e24535b4af0e3")
|
||||
(package! org-yt
|
||||
:recipe (:host github :repo "TobiasZawada/org-yt")
|
||||
:pin "40cc1ac76d")
|
||||
(package! ox-clip :pin "bd36f9fb4e")
|
||||
(package! toc-org :pin "5deaec41ed")
|
||||
(package! org-cliplink :pin "82402cae7e")
|
||||
:pin "40cc1ac76d741055cbefa13860d9f070a7ade001")
|
||||
(package! ox-clip :pin "bd36f9fb4e3b1b9e8686b993b02ccd780ff75a96")
|
||||
(package! toc-org :pin "5deaec41ed0e5c51715737d7f74c5ae1b3c00387")
|
||||
(package! org-cliplink :pin "82402cae7e118d67de7328417fd018a18f95fac2")
|
||||
|
||||
(when (featurep! :editor evil +everywhere)
|
||||
(package! evil-org
|
||||
:recipe (:host github :repo "hlissner/evil-org-mode")
|
||||
:pin "4d44e9bbdc"))
|
||||
:pin "9cf661af8ff8ea768ef1e55045be14d0468a90f5"))
|
||||
(when (featurep! :tools pdf)
|
||||
(package! org-pdftools :pin "22d9a367ab"))
|
||||
(package! org-pdftools :pin "8cc15bb8014ed1f047eecc0abd8bf447f86c0505"))
|
||||
(when (featurep! :tools magit)
|
||||
(package! orgit :pin "e147f05577"))
|
||||
(package! orgit :pin "e147f055772cc934fe1f1d8619059badeb647c93"))
|
||||
(when (featurep! +brain)
|
||||
(package! org-brain :pin "3630eb88a3"))
|
||||
(package! org-brain :pin "ae7fe0f628bd093526786ece6917f7a4310e5e4d"))
|
||||
(when (featurep! +dragndrop)
|
||||
(package! org-download :pin "46417e2bd3"))
|
||||
(package! org-download :pin "48d3952ad8ebc5ef5a6a77b8c6a4a0da61653036"))
|
||||
(when (featurep! +gnuplot)
|
||||
(package! gnuplot :pin "f0001c3001")
|
||||
(package! gnuplot-mode :pin "601f639298"))
|
||||
(package! gnuplot :pin "f0001c30010b2899e36d7d89046322467e923088")
|
||||
(package! gnuplot-mode :pin "601f6392986f0cba332c87678d31ae0d0a496ce7"))
|
||||
(when (featurep! +ipython) ; DEPRECATED
|
||||
(package! ob-ipython :pin "7147455230"))
|
||||
(package! ob-ipython :pin "7147455230841744fb5b95dcbe03320313a77124"))
|
||||
(when (featurep! +jupyter)
|
||||
(package! jupyter :pin "62ad054001"))
|
||||
(package! jupyter :pin "785edbbff65abb0c929dc2fbd8b8305c77fd529e"))
|
||||
(when (featurep! +journal)
|
||||
(package! org-journal :pin "3fdb5b3036"))
|
||||
(package! org-journal :pin "8bf06b28d6f14f52d4968123e2b4b91930c8f947"))
|
||||
(when (featurep! +noter)
|
||||
(package! org-noter :pin "9ead81d42dd4dd5074782d239b2efddf9b8b7b3d"))
|
||||
(when (featurep! +pomodoro)
|
||||
(package! org-pomodoro :pin "aa07c11318"))
|
||||
(package! org-pomodoro :pin "aa07c11318f91219336197e62c47bc7a3d090479"))
|
||||
(when (featurep! +present)
|
||||
(package! centered-window
|
||||
:recipe (:host github :repo "anler/centered-window-mode")
|
||||
:pin "24f7c5be9d")
|
||||
(package! org-tree-slide :pin "7bf09a02bd")
|
||||
(package! org-re-reveal :pin "61549f4c00"))
|
||||
:pin "f50859941ab5c7cbeaee410f2d38716252b552ac")
|
||||
(package! org-tree-slide :pin "7bf09a02bd2d8f1ccfcb5209bfb18fbe02d1f44e")
|
||||
(package! org-re-reveal :pin "61549f4c00284a30e34caa3d76001b233ea5d2ad"))
|
||||
(when (featurep! +roam)
|
||||
(package! org-roam :pin "6175739b33")
|
||||
(package! org-roam :pin "e698ed7f5378106da8a8fec4537658392157657c")
|
||||
(when (featurep! :completion company)
|
||||
(package! company-org-roam :pin "0913d86f16")))
|
||||
(when (featurep! +noter)
|
||||
(package! org-noter :pin "9ead81d42d"))
|
||||
(package! company-org-roam :pin "0913d86f167164e18831206e611f44bb8e7297e3")))
|
||||
|
||||
;;; Babel
|
||||
(package! ob-async :pin "80a30b96a0")
|
||||
(package! ob-async :pin "80a30b96a007d419ece12c976a81804ede340311")
|
||||
(when (featurep! :lang crystal)
|
||||
(package! ob-crystal :pin "d84c1adee4"))
|
||||
(package! ob-crystal :pin "d84c1adee4b269cdba06a97caedb8071561a09af"))
|
||||
(when (featurep! :lang go)
|
||||
(package! ob-go :pin "2067ed55f4"))
|
||||
(package! ob-go :pin "2067ed55f4c1d33a43cb3f6948609d240a8915f5"))
|
||||
(when (featurep! :lang hy)
|
||||
(package! ob-hy :pin "a42ecaf440"))
|
||||
(package! ob-hy :pin "a42ecaf440adc03e279afe43ee5ef6093ddd542a"))
|
||||
(when (featurep! :lang nim)
|
||||
(package! ob-nim :pin "bf1642cb93"))
|
||||
(package! ob-nim :pin "bf1642cb93f0a898804dc13fd9408d2964403bd2"))
|
||||
(when (featurep! :lang racket)
|
||||
(package! ob-racket
|
||||
:recipe (:host github :repo "DEADB17/ob-racket")
|
||||
:pin "d8fd51bddb"))
|
||||
:pin "d8fd51bddb019b0eb68755255f88fc800cfe03cb"))
|
||||
(when (featurep! :lang rest)
|
||||
(package! ob-restclient :pin "f7449b2068"))
|
||||
(package! ob-restclient :pin "f7449b2068498fe9d8ab9589e0a638148861533f"))
|
||||
(when (featurep! :lang rust)
|
||||
(package! ob-rust :pin "6a82587598"))
|
||||
(package! ob-rust :pin "6a82587598cd097e9642be916243c31f1231b24a"))
|
||||
(when (featurep! :lang scala)
|
||||
(package! ob-ammonite :pin "39937dff39"))
|
||||
(package! ob-ammonite :pin "39937dff395e70aff76a4224fa49cf2ec6c57cca"))
|
||||
|
||||
;;; Export
|
||||
(when (featurep! +pandoc)
|
||||
(package! ox-pandoc :pin "aa37dc7e94"))
|
||||
(package! ox-pandoc :pin "aa37dc7e94213d4ebedb85c384c1ba35007da18e"))
|
||||
(when (featurep! +hugo)
|
||||
(package! ox-hugo
|
||||
:recipe (:host github :repo "kaushalmodi/ox-hugo" :nonrecursive t)
|
||||
:pin "b6f4142de2"))
|
||||
:pin "8f36181977377383cb54803651d93b24e370122d"))
|
||||
(when (featurep! :lang rst)
|
||||
(package! ox-rst :pin "9158bfd180"))
|
||||
(package! ox-rst :pin "9158bfd18096c559e0a225ae62ab683f1c98a547"))
|
||||
|
|
|
@ -2,9 +2,15 @@
|
|||
|
||||
;; There's also `perl-mode' for perl < 6, which is already set up.
|
||||
|
||||
(use-package! perl6-detect)
|
||||
|
||||
(use-package! raku-mode
|
||||
:defer t
|
||||
:init
|
||||
(defalias 'perl6-mode #'raku-mode)
|
||||
:config
|
||||
(set-repl-handler! 'raku-mode #'run-raku))
|
||||
|
||||
|
||||
(use-package! flycheck-perl6
|
||||
(use-package! flycheck-raku
|
||||
:when (featurep! :checkers syntax)
|
||||
:after perl6-mode)
|
||||
:after raku-mode)
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
;; -*- no-byte-compile: t; -*-
|
||||
;;; lang/perl/packages.el
|
||||
|
||||
(package! perl6-mode :pin "88de065795")
|
||||
(package! raku-mode :pin "d474216840251dc0efe4f4aa4f5c5f66ac26fa74")
|
||||
|
||||
(when (featurep! :checkers syntax)
|
||||
(package! flycheck-perl6 :pin "b804702305"))
|
||||
(package! flycheck-raku
|
||||
:recipe (:host github :repo "widefox/flycheck-raku")
|
||||
:pin "046f35abe0c61967157e151126e4dd7ec5d1c004"))
|
||||
|
|
|
@ -25,6 +25,8 @@ Adds Python support to Doom Emacs.
|
|||
+ ~+lsp~ Language Server Protocol support
|
||||
+ ~+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]]
|
||||
|
||||
** Plugins
|
||||
|
@ -41,6 +43,8 @@ Adds Python support to Doom Emacs.
|
|||
+ [[https://github.com/necaris/conda.el][conda]]*
|
||||
+ ~+pyenv~
|
||||
+ [[https://github.com/pythonic-emacs/pyenv-mode][pyenv]]*
|
||||
+ ~+poetry~
|
||||
+ [[https://github.com/galaunay/poetry.el][poetry]]*
|
||||
+ ~+lsp~ and ~:tools lsp~
|
||||
+ [[https://github.com/emacs-lsp/lsp-mode][lsp]]
|
||||
+ [[https://github.com/emacs-lsp/lsp-python-ms][lsp-python-ms]]*
|
||||
|
@ -67,6 +71,7 @@ This module has no direct prerequisites. Here are some of its soft dependencies.
|
|||
+ 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]]
|
||||
|
||||
|
|
|
@ -280,6 +280,11 @@ called.")
|
|||
'append))
|
||||
|
||||
|
||||
(use-package! poetry
|
||||
:when (featurep! +poetry)
|
||||
:after python)
|
||||
|
||||
|
||||
(use-package! lsp-python-ms
|
||||
:when (featurep! +lsp)
|
||||
:after lsp-clients
|
||||
|
|
|
@ -20,6 +20,10 @@
|
|||
(unless (executable-find "conda")
|
||||
(warn! "Couldn't find conda in your PATH")))
|
||||
|
||||
(when (featurep! +poetry)
|
||||
(if (not (executable-find "poetry"))
|
||||
(warn! "Couldn't find poetry in your PATH")))
|
||||
|
||||
(when (featurep! +cython)
|
||||
(unless (executable-find "cython")
|
||||
(warn! "Couldn't find cython. cython-mode will not work.")))
|
||||
|
|
|
@ -24,6 +24,8 @@
|
|||
(package! pyenv-mode :pin "aec6f2aa28"))
|
||||
(when (featurep! +conda)
|
||||
(package! conda :pin "335474e409"))
|
||||
(when (featurep! +poetry)
|
||||
(package! poetry :pin "6dcc9d22ca"))
|
||||
|
||||
;; Testing frameworks
|
||||
(package! nose :pin "f852829751")
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
;; -*- no-byte-compile: t; -*-
|
||||
;;; lang/racket/packages.el
|
||||
|
||||
(package! racket-mode :pin "202cc1b784")
|
||||
(package! racket-mode :pin "8f3b214a5ea06e6a2a9492e7d20b19badd0c3bdf")
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue