dev: merge branch 'master' of github.com:doomemacs
This commit is contained in:
commit
1747a74198
27 changed files with 172 additions and 152 deletions
|
@ -21,7 +21,7 @@
|
||||||
"^HOME$" "^\\(OLD\\)?PWD$" "^SHLVL$" "^PS1$" "^R?PROMPT$" "^TERM\\(CAP\\)?$"
|
"^HOME$" "^\\(OLD\\)?PWD$" "^SHLVL$" "^PS1$" "^R?PROMPT$" "^TERM\\(CAP\\)?$"
|
||||||
"^USER$" "^GIT_CONFIG" "^INSIDE_EMACS$"
|
"^USER$" "^GIT_CONFIG" "^INSIDE_EMACS$"
|
||||||
;; X server, Wayland, or services' env that shouldn't be persisted
|
;; X server, Wayland, or services' env that shouldn't be persisted
|
||||||
"^DISPLAY$" "^WAYLAND_DISPLAY" "^DBUS_SESSION_BUS_ADDRESS$" "^XAUTHORITY$"
|
"^\\(WAYLAND_\\)?DISPLAY$" "^DBUS_SESSION_BUS_ADDRESS$" "^XAUTHORITY$"
|
||||||
;; Windows+WSL envvars that shouldn't be persisted
|
;; Windows+WSL envvars that shouldn't be persisted
|
||||||
"^WSL_INTEROP$"
|
"^WSL_INTEROP$"
|
||||||
;; XDG variables that are best not persisted.
|
;; XDG variables that are best not persisted.
|
||||||
|
|
|
@ -704,6 +704,31 @@ original state.")
|
||||||
;; noninteractive sessions.
|
;; noninteractive sessions.
|
||||||
(advice-add #'straight-vc-git--popup-raw :override #'straight--popup-raw)
|
(advice-add #'straight-vc-git--popup-raw :override #'straight--popup-raw)
|
||||||
|
|
||||||
|
;; HACK: `native-comp' only respects `native-comp-jit-compilation-deny-list'
|
||||||
|
;; when native-compiling packages in interactive sessions. It ignores the
|
||||||
|
;; variable when, say, straight is building packages. This advice forces it to
|
||||||
|
;; obey it, even when used by straight (but only in the CLI).
|
||||||
|
(defadvice! doom-cli--native--compile-async-skip-p (fn files &optional recursively load selector)
|
||||||
|
:around #'native-compile-async
|
||||||
|
(let (file-list)
|
||||||
|
(dolist (file-or-dir (ensure-list files))
|
||||||
|
(cond ((file-directory-p file-or-dir)
|
||||||
|
(dolist (file (if recursively
|
||||||
|
(directory-files-recursively
|
||||||
|
file-or-dir comp-valid-source-re)
|
||||||
|
(directory-files file-or-dir
|
||||||
|
t comp-valid-source-re)))
|
||||||
|
(push file file-list)))
|
||||||
|
((file-exists-p file-or-dir)
|
||||||
|
(push file-or-dir file-list))
|
||||||
|
((signal 'native-compiler-error
|
||||||
|
(list "Not a file nor directory" file-or-dir)))))
|
||||||
|
(funcall fn (seq-remove (lambda (file)
|
||||||
|
(seq-some (lambda (re) (string-match-p re file))
|
||||||
|
native-comp-deferred-compilation-deny-list))
|
||||||
|
file-list)
|
||||||
|
recursively load selector)))
|
||||||
|
|
||||||
;; HACK Replace GUI popup prompts (which hang indefinitely in tty Emacs) with
|
;; HACK Replace GUI popup prompts (which hang indefinitely in tty Emacs) with
|
||||||
;; simple prompts.
|
;; simple prompts.
|
||||||
(defadvice! doom-cli--straight-fallback-to-y-or-n-prompt-a (fn &optional prompt noprompt?)
|
(defadvice! doom-cli--straight-fallback-to-y-or-n-prompt-a (fn &optional prompt noprompt?)
|
||||||
|
|
|
@ -140,7 +140,8 @@ uses a straight or package.el command directly).")
|
||||||
(after! comp
|
(after! comp
|
||||||
;; HACK Disable native-compilation for some troublesome packages
|
;; HACK Disable native-compilation for some troublesome packages
|
||||||
(mapc (doom-partial #'add-to-list 'native-comp-deferred-compilation-deny-list)
|
(mapc (doom-partial #'add-to-list 'native-comp-deferred-compilation-deny-list)
|
||||||
(list "/emacs-jupyter.*\\.el\\'"
|
(list "/seq-tests\\.el\\'"
|
||||||
|
"/emacs-jupyter.*\\.el\\'"
|
||||||
"/evil-collection-vterm\\.el\\'"
|
"/evil-collection-vterm\\.el\\'"
|
||||||
"/vterm\\.el\\'"
|
"/vterm\\.el\\'"
|
||||||
"/with-editor\\.el\\'"))))
|
"/with-editor\\.el\\'"))))
|
||||||
|
|
|
@ -170,7 +170,8 @@
|
||||||
|
|
||||||
:desc "Toggle last org-clock" "c" #'+org/toggle-last-clock
|
:desc "Toggle last org-clock" "c" #'+org/toggle-last-clock
|
||||||
:desc "Cancel current org-clock" "C" #'org-clock-cancel
|
:desc "Cancel current org-clock" "C" #'org-clock-cancel
|
||||||
:desc "Open deft" "d" #'deft
|
(:when (modulep! :ui deft)
|
||||||
|
:desc "Open deft" "d" #'deft)
|
||||||
(:when (modulep! :lang org +noter)
|
(:when (modulep! :lang org +noter)
|
||||||
:desc "Org noter" "e" #'org-noter)
|
:desc "Org noter" "e" #'org-noter)
|
||||||
|
|
||||||
|
|
|
@ -609,7 +609,8 @@
|
||||||
|
|
||||||
:desc "Toggle last org-clock" "c" #'+org/toggle-last-clock
|
:desc "Toggle last org-clock" "c" #'+org/toggle-last-clock
|
||||||
:desc "Cancel current org-clock" "C" #'org-clock-cancel
|
:desc "Cancel current org-clock" "C" #'org-clock-cancel
|
||||||
:desc "Open deft" "d" #'deft
|
(:when (modulep! :ui deft)
|
||||||
|
:desc "Open deft" "d" #'deft)
|
||||||
(:when (modulep! :lang org +noter)
|
(:when (modulep! :lang org +noter)
|
||||||
:desc "Org noter" "e" #'org-noter)
|
:desc "Org noter" "e" #'org-noter)
|
||||||
|
|
||||||
|
|
|
@ -8,6 +8,9 @@
|
||||||
|
|
||||||
;;;###autoload (autoload 'apheleia--get-formatters "apheleia-formatters")
|
;;;###autoload (autoload 'apheleia--get-formatters "apheleia-formatters")
|
||||||
|
|
||||||
|
;;;###autoload
|
||||||
|
(defvar +format--region-p nil)
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +format-region (start end &optional callback)
|
(defun +format-region (start end &optional callback)
|
||||||
"Format from START to END with `apheleia'."
|
"Format from START to END with `apheleia'."
|
||||||
|
@ -41,6 +44,7 @@
|
||||||
(when (> indent 0)
|
(when (> indent 0)
|
||||||
(indent-rigidly (point-min) (point-max) (- indent)))
|
(indent-rigidly (point-min) (point-max) (- indent)))
|
||||||
;;
|
;;
|
||||||
|
(let ((+format--region-p (cons start end)))
|
||||||
(apheleia-format-buffer
|
(apheleia-format-buffer
|
||||||
command
|
command
|
||||||
(lambda ()
|
(lambda ()
|
||||||
|
@ -51,12 +55,10 @@
|
||||||
(max 0 (- indent (+format--current-indentation)))))
|
(max 0 (- indent (+format--current-indentation)))))
|
||||||
(set-buffer-modified-p nil))
|
(set-buffer-modified-p nil))
|
||||||
(with-current-buffer cur-buffer
|
(with-current-buffer cur-buffer
|
||||||
(delete-region start end)
|
(with-silent-modifications
|
||||||
(goto-char start)
|
(replace-region-contents start end (lambda () formatted-buffer) 5))
|
||||||
(save-excursion
|
(when callback (funcall callback))
|
||||||
(insert-buffer-substring-no-properties formatted-buffer)
|
(kill-buffer formatted-buffer))))))
|
||||||
(when callback (funcall callback)))
|
|
||||||
(kill-buffer formatted-buffer)))))
|
|
||||||
(when (doom-region-active-p)
|
(when (doom-region-active-p)
|
||||||
(setq deactivate-mark t)))))
|
(setq deactivate-mark t)))))
|
||||||
|
|
||||||
|
|
|
@ -46,40 +46,38 @@ mode unconditionally, call `+format-with-lsp-mode' instead."
|
||||||
(cl-defun +format-lsp-buffer (&rest plist &key buffer callback &allow-other-keys)
|
(cl-defun +format-lsp-buffer (&rest plist &key buffer callback &allow-other-keys)
|
||||||
"Format the current buffer with any available lsp-mode or eglot formatter."
|
"Format the current buffer with any available lsp-mode or eglot formatter."
|
||||||
(if-let* ((fn (with-current-buffer buffer (+format--lsp-fn)))
|
(if-let* ((fn (with-current-buffer buffer (+format--lsp-fn)))
|
||||||
((apply fn plist)))
|
((apply fn (car +format--region-p) (cdr +format--region-p)
|
||||||
|
plist)))
|
||||||
(funcall callback)
|
(funcall callback)
|
||||||
(funcall callback "LSP server doesn't support formatting")))
|
(funcall callback "LSP server doesn't support formatting")))
|
||||||
|
|
||||||
(cl-defun +format--with-lsp-mode (&key buffer scratch &allow-other-keys)
|
(cl-defun +format--with-lsp-mode (beg end &key buffer &allow-other-keys)
|
||||||
"Format the current buffer with any available lsp-mode formatter."
|
"Format the current buffer or region with any available lsp-mode formatter.
|
||||||
|
|
||||||
|
Won't forward the buffer to chained formatters if successful."
|
||||||
(with-current-buffer buffer
|
(with-current-buffer buffer
|
||||||
(let ((edits
|
(let ((edits
|
||||||
(cond
|
(cond ((and (null beg) (lsp-feature? "textDocument/formatting"))
|
||||||
((lsp-feature? "textDocument/formatting")
|
|
||||||
(lsp-request "textDocument/formatting"
|
(lsp-request "textDocument/formatting"
|
||||||
(lsp--make-document-formatting-params)))
|
(lsp--make-document-formatting-params)))
|
||||||
((lsp-feature? "textDocument/rangeFormatting")
|
((lsp-feature? "textDocument/rangeFormatting")
|
||||||
(lsp-request "textDocument/rangeFormatting"
|
(lsp-request "textDocument/rangeFormatting"
|
||||||
(lsp--make-document-range-formatting-params
|
(lsp--make-document-range-formatting-params
|
||||||
(point-min) (point-max))))
|
(or beg (point-min)) (or end (point-max)))))
|
||||||
(:err))))
|
;; try next chained formatter(s)
|
||||||
(unless (eq edits :err)
|
((cl-return (ignore (funcall callback)))))))
|
||||||
(unless (seq-empty-p edits)
|
(unless (seq-empty-p edits)
|
||||||
(with-current-buffer scratch
|
(lsp--apply-text-edits edits 'format))
|
||||||
(lsp--apply-text-edits edits 'format)))
|
|
||||||
t))))
|
|
||||||
|
|
||||||
(cl-defun +format--with-eglot (&key buffer scratch &allow-other-keys)
|
|
||||||
"Format the current buffer with any available eglot formatter."
|
|
||||||
(with-current-buffer scratch
|
|
||||||
(when (setq-local
|
|
||||||
eglot--cached-server
|
|
||||||
(with-current-buffer buffer
|
|
||||||
(when (or (eglot-server-capable :documentFormattingProvider)
|
|
||||||
(eglot-server-capable :documentRangeFormattingProvider))
|
|
||||||
(eglot-current-server))))
|
|
||||||
(let ((buffer-file-name (buffer-file-name buffer)))
|
|
||||||
(eglot-format-buffer))
|
|
||||||
t)))
|
t)))
|
||||||
|
|
||||||
|
(cl-defun +format--with-eglot (beg end &key buffer callback &allow-other-keys)
|
||||||
|
"Format the current buffer or region with any available eglot formatter.
|
||||||
|
|
||||||
|
Won't forward the buffer to chained formatters if successful."
|
||||||
|
(with-current-buffer buffer
|
||||||
|
(or (with-demoted-errors "%s"
|
||||||
|
(always (eglot-format beg end)))
|
||||||
|
;; try next chained formatter(s)
|
||||||
|
(ignore (funcall callback)))))
|
||||||
|
|
||||||
;;; lsp.el ends here
|
;;; lsp.el ends here
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
'(sql-mode ; sqlformat is currently broken
|
'(sql-mode ; sqlformat is currently broken
|
||||||
tex-mode ; latexindent is broken
|
tex-mode ; latexindent is broken
|
||||||
latex-mode
|
latex-mode
|
||||||
|
LaTeX-mode
|
||||||
org-msg-edit-mode) ; doesn't need a formatter
|
org-msg-edit-mode) ; doesn't need a formatter
|
||||||
"A list of major modes in which to not reformat the buffer upon saving.
|
"A list of major modes in which to not reformat the buffer upon saving.
|
||||||
|
|
||||||
|
|
|
@ -105,27 +105,29 @@ Fixes #3939: unsortable dired entries on Windows."
|
||||||
(setq dirvish-subtree-always-show-state t)
|
(setq dirvish-subtree-always-show-state t)
|
||||||
(appendq! dirvish-attributes '(nerd-icons subtree-state)))
|
(appendq! dirvish-attributes '(nerd-icons subtree-state)))
|
||||||
|
|
||||||
;; HACK: Makes `dirvish-hide-details' accept a list of symbols to instruct
|
;; HACK: Makes `dirvish-hide-details' and `dirvish-hide-cursor' accept a list
|
||||||
;; Dirvish in what contexts `dirvish-hide-details' should be enabled. The
|
;; of symbols to instruct Dirvish in what contexts they should be enabled.
|
||||||
;; accepted values are:
|
;; The accepted values are:
|
||||||
;; - `dired': when opening a directory directly or w/o Dirvish's full UI.
|
;; - `dired': when opening a directory directly or w/o Dirvish's full UI.
|
||||||
;; - `dirvish': when opening full-frame Dirvish.
|
;; - `dirvish': when opening full-frame Dirvish.
|
||||||
;; - `dirvish-side': when opening Dirvish in the sidebar.
|
;; - `dirvish-side': when opening Dirvish in the sidebar.
|
||||||
;; REVIEW: Upstream this behavior later. (Maybe with similar treatment for
|
;; REVIEW: Upstream this behavior later.
|
||||||
;; `dirvish-hide-cursor'?)
|
(setq dirvish-hide-details '(dirvish dirvish-side)
|
||||||
(setq dirvish-hide-details '(dirvish dirvish-side))
|
dirvish-hide-cursor '(dirvish dirvish-side))
|
||||||
(defadvice! +dired--hide-details-maybe-a (fn &rest args)
|
(defadvice! +dired--hide-details-maybe-a (fn &rest args)
|
||||||
:around #'dirvish-init-dired-buffer
|
:around #'dirvish-init-dired-buffer
|
||||||
(let ((dirvish-hide-details
|
(letf! (defun enabled? (val)
|
||||||
(if (listp dirvish-hide-details)
|
(if (listp val)
|
||||||
(cond ((if dirvish--this (memq 'side (dv-type dirvish--this)))
|
(cond ((if dirvish--this (memq 'side (dv-type dirvish--this)))
|
||||||
(memq 'dirvish-side dirvish-hide-details))
|
(memq 'dirvish-side val))
|
||||||
((or (null dirvish--this)
|
((or (null dirvish--this)
|
||||||
(null (car (dv-layout dirvish--this))))
|
(null (car (dv-layout dirvish--this))))
|
||||||
(memq 'dired dirvish-hide-details))
|
(memq 'dired val))
|
||||||
((memq 'dirvish dirvish-hide-details)))
|
((memq 'dirvish val)))
|
||||||
dirvish-hide-details)))
|
val))
|
||||||
(apply fn args)))
|
(let ((dirvish-hide-details (enabled? dirvish-hide-details)))
|
||||||
|
(setq-local dirvish-hide-cursor (and (enabled? dirvish-hide-cursor) t))
|
||||||
|
(apply fn args))))
|
||||||
|
|
||||||
(when (modulep! :ui tabs)
|
(when (modulep! :ui tabs)
|
||||||
(after! centaur-tabs
|
(after! centaur-tabs
|
||||||
|
@ -143,6 +145,11 @@ Fixes #3939: unsortable dired entries on Windows."
|
||||||
:n "F" #'dirvish-layout-toggle
|
:n "F" #'dirvish-layout-toggle
|
||||||
:n "z" #'dirvish-history-jump
|
:n "z" #'dirvish-history-jump
|
||||||
:n "gh" #'dirvish-subtree-up
|
:n "gh" #'dirvish-subtree-up
|
||||||
|
:n "gl" #'dirvish-subtree-toggle
|
||||||
|
:n "h" #'dired-up-directory
|
||||||
|
:n "l" #'dired-find-file
|
||||||
|
:gm [left] #'dired-up-directory
|
||||||
|
:gm [right] #'dired-find-file
|
||||||
:m "[h" #'dirvish-history-go-backward
|
:m "[h" #'dirvish-history-go-backward
|
||||||
:m "]h" #'dirvish-history-go-forward
|
:m "]h" #'dirvish-history-go-forward
|
||||||
:m "[e" #'dirvish-emerge-next-group
|
:m "[e" #'dirvish-emerge-next-group
|
||||||
|
|
|
@ -37,7 +37,10 @@
|
||||||
"f" #'flutter-run
|
"f" #'flutter-run
|
||||||
"q" #'flutter-quit
|
"q" #'flutter-quit
|
||||||
"r" #'flutter-hot-reload
|
"r" #'flutter-hot-reload
|
||||||
"R" #'flutter-hot-restart)))
|
"R" #'flutter-hot-restart))
|
||||||
|
:config
|
||||||
|
(set-popup-rule! (concat "^" (regexp-quote flutter-buffer-name))
|
||||||
|
:ttl 0 :quit t))
|
||||||
|
|
||||||
|
|
||||||
(use-package! lsp-dart
|
(use-package! lsp-dart
|
||||||
|
|
|
@ -234,6 +234,7 @@ See `+emacs-lisp-non-package-mode' for details.")
|
||||||
:around #'elisp-demos--symbols
|
:around #'elisp-demos--symbols
|
||||||
:around #'elisp-demos--syntax-highlight
|
:around #'elisp-demos--syntax-highlight
|
||||||
(let ((org-inhibit-startup t)
|
(let ((org-inhibit-startup t)
|
||||||
|
(doom-inhibit-local-var-hooks t)
|
||||||
enable-dir-local-variables
|
enable-dir-local-variables
|
||||||
org-mode-hook)
|
org-mode-hook)
|
||||||
(apply fn args))))
|
(apply fn args))))
|
||||||
|
|
|
@ -13,7 +13,6 @@ This module adds [[https://golang.org][Go]] support, with optional (but recommen
|
||||||
- REPL (~gore~)
|
- REPL (~gore~)
|
||||||
- Syntax-checking (~flycheck~)
|
- Syntax-checking (~flycheck~)
|
||||||
- Auto-formatting on save (~gofmt~) (requires [[doom-module::editor format +onsave]])
|
- Auto-formatting on save (~gofmt~) (requires [[doom-module::editor format +onsave]])
|
||||||
- Code navigation & refactoring (~go-guru~)
|
|
||||||
- [[../../editor/file-templates/templates/go-mode][File templates]]
|
- [[../../editor/file-templates/templates/go-mode][File templates]]
|
||||||
- [[https://github.com/hlissner/doom-snippets/tree/master/go-mode][Snippets]]
|
- [[https://github.com/hlissner/doom-snippets/tree/master/go-mode][Snippets]]
|
||||||
- Generate testing code (~go-gen-test~)
|
- Generate testing code (~go-gen-test~)
|
||||||
|
@ -36,7 +35,6 @@ This module adds [[https://golang.org][Go]] support, with optional (but recommen
|
||||||
- [[doom-package:flycheck-golangci-lint]] if [[doom-module::checkers syntax]]
|
- [[doom-package:flycheck-golangci-lint]] if [[doom-module::checkers syntax]]
|
||||||
- [[doom-package:go-eldoc]]
|
- [[doom-package:go-eldoc]]
|
||||||
- [[doom-package:go-gen-test]]
|
- [[doom-package:go-gen-test]]
|
||||||
- [[doom-package:go-guru]]
|
|
||||||
- [[doom-package:go-mode]]
|
- [[doom-package:go-mode]]
|
||||||
- [[doom-package:gorepl-mode]]
|
- [[doom-package:gorepl-mode]]
|
||||||
- [[doom-package:go-tag]]
|
- [[doom-package:go-tag]]
|
||||||
|
@ -64,7 +62,6 @@ below.
|
||||||
- ~godoc~ (for documentation lookup)
|
- ~godoc~ (for documentation lookup)
|
||||||
- ~gorename~ (for extra refactoring commands)
|
- ~gorename~ (for extra refactoring commands)
|
||||||
- ~gore~ (for the REPL)
|
- ~gore~ (for the REPL)
|
||||||
- ~guru~ (for code navigation & refactoring commands)
|
|
||||||
- ~goimports~ (/optional/: for auto-formatting code on save & fixing imports)
|
- ~goimports~ (/optional/: for auto-formatting code on save & fixing imports)
|
||||||
- ~gotests~ (for generate test code)
|
- ~gotests~ (for generate test code)
|
||||||
- ~gomodifytags~ (for manipulating tags)
|
- ~gomodifytags~ (for manipulating tags)
|
||||||
|
@ -77,7 +74,6 @@ go install github.com/stamblerre/gocode@latest
|
||||||
go install golang.org/x/tools/cmd/godoc@latest
|
go install golang.org/x/tools/cmd/godoc@latest
|
||||||
go install golang.org/x/tools/cmd/goimports@latest
|
go install golang.org/x/tools/cmd/goimports@latest
|
||||||
go install golang.org/x/tools/cmd/gorename@latest
|
go install golang.org/x/tools/cmd/gorename@latest
|
||||||
go install golang.org/x/tools/cmd/guru@latest
|
|
||||||
go install github.com/cweill/gotests/gotests@latest
|
go install github.com/cweill/gotests/gotests@latest
|
||||||
go install github.com/fatih/gomodifytags@latest
|
go install github.com/fatih/gomodifytags@latest
|
||||||
#+end_src
|
#+end_src
|
||||||
|
@ -102,16 +98,6 @@ go install github.com/fatih/gomodifytags@latest
|
||||||
| [[kbd:][<localleader> b b]] | run ~$ go build~ |
|
| [[kbd:][<localleader> b b]] | run ~$ go build~ |
|
||||||
| [[kbd:][<localleader> b r]] | run ~$ go run .~ |
|
| [[kbd:][<localleader> b r]] | run ~$ go run .~ |
|
||||||
| [[kbd:][<localleader> h .]] | lookup symbol at point in godoc |
|
| [[kbd:][<localleader> h .]] | lookup symbol at point in godoc |
|
||||||
| [[kbd:][<localleader> h d]] | describe symbol at point |
|
|
||||||
| [[kbd:][<localleader> h v]] | list free variables |
|
|
||||||
| [[kbd:][<localleader> h i]] | list implements relations for package types |
|
|
||||||
| [[kbd:][<localleader> h p]] | list peers for channel |
|
|
||||||
| [[kbd:][<localleader> h P]] | "what does this point to" |
|
|
||||||
| [[kbd:][<localleader> h r]] | list references to object |
|
|
||||||
| [[kbd:][<localleader> h e]] | which errors |
|
|
||||||
| [[kbd:][<localleader> h w]] | what query |
|
|
||||||
| [[kbd:][<localleader> h c]] | show callers of function at point |
|
|
||||||
| [[kbd:][<localleader> h C]] | show callees of function at point |
|
|
||||||
| [[kbd:][<localleader> t t]] | rerun last test |
|
| [[kbd:][<localleader> t t]] | rerun last test |
|
||||||
| [[kbd:][<localleader> t a]] | run all tests in project |
|
| [[kbd:][<localleader> t a]] | run all tests in project |
|
||||||
| [[kbd:][<localleader> t f]] | run all tests in current file |
|
| [[kbd:][<localleader> t f]] | run all tests in current file |
|
||||||
|
|
|
@ -7,8 +7,6 @@
|
||||||
(set-docsets! 'go-mode "Go")
|
(set-docsets! 'go-mode "Go")
|
||||||
(set-repl-handler! 'go-mode #'gorepl-run)
|
(set-repl-handler! 'go-mode #'gorepl-run)
|
||||||
(set-lookup-handlers! 'go-mode
|
(set-lookup-handlers! 'go-mode
|
||||||
:definition #'go-guru-definition
|
|
||||||
:references #'go-guru-referrers
|
|
||||||
:documentation #'godoc-at-point)
|
:documentation #'godoc-at-point)
|
||||||
|
|
||||||
(if (modulep! +lsp)
|
(if (modulep! +lsp)
|
||||||
|
@ -25,20 +23,9 @@
|
||||||
"e" #'+go/play-buffer-or-region
|
"e" #'+go/play-buffer-or-region
|
||||||
"i" #'go-goto-imports ; Go to imports
|
"i" #'go-goto-imports ; Go to imports
|
||||||
(:prefix ("h" . "help")
|
(:prefix ("h" . "help")
|
||||||
"." #'godoc-at-point ; Lookup in godoc
|
"." #'godoc-at-point) ; Lookup in godoc
|
||||||
"d" #'go-guru-describe ; Describe this
|
|
||||||
"v" #'go-guru-freevars ; List free variables
|
|
||||||
"i" #'go-guru-implements ; Implements relations for package types
|
|
||||||
"p" #'go-guru-peers ; List peers for channel
|
|
||||||
"P" #'go-guru-pointsto ; What does this point to
|
|
||||||
"r" #'go-guru-referrers ; List references to object
|
|
||||||
"e" #'go-guru-whicherrs ; Which errors
|
|
||||||
"w" #'go-guru-what ; What query
|
|
||||||
"c" #'go-guru-callers ; Show callers of this function
|
|
||||||
"C" #'go-guru-callees) ; Show callees of this function
|
|
||||||
(:prefix ("ri" . "imports")
|
(:prefix ("ri" . "imports")
|
||||||
"a" #'go-import-add
|
"a" #'go-import-add)
|
||||||
"r" #'go-remove-unused-imports)
|
|
||||||
(:prefix ("b" . "build")
|
(:prefix ("b" . "build")
|
||||||
:desc "go run ." "r" (cmd! (compile "go run ."))
|
:desc "go run ." "r" (cmd! (compile "go run ."))
|
||||||
:desc "go build" "b" (cmd! (compile "go build"))
|
:desc "go build" "b" (cmd! (compile "go build"))
|
||||||
|
|
|
@ -9,9 +9,6 @@
|
||||||
(modulep! :tools tree-sitter))
|
(modulep! :tools tree-sitter))
|
||||||
"This module requires (:tools tree-sitter)")
|
"This module requires (:tools tree-sitter)")
|
||||||
|
|
||||||
(unless (executable-find "guru")
|
|
||||||
(warn! "Couldn't find guru. Refactoring commands (go-guru-*) won't work"))
|
|
||||||
|
|
||||||
(unless (executable-find "gore")
|
(unless (executable-find "gore")
|
||||||
(warn! "Couldn't find gore. REPL will not work"))
|
(warn! "Couldn't find gore. REPL will not work"))
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
;;; lang/go/packages.el
|
;;; lang/go/packages.el
|
||||||
|
|
||||||
(package! go-eldoc :pin "cbbd2ea1e94a36004432a9ac61414cb5a95a39bd")
|
(package! go-eldoc :pin "cbbd2ea1e94a36004432a9ac61414cb5a95a39bd")
|
||||||
(package! go-guru :pin "636d36e37a0d2b6adb2e12d802ff4794ccbba336")
|
|
||||||
(package! go-mode :pin "636d36e37a0d2b6adb2e12d802ff4794ccbba336")
|
(package! go-mode :pin "636d36e37a0d2b6adb2e12d802ff4794ccbba336")
|
||||||
(package! gorepl-mode :pin "6a73bf352e8d893f89cad36c958c4db2b5e35e07")
|
(package! gorepl-mode :pin "6a73bf352e8d893f89cad36c958c4db2b5e35e07")
|
||||||
(package! go-tag :pin "33f2059551d5298ca228d90f525b99d1a8d70364")
|
(package! go-tag :pin "33f2059551d5298ca228d90f525b99d1a8d70364")
|
||||||
|
|
|
@ -100,7 +100,8 @@ If no viewer is found, `latex-preview-pane-mode' is used.")
|
||||||
;; Hook LSP, if enabled.
|
;; Hook LSP, if enabled.
|
||||||
(when (modulep! +lsp)
|
(when (modulep! +lsp)
|
||||||
(add-hook! '(tex-mode-local-vars-hook
|
(add-hook! '(tex-mode-local-vars-hook
|
||||||
latex-mode-local-vars-hook)
|
latex-mode-local-vars-hook
|
||||||
|
LaTeX-mode-local-vars-hook)
|
||||||
:append #'lsp!))
|
:append #'lsp!))
|
||||||
;; Define a function to compile the project.
|
;; Define a function to compile the project.
|
||||||
(defun +latex/compile ()
|
(defun +latex/compile ()
|
||||||
|
|
|
@ -189,6 +189,8 @@ pacman -S texlive-core texlive-bin texlive-science texlive-latexextra
|
||||||
pacman -S gnuplot
|
pacman -S gnuplot
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
For [[doom-module:+jupyter]], install =jupyterlab= or =jupyter-notebook= ([[https://wiki.archlinux.org/title/Jupyter][source]]).
|
||||||
|
|
||||||
** Debian & Ubuntu
|
** Debian & Ubuntu
|
||||||
#+begin_src sh
|
#+begin_src sh
|
||||||
apt-get install texlive dvipng
|
apt-get install texlive dvipng
|
||||||
|
|
|
@ -116,9 +116,6 @@
|
||||||
(package! ob-async :pin "9aac486073f5c356ada20e716571be33a350a982")
|
(package! ob-async :pin "9aac486073f5c356ada20e716571be33a350a982")
|
||||||
(when (modulep! :lang clojure)
|
(when (modulep! :lang clojure)
|
||||||
(package! ob-clojure-literate
|
(package! ob-clojure-literate
|
||||||
:recipe (:type git
|
|
||||||
:host nil
|
|
||||||
:repo "https://repo.or.cz/ob-clojure-literate.el.git")
|
|
||||||
:pin "18c3ea15b872a43e67c899a9914182c35b00b7ee"))
|
:pin "18c3ea15b872a43e67c899a9914182c35b00b7ee"))
|
||||||
(when (modulep! :lang crystal)
|
(when (modulep! :lang crystal)
|
||||||
(package! ob-crystal :pin "d84c1adee4b269cdba06a97caedb8071561a09af"))
|
(package! ob-crystal :pin "d84c1adee4b269cdba06a97caedb8071561a09af"))
|
||||||
|
|
|
@ -12,6 +12,7 @@ This module adds support for PHP 5.3+ (including PHP8) to Doom Emacs.
|
||||||
- Code refactoring commands (~php-refactor-mode~)
|
- Code refactoring commands (~php-refactor-mode~)
|
||||||
- Unit-test commands (~phpunit~)
|
- Unit-test commands (~phpunit~)
|
||||||
- Support for ~laravel~ and ~composer~ projects (with project-specific snippets)
|
- Support for ~laravel~ and ~composer~ projects (with project-specific snippets)
|
||||||
|
- LSP support (via the [[doom-module:+lsp]] flag)
|
||||||
- [[../../editor/file-templates/templates/php-mode][File templates]]
|
- [[../../editor/file-templates/templates/php-mode][File templates]]
|
||||||
- [[https://github.com/hlissner/doom-snippets/tree/master/php-mode][Snippets]]
|
- [[https://github.com/hlissner/doom-snippets/tree/master/php-mode][Snippets]]
|
||||||
|
|
||||||
|
@ -31,8 +32,8 @@ This module adds support for PHP 5.3+ (including PHP8) to Doom Emacs.
|
||||||
- +hack ::
|
- +hack ::
|
||||||
Add support for the [[https://hacklang.org/][Hack dialect of PHP]] by Facebook.
|
Add support for the [[https://hacklang.org/][Hack dialect of PHP]] by Facebook.
|
||||||
- +lsp ::
|
- +lsp ::
|
||||||
Enable LSP support for ~php-mode~. Requires [[doom-module::tools lsp]] and a langserver
|
Enable LSP support for ~php-mode~. Requires [[doom-module::tools lsp]] and a
|
||||||
(supports [[https://phpactor.readthedocs.io/en/develop/usage/standalone.html][phpactor]] and intelephense).
|
langserver (supports [[https://emacs-lsp.github.io/lsp-mode/page/lsp-phpactor/][phpactor]], [[https://emacs-lsp.github.io/lsp-mode/page/lsp-intelephense/][intelephense]], [[https://emacs-lsp.github.io/lsp-mode/page/lsp-serenata/][serenata]], [[https://emacs-lsp.github.io/lsp-mode/page/lsp-php/][php-language-server]]).
|
||||||
- +tree-sitter ::
|
- +tree-sitter ::
|
||||||
Leverages tree-sitter for better syntax highlighting and structural text
|
Leverages tree-sitter for better syntax highlighting and structural text
|
||||||
editing. Requires [[doom-module::tools tree-sitter]].
|
editing. Requires [[doom-module::tools tree-sitter]].
|
||||||
|
@ -45,9 +46,6 @@ This module adds support for PHP 5.3+ (including PHP8) to Doom Emacs.
|
||||||
- [[doom-package:php-mode]]
|
- [[doom-package:php-mode]]
|
||||||
- [[doom-package:php-refactor-mode]]
|
- [[doom-package:php-refactor-mode]]
|
||||||
- [[doom-package:phpunit]]
|
- [[doom-package:phpunit]]
|
||||||
- if [[doom-module:+lsp]]
|
|
||||||
- [[doom-package:phpactor]]
|
|
||||||
- [[doom-package:company-phpactor]]
|
|
||||||
|
|
||||||
** Hacks
|
** Hacks
|
||||||
/No hacks documented for this module./
|
/No hacks documented for this module./
|
||||||
|
|
|
@ -50,7 +50,7 @@
|
||||||
:yield "use")
|
:yield "use")
|
||||||
|
|
||||||
(if (not (modulep! +lsp))
|
(if (not (modulep! +lsp))
|
||||||
;; `+php-company-backend' uses `company-phpactor', `php-extras-company' or
|
;; `+php-company-backend' uses `php-extras-company' or
|
||||||
;; `company-dabbrev-code', in that order.
|
;; `company-dabbrev-code', in that order.
|
||||||
(when +php--company-backends
|
(when +php--company-backends
|
||||||
(set-company-backend! 'php-mode
|
(set-company-backend! 'php-mode
|
||||||
|
@ -78,24 +78,6 @@
|
||||||
"s" #'phpunit-current-test))
|
"s" #'phpunit-current-test))
|
||||||
|
|
||||||
|
|
||||||
(use-package! phpactor
|
|
||||||
:unless (modulep! +lsp)
|
|
||||||
:after php-mode
|
|
||||||
:init
|
|
||||||
(add-to-list '+php--company-backends #'company-phpactor nil 'eq)
|
|
||||||
:config
|
|
||||||
(set-lookup-handlers! 'php-mode
|
|
||||||
:definition #'phpactor-goto-definition)
|
|
||||||
(map! :localleader
|
|
||||||
:map php-mode-map
|
|
||||||
:prefix ("r" . "refactor")
|
|
||||||
"cc" #'phpactor-copy-class
|
|
||||||
"mc" #'phpactor-move-class
|
|
||||||
"oi" #'phpactor-offset-info
|
|
||||||
"t" #'phpactor-transform
|
|
||||||
"ic" #'phpactor-import-class))
|
|
||||||
|
|
||||||
|
|
||||||
(use-package! php-refactor-mode
|
(use-package! php-refactor-mode
|
||||||
:hook php-mode
|
:hook php-mode
|
||||||
:config
|
:config
|
||||||
|
@ -111,13 +93,12 @@
|
||||||
(use-package! php-extras
|
(use-package! php-extras
|
||||||
:after php-mode
|
:after php-mode
|
||||||
:preface
|
:preface
|
||||||
|
(setq php-extras-eldoc-functions-file
|
||||||
|
(concat doom-profile-cache-dir "php-extras-eldoc-functions"))
|
||||||
;; We'll set up company support ourselves
|
;; We'll set up company support ourselves
|
||||||
(advice-add #'php-extras-company-setup :override #'ignore)
|
(advice-add #'php-extras-company-setup :override #'ignore)
|
||||||
:init
|
|
||||||
(add-to-list '+php--company-backends #'php-extras-company)
|
(add-to-list '+php--company-backends #'php-extras-company)
|
||||||
:config
|
:config
|
||||||
(setq php-extras-eldoc-functions-file
|
|
||||||
(concat doom-data-dir "php-extras-eldoc-functions"))
|
|
||||||
;; Silence warning if `php-extras-eldoc-functions-file' hasn't finished
|
;; Silence warning if `php-extras-eldoc-functions-file' hasn't finished
|
||||||
;; generating yet.
|
;; generating yet.
|
||||||
(defun php-extras-load-eldoc ()
|
(defun php-extras-load-eldoc ()
|
||||||
|
|
|
@ -15,10 +15,5 @@
|
||||||
:recipe (:host github :repo "hhvm/hack-mode")
|
:recipe (:host github :repo "hhvm/hack-mode")
|
||||||
:pin "ccf20511f0f2ed45d00d423c703bb91ab6a8b80c"))
|
:pin "ccf20511f0f2ed45d00d423c703bb91ab6a8b80c"))
|
||||||
|
|
||||||
(unless (modulep! +lsp)
|
|
||||||
(package! phpactor :pin "6b5269ff82785a9bd1e648b2f91e5128353d5a67")
|
|
||||||
(when (modulep! :completion company)
|
|
||||||
(package! company-phpactor :pin "6b5269ff82785a9bd1e648b2f91e5128353d5a67")))
|
|
||||||
|
|
||||||
;; For building php-extras
|
;; For building php-extras
|
||||||
(package! async :pin "cff2bd0be3c78a2eb76717eed60302972fe9b8c5")
|
(package! async :pin "cff2bd0be3c78a2eb76717eed60302972fe9b8c5")
|
||||||
|
|
|
@ -3,15 +3,24 @@
|
||||||
(use-package! plantuml-mode
|
(use-package! plantuml-mode
|
||||||
:commands plantuml-download-jar
|
:commands plantuml-download-jar
|
||||||
:init
|
:init
|
||||||
(setq plantuml-jar-path (concat doom-data-dir "plantuml.jar")
|
(setq plantuml-jar-path (concat doom-data-dir "plantuml.jar"))
|
||||||
org-plantuml-jar-path plantuml-jar-path)
|
|
||||||
:config
|
:config
|
||||||
(set-popup-rule! "^\\*PLANTUML" :size 0.4 :select nil :ttl 0)
|
(set-popup-rule! "^\\*PLANTUML" :size 0.4 :select nil :ttl 0)
|
||||||
|
|
||||||
(setq plantuml-default-exec-mode
|
(setq plantuml-default-exec-mode
|
||||||
(cond ((file-exists-p plantuml-jar-path) 'jar)
|
(cond ((file-exists-p plantuml-jar-path) 'jar)
|
||||||
((executable-find "plantuml") 'executable)
|
((executable-find plantuml-executable-path) 'executable)
|
||||||
(plantuml-default-exec-mode))))
|
(plantuml-default-exec-mode)))
|
||||||
|
;; HACK: If plantuml-jar-path is missing at startup, then plantuml-mode will
|
||||||
|
;; operate in another `plantuml-default-exec-mode'. After using
|
||||||
|
;; plantuml-download-jar, we change it to `jar' just for this session.
|
||||||
|
(defadvice! +plantuml--use-downloaded-jar-a (fn &rest args)
|
||||||
|
"Configure plantuml-mode to use the downloaded jar for this session."
|
||||||
|
:around #'plantuml-download-jar
|
||||||
|
(let ((downloaded? (not (file-exists-p plantuml-jar-path))))
|
||||||
|
(prog1 (apply fn args)
|
||||||
|
(when (and downloaded? (file-exists-p plantuml-jar-path))
|
||||||
|
(setq org-plantuml-jar-path plantuml-jar-path
|
||||||
|
plantuml-default-exec-mode 'jar))))))
|
||||||
|
|
||||||
|
|
||||||
(use-package! flycheck-plantuml
|
(use-package! flycheck-plantuml
|
||||||
|
@ -25,7 +34,13 @@
|
||||||
|
|
||||||
|
|
||||||
(after! ob-plantuml
|
(after! ob-plantuml
|
||||||
;; HACK Force ob-plantuml to use `plantuml-mode''s building mechanism, which
|
;; The nested `after!' is needed to ensure `org-plantuml-jar-path's new
|
||||||
|
;; default without overwriting any user config.
|
||||||
|
(after! plantuml-mode
|
||||||
|
(when (equal org-plantuml-jar-path "")
|
||||||
|
(setq org-plantuml-jar-path plantuml-jar-path)))
|
||||||
|
|
||||||
|
;; HACK: Force ob-plantuml to use `plantuml-mode''s building mechanism, which
|
||||||
;; is more sophisticated.
|
;; is more sophisticated.
|
||||||
(advice-add #'org-babel-execute:plantuml
|
(advice-add #'org-babel-execute:plantuml
|
||||||
:override #'+plantuml-org-babel-execute:plantuml-a)
|
:override #'+plantuml-org-babel-execute:plantuml-a)
|
||||||
|
|
|
@ -84,6 +84,9 @@ Can be a list of backends; accepts any value `company-backends' accepts.")
|
||||||
:implementations '(lsp-find-implementation :async t)
|
:implementations '(lsp-find-implementation :async t)
|
||||||
:type-definition #'lsp-find-type-definition)
|
:type-definition #'lsp-find-type-definition)
|
||||||
|
|
||||||
|
;; HACK: See emacs-lsp/lsp-mode#3577
|
||||||
|
(unless (modulep! :lang terraform)
|
||||||
|
(setq lsp-client-packages (delete 'lsp-terraform lsp-client-packages)))
|
||||||
|
|
||||||
(defadvice! +lsp--respect-user-defined-checkers-a (fn &rest args)
|
(defadvice! +lsp--respect-user-defined-checkers-a (fn &rest args)
|
||||||
"Ensure user-defined `flycheck-checker' isn't overwritten by `lsp'."
|
"Ensure user-defined `flycheck-checker' isn't overwritten by `lsp'."
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
;; -*- no-byte-compile: t; -*-
|
;; -*- no-byte-compile: t; -*-
|
||||||
;;; tools/magit/packages.el
|
;;; tools/magit/packages.el
|
||||||
|
|
||||||
;; NOTE: Always bump this to HEAD~1, not HEAD, because the latest commit on
|
;; NOTE: Always bump magit and forge to HEAD~1, not HEAD, because the latest
|
||||||
;; magit's melpa branch is auto-generated and moved to HEAD every time there's
|
;; commit on their melpa branches are auto-generated and moved to HEAD every
|
||||||
;; a commit to its main branch.
|
;; time there's a commit to its main branch.
|
||||||
(package! magit :pin "2da34f1317c619ec2dfb9e0d969449261ca7f31f")
|
(package! magit :pin "2da34f1317c619ec2dfb9e0d969449261ca7f31f")
|
||||||
(when (modulep! +forge)
|
(when (modulep! +forge)
|
||||||
(package! forge :pin "1e7ee99c7f76034e40210a6fd6007015b1998f6d")
|
(package! forge :pin "30f181f785522f2debf60945d6b589a65bc415f6")
|
||||||
(package! code-review
|
(package! code-review
|
||||||
:recipe (:host github
|
:recipe (:host github
|
||||||
:repo "doomelpa/code-review"
|
:repo "doomelpa/code-review"
|
||||||
|
|
|
@ -138,7 +138,10 @@ and cannot run in."
|
||||||
(setq +ligatures--init-font-hook nil)))
|
(setq +ligatures--init-font-hook nil)))
|
||||||
(when in-mode-extras-p
|
(when in-mode-extras-p
|
||||||
(prependq! prettify-symbols-alist
|
(prependq! prettify-symbols-alist
|
||||||
(alist-get major-mode +ligatures-extra-alist)))
|
(or (alist-get major-mode +ligatures-extra-alist)
|
||||||
|
(cl-loop for (mode . symbols) in +ligatures-extra-alist
|
||||||
|
if (derived-mode-p mode)
|
||||||
|
return symbols))))
|
||||||
(when (and (or in-mode-p in-mode-extras-p)
|
(when (and (or in-mode-p in-mode-extras-p)
|
||||||
prettify-symbols-alist)
|
prettify-symbols-alist)
|
||||||
(when prettify-symbols-mode
|
(when prettify-symbols-mode
|
||||||
|
|
|
@ -192,5 +192,21 @@ Respects `diff-hl-disable-on-remote'."
|
||||||
;; triggered from Elisp's buffer API (from what I can tell).
|
;; triggered from Elisp's buffer API (from what I can tell).
|
||||||
(defadvice! +vc-gutter--kill-diff-hl-thread-a (&optional buf)
|
(defadvice! +vc-gutter--kill-diff-hl-thread-a (&optional buf)
|
||||||
:before #'kill-buffer
|
:before #'kill-buffer
|
||||||
(with-current-buffer (or buf (current-buffer))
|
(when-let ((buf (ignore-errors (window-normalize-buffer buf))))
|
||||||
|
(with-current-buffer buf
|
||||||
(+vc-gutter--kill-thread t))))
|
(+vc-gutter--kill-thread t))))
|
||||||
|
|
||||||
|
;; HACK: diff-hl won't be visible in TTY frames, but there's no simple way to
|
||||||
|
;; use the fringe in GUI Emacs and use the margin in the terminal *AND*
|
||||||
|
;; support daemon users, so we need more than a static `display-graphic-p'
|
||||||
|
;; check at startup.
|
||||||
|
(when (modulep! :os tty)
|
||||||
|
(put 'diff-hl-mode 'last (display-graphic-p))
|
||||||
|
(add-hook! 'doom-switch-window-hook
|
||||||
|
(defun +vc-gutter-use-margins-in-tty-h ()
|
||||||
|
(let ((graphic? (display-graphic-p)))
|
||||||
|
(unless (and global-diff-hl-mode (eq (get 'diff-hl-mode 'last) graphic?))
|
||||||
|
(global-diff-hl-mode -1)
|
||||||
|
(diff-hl-margin-mode (if graphic? -1 +1))
|
||||||
|
(global-diff-hl-mode +1)
|
||||||
|
(put 'diff-hl-mode 'last graphic?)))))))
|
||||||
|
|
|
@ -118,7 +118,7 @@ Returns t on success, nil otherwise."
|
||||||
(unless (+workspace-exists-p name)
|
(unless (+workspace-exists-p name)
|
||||||
(error "'%s' is an invalid workspace" name))
|
(error "'%s' is an invalid workspace" name))
|
||||||
(let ((fname (expand-file-name +workspaces-data-file persp-save-dir)))
|
(let ((fname (expand-file-name +workspaces-data-file persp-save-dir)))
|
||||||
(persp-save-to-file-by-names fname *persp-hash* (list name))
|
(persp-save-to-file-by-names fname *persp-hash* (list name) t)
|
||||||
(and (member name (persp-list-persp-names-in-file fname))
|
(and (member name (persp-list-persp-names-in-file fname))
|
||||||
t)))
|
t)))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue