Minor updates.

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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