mirror of
https://gitlab.com/dwt1/dotfiles.git
synced 2026-04-22 19:10:24 +10:00
Minor updates.
This commit is contained in:
@@ -13,11 +13,19 @@
|
||||
:desc "Encrypt buffer" "e" #'ansible-encrypt-buffer
|
||||
:desc "Look up in Ansible docs" "h" #'ansible-doc))
|
||||
|
||||
|
||||
(after! ansible-doc
|
||||
(set-evil-initial-state! '(ansible-doc-module-mode) 'emacs))
|
||||
|
||||
|
||||
(use-package! jinja2-mode
|
||||
:mode "\\.j2$")
|
||||
:mode "\\.j2$"
|
||||
:config
|
||||
;; The default behavior is to reindent the whole buffer on save. This is
|
||||
;; disruptive and imposing. There are indentation commands available; the user
|
||||
;; can decide when they want their code reindented.
|
||||
(setq jinja2-enable-indent-on-save nil))
|
||||
|
||||
|
||||
(def-project-mode! +ansible-yaml-mode
|
||||
:modes '(yaml-mode)
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
;; -*- no-byte-compile: t; -*-
|
||||
;;; tools/ansible/packages.el
|
||||
|
||||
(package! ansible :recipe (:nonrecursive t) :pin "c6532e52161a381ed3dddfeaa7c92ae636d3f052")
|
||||
(package! ansible :recipe (:nonrecursive t) :pin "b5ef59406604bc5027f4d816d90e633feef0149c")
|
||||
(package! ansible-doc :pin "86083a7bb2ed0468ca64e52076b06441a2f8e9e0")
|
||||
(package! jinja2-mode :pin "4540f99a3e363403a633587e05a9707605c16473")
|
||||
(package! jinja2-mode :pin "ecd19a40b7832bb00f0a2244e3b0713d0bf3850d")
|
||||
(package! yaml-mode :pin "34648f2502f52f4744d62758fa381fa35db1da49")
|
||||
|
||||
(when (featurep! :completion company)
|
||||
|
||||
@@ -16,6 +16,20 @@
|
||||
(realgud:trepanpl :modes (perl-mode perl6-mode))
|
||||
(realgud:zshdb :modes (sh-mode))))
|
||||
|
||||
(defvar +debugger--dap-alist
|
||||
`(((:lang cc +lsp) :after ccls :require (dap-lldb dap-gdb-lldb))
|
||||
((:lang elixir +lsp) :after elixir-mode :require dap-elixir)
|
||||
((:lang go +lsp) :after go-mode :require dap-go)
|
||||
((:lang java +lsp) :after java-mode :require lsp-java)
|
||||
((:lang php +lsp) :after php-mode :require dap-php)
|
||||
((:lang python +lsp) :after python :require dap-python)
|
||||
((:lang ruby +lsp) :after ruby-mode :require dap-ruby)
|
||||
((:lang rust +lsp) :after rust-mode :require dap-lldb)
|
||||
((:lang javascript +lsp)
|
||||
:after (js2-mode typescript-mode)
|
||||
:require (dap-node dap-chrome dap-firefox ,@(if IS-WINDOWS '(dap-edge)))))
|
||||
"TODO")
|
||||
|
||||
|
||||
;;
|
||||
;;; Packages
|
||||
@@ -97,30 +111,21 @@
|
||||
(setq dap-breakpoints-file (concat doom-etc-dir "dap-breakpoints")
|
||||
dap-utils-extension-path (concat doom-etc-dir "dap-extension/"))
|
||||
:config
|
||||
(dolist (module '(((:lang . cc) ccls dap-lldb dap-gdb-lldb)
|
||||
((:lang . elixir) elixir-mode dap-elixir)
|
||||
((:lang . go) go-mode dap-go)
|
||||
((:lang . java) lsp-java dap-java)
|
||||
((:lang . php) php-mode dap-php)
|
||||
((:lang . python) python dap-python)
|
||||
((:lang . ruby) ruby-mode dap-ruby)
|
||||
((:lang . rust) rust-mode dap-lldb)))
|
||||
(when (doom-module-p (caar module) (cdar module) '+lsp)
|
||||
(with-eval-after-load (nth 1 module)
|
||||
(mapc #'require (cddr module)))))
|
||||
(pcase-dolist (`((,category . ,modules) :after ,after :require ,libs)
|
||||
+debugger--dap-alist)
|
||||
(when (doom-module-p category (car modules) (cadr modules))
|
||||
(dolist (lib (doom-enlist after))
|
||||
(with-eval-after-load lib
|
||||
(mapc #'require (doom-enlist libs))))))
|
||||
|
||||
(when (featurep! :lang javascript +lsp)
|
||||
(after! (:or js2-mode typescript-mode)
|
||||
(require 'dap-node)
|
||||
(require 'dap-chrome)
|
||||
(require 'dap-firefox)
|
||||
(when IS-WINDOWS
|
||||
(require 'dap-edge))))
|
||||
(dap-mode 1)
|
||||
|
||||
(dap-mode 1))
|
||||
(map! :localleader
|
||||
:map dap-mode-map
|
||||
"d" #'dap-hydra))
|
||||
|
||||
|
||||
(use-package! dap-ui-mode
|
||||
(use-package! dap-ui
|
||||
:when (featurep! +lsp)
|
||||
:hook (dap-mode . dap-ui-mode)
|
||||
:hook (dap-ui-mode . dap-ui-controls-mode))
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
;; -*- no-byte-compile: t; -*-
|
||||
;;; tools/debugger/packages.el
|
||||
|
||||
(when (package! realgud :pin "1238d8e72945a84bb06cd39d7ded75f37105d4d2")
|
||||
(when (package! realgud :pin "5b0ed08364b1f5e2df2f3f7d5a6e7a2fedb5189a")
|
||||
(when (featurep! :lang javascript)
|
||||
(package! realgud-trepan-ni :pin "6e9cac5e8097018aadf41c88de541168036cc227")))
|
||||
(package! realgud-trepan-ni :pin "6e38cf838c7b47b5f1353d00901b939ffa36d707")))
|
||||
|
||||
(when (featurep! +lsp)
|
||||
(package! dap-mode :pin "7ad915794b75481f12b3f02ac8f5c9bcfddd6938")
|
||||
(package! posframe :pin "6285217711bc846e565940261829b523e298f82e"))
|
||||
(package! dap-mode :pin "85a61630499bb836bdb378fb62ea4ddd4f61a2dd")
|
||||
(package! posframe :pin "6d604a71deb45295f7b6ff3f98e06aeece9888be"))
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
;; -*- no-byte-compile: t; -*-
|
||||
;;; tools/ein/packages.el
|
||||
|
||||
(package! ein :pin "ee31cdb77de397bdff01abf5ffa087f384517f0c")
|
||||
(package! ein :pin "ccbed30c991623d56a310d02c76f03d571e90e82")
|
||||
|
||||
@@ -77,7 +77,7 @@
|
||||
(get-buffer-window (or (+eval--ensure-in-repl-buffer)
|
||||
t))))
|
||||
(+eval/send-region-to-repl beg end)
|
||||
(if-let (runner (cdr (assq major-mode +eval-runners)))
|
||||
(if-let (runner (alist-get major-mode +eval-runners))
|
||||
(funcall runner beg end)
|
||||
(quickrun-region beg end)))))
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
(defun +eval-open-repl (prompt-p &optional displayfn)
|
||||
(cl-destructuring-bind (_mode fn . plist)
|
||||
(or (assq major-mode +eval-repls)
|
||||
(list))
|
||||
(list nil nil))
|
||||
(when (or (not fn) prompt-p)
|
||||
(let* ((choices (or (cl-loop for sym being the symbols
|
||||
for sym-name = (symbol-name sym)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
;; -*- no-byte-compile: t; -*-
|
||||
;;; tools/eval/packages.el
|
||||
|
||||
(package! quickrun :pin "c6ce1f315b768af8688d06bc57d2eb403f875a63")
|
||||
(package! quickrun :pin "ce7383c53215077f7e1d258d389cf8731309fbe9")
|
||||
(when (featurep! +overlay)
|
||||
(package! eros :pin "dd8910279226259e100dab798b073a52f9b4233a"))
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
- [[#associating-lookup-handlers-with-major-modes][Associating lookup handlers with major modes]]
|
||||
- [[#associating-dash-docsets-with-major-modes][Associating Dash docsets with major modes]]
|
||||
- [[#open-in-eww-instead-of-browser][Open in eww instead of browser]]
|
||||
- [[#open-in-xwidget-webkit-instead-of-browser][Open in Xwidget WebKit instead of browser]]
|
||||
- [[#appendix][Appendix]]
|
||||
- [[#commands][Commands]]
|
||||
|
||||
@@ -40,7 +41,6 @@ or synonyms.
|
||||
+ ~+dictionary~ Enable word definition and thesaurus lookup functionality.
|
||||
+ ~+offline~ Install and prefer offline dictionary/thesaurus.
|
||||
+ ~+docsets~ Enable integration with Dash.app docsets.
|
||||
+ ~+xwidget~ Enable integration with [[https://www.gnu.org/software/emacs/manual/html_node/emacs/Embedded-WebKit-Widgets.html][Embedded Webkit Widgets]].
|
||||
|
||||
** Plugins
|
||||
+ [[https://github.com/jacktasia/dumb-jump][dumb-jump]]
|
||||
@@ -208,13 +208,23 @@ This determines what docsets to implicitly search for when you use
|
||||
docsets must be installed with ~+lookup/install-docset~.
|
||||
|
||||
** Open in eww instead of browser
|
||||
To open results from ~+lookup/online~ in EWW instead of your system browser,
|
||||
change ~+lookup-open-url-fn~ (default: ~#'browse-url~):
|
||||
To open results from ~+lookup/online~ or ~+lookup/in-docsets~ in EWW instead
|
||||
of your system browser, change ~+lookup-open-url-fn~ (default:
|
||||
~#'browse-url~):
|
||||
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(setq +lookup-open-url-fn #'eww)
|
||||
#+END_SRC
|
||||
|
||||
** Open in Xwidget WebKit instead of browser
|
||||
To open results from ~+lookup/online~ or ~+lookup/in-docsets~ in Xwidget
|
||||
WebKit instead of your system browser, set ~+lookup-open-url-fn~ to
|
||||
~+lookup-xwidget-webkit-open-url-fn~ (needs Emacs with Xwidgets support):
|
||||
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(setq +lookup-open-url-fn #'+lookup-xwidget-webkit-open-url-fn)
|
||||
#+END_SRC
|
||||
|
||||
* Appendix
|
||||
** Commands
|
||||
+ ~+lookup/definition~
|
||||
|
||||
@@ -192,6 +192,18 @@ This can be passed nil as its second argument to unset handlers for MODES. e.g.
|
||||
'deferred
|
||||
t))))
|
||||
|
||||
(defun +lookup-dictionary-definition-backend-fn (identifier)
|
||||
"Look up dictionary definition for IDENTIFIER."
|
||||
(when (derived-mode-p 'text-mode)
|
||||
(+lookup/dictionary-definition identifier)
|
||||
'deferred))
|
||||
|
||||
(defun +lookup-thesaurus-definition-backend-fn (identifier)
|
||||
"Look up synonyms for IDENTIFIER."
|
||||
(when (derived-mode-p 'text-mode)
|
||||
(+lookup/synonyms identifier)
|
||||
'deferred))
|
||||
|
||||
(defun +lookup-xref-definitions-backend-fn (identifier)
|
||||
"Non-interactive wrapper for `xref-find-definitions'"
|
||||
(+lookup--xref-show 'xref-backend-definitions identifier #'xref--show-defs))
|
||||
@@ -343,7 +355,7 @@ Otherwise, falls back on `find-file-at-point'."
|
||||
(list (or (doom-thing-at-point-or-region 'word)
|
||||
(read-string "Look up in dictionary: "))
|
||||
current-prefix-arg))
|
||||
(message "Looking up definition for %S" identifier)
|
||||
(message "Looking up dictionary definition for %S" identifier)
|
||||
(cond ((and IS-MAC (require 'osx-dictionary nil t))
|
||||
(osx-dictionary--view-result identifier))
|
||||
((and +lookup-dictionary-prefer-offline
|
||||
|
||||
@@ -16,24 +16,23 @@
|
||||
|
||||
;;;###autoload
|
||||
(defun +lookup-online-backend-fn (identifier)
|
||||
"Opens the browser and searches for IDENTIFIER online.
|
||||
|
||||
Will prompt for which search engine to use the first time (or if the universal
|
||||
argument is non-nil)."
|
||||
"Open the browser and search for IDENTIFIER online.
|
||||
When called for the first time, or with a non-nil prefix argument, prompt for
|
||||
the search engine to use."
|
||||
(+lookup/online
|
||||
identifier
|
||||
(+lookup--online-provider (not current-prefix-arg))))
|
||||
|
||||
;;;###autoload
|
||||
(defun +lookup/online (query provider)
|
||||
"Looks up QUERY (a string) in you browser usin PROVIDER.
|
||||
"Look up QUERY in the browser using PROVIDER.
|
||||
When called interactively, prompt for a query and, when called for the first
|
||||
time, the provider from `+lookup-provider-url-alist'. In subsequent calls, reuse
|
||||
the previous provider. With a non-nil prefix argument, always prompt for the
|
||||
provider.
|
||||
|
||||
PROVIDER should be a key of `+lookup-provider-url-alist'.
|
||||
|
||||
When used interactively, it will prompt for a query and, for the first time, the
|
||||
provider from `+lookup-provider-url-alist'. On consecutive uses, the last
|
||||
provider will be reused. If the universal argument is supplied, always prompt
|
||||
for the provider."
|
||||
QUERY must be a string, and PROVIDER must be a key of
|
||||
`+lookup-provider-url-alist'."
|
||||
(interactive
|
||||
(list (if (use-region-p) (doom-thing-at-point-or-region))
|
||||
(+lookup--online-provider current-prefix-arg)))
|
||||
@@ -64,7 +63,7 @@ for the provider."
|
||||
|
||||
;;;###autoload
|
||||
(defun +lookup/online-select ()
|
||||
"Runs `+lookup/online', but always prompts for the provider to use."
|
||||
"Run `+lookup/online', but always prompt for the provider to use."
|
||||
(interactive)
|
||||
(let ((current-prefix-arg t))
|
||||
(call-interactively #'+lookup/online)))
|
||||
@@ -77,7 +76,7 @@ for the provider."
|
||||
(defvar counsel-search-engine)
|
||||
;;;###autoload
|
||||
(defun +lookup--online-backend-google (query)
|
||||
"Search google, starting with QUERY, with live autocompletion."
|
||||
"Search Google, starting with QUERY, with live autocompletion."
|
||||
(cond ((fboundp 'counsel-search)
|
||||
(let ((ivy-initial-inputs-alist `((t . ,query)))
|
||||
(counsel-search-engine 'google))
|
||||
@@ -91,7 +90,7 @@ for the provider."
|
||||
|
||||
;;;###autoload
|
||||
(defun +lookup--online-backend-duckduckgo (query)
|
||||
"Search duckduckgo, starting with QUERY, with live autocompletion."
|
||||
"Search DuckDuckGo, starting with QUERY, with live autocompletion."
|
||||
(cond ((fboundp 'counsel-search)
|
||||
(let ((ivy-initial-inputs-alist `((t . ,query)))
|
||||
(counsel-search-engine 'ddg))
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
("Wolfram alpha" "https://wolframalpha.com/input/?i=%s")
|
||||
("Wikipedia" "https://wikipedia.org/search-redirect.php?language=en&go=Go&search=%s"))
|
||||
(when (featurep! :lang rust)
|
||||
'(("Rust Docs" "https://doc.rust-lang.org/edition-guide/?search=%s"))))
|
||||
'(("Rust Docs" "https://doc.rust-lang.org/std/?search=%s"))))
|
||||
"An alist that maps online resources to either:
|
||||
|
||||
1. A search url (needs on '%s' to substitute with an url encoded query),
|
||||
@@ -41,7 +41,8 @@ Used by `+lookup/online'.")
|
||||
"Function to use to open search urls.")
|
||||
|
||||
(defvar +lookup-definition-functions
|
||||
'(+lookup-xref-definitions-backend-fn
|
||||
'(+lookup-dictionary-definition-backend-fn
|
||||
+lookup-xref-definitions-backend-fn
|
||||
+lookup-dumb-jump-backend-fn
|
||||
+lookup-project-search-backend-fn
|
||||
+lookup-evil-goto-definition-backend-fn)
|
||||
@@ -73,7 +74,8 @@ argument: the identifier at point. See `set-lookup-handlers!' about adding to
|
||||
this list.")
|
||||
|
||||
(defvar +lookup-references-functions
|
||||
'(+lookup-xref-references-backend-fn
|
||||
'(+lookup-thesaurus-definition-backend-fn
|
||||
+lookup-xref-references-backend-fn
|
||||
+lookup-project-search-backend-fn)
|
||||
"Functions for `+lookup/references' to try, before resorting to `dumb-jump'.
|
||||
Stops at the first function to return non-nil or change the current
|
||||
@@ -116,8 +118,6 @@ Used by `+lookup/dictionary-definition' and `+lookup/synonyms'.
|
||||
For `+lookup/dictionary-definition', this is ignored on Mac, where Emacs users
|
||||
Dictionary.app behind the scenes to get definitions.")
|
||||
|
||||
(defvar +lookup--dash-docs-xwidget-webkit-last-session-buffer nil)
|
||||
|
||||
|
||||
;;
|
||||
;;; dumb-jump
|
||||
@@ -186,34 +186,6 @@ Dictionary.app behind the scenes to get definitions.")
|
||||
dash-docs-min-length 2
|
||||
dash-docs-browser-func #'eww)
|
||||
|
||||
;; Before `gnutls' is loaded, `gnutls-algorithm-priority' is treated as a
|
||||
;; lexical variable, which breaks `+lookup*fix-gnutls-error'
|
||||
(defvar gnutls-algorithm-priority)
|
||||
(defadvice! +lookup--fix-gnutls-error-a (orig-fn url)
|
||||
"Fixes integer-or-marker-p errors emitted from Emacs' url library,
|
||||
particularly, the `url-retrieve-synchronously' call in
|
||||
`dash-docs-read-json-from-url'. This is part of a systemic issue with Emacs 26's
|
||||
networking library (fixed in Emacs 27+, apparently).
|
||||
|
||||
See https://github.com/magit/ghub/issues/81"
|
||||
:around #'dash-docs-read-json-from-url
|
||||
(let ((gnutls-algorithm-priority "NORMAL:-VERS-TLS1.3"))
|
||||
(funcall orig-fn url)))
|
||||
|
||||
;; Dash docset + Xwidget integration
|
||||
(when (featurep! +xwidget)
|
||||
(defun +lookup-dash-docs-xwidget-webkit-browse-url-fn (url &optional new-session)
|
||||
(if (not (display-graphic-p))
|
||||
(eww url new-session)
|
||||
(setq xwidget-webkit-last-session-buffer +lookup--dash-docs-xwidget-webkit-last-session-buffer)
|
||||
(save-window-excursion
|
||||
(xwidget-webkit-browse-url url new-session))
|
||||
(with-popup-rules! '(("^\\*xwidget" :vslot -11 :size 0.35 :select nil))
|
||||
(pop-to-buffer xwidget-webkit-last-session-buffer))
|
||||
(setq +lookup--dash-docs-xwidget-webkit-last-session-buffer xwidget-webkit-last-session-buffer
|
||||
xwidget-webkit-last-session-buffer nil)))
|
||||
(setq dash-docs-browser-func #'+lookup-dash-docs-xwidget-webkit-browse-url-fn))
|
||||
|
||||
(cond ((featurep! :completion helm)
|
||||
(require 'helm-dash nil t))
|
||||
((featurep! :completion ivy)
|
||||
@@ -233,11 +205,5 @@ See https://github.com/magit/ghub/issues/81"
|
||||
collect (cons service #'+eval-display-results-in-popup))))
|
||||
|
||||
|
||||
(when (featurep! +dictionary)
|
||||
(define-key! text-mode-map
|
||||
[remap +lookup/definition] #'+lookup/dictionary-definition
|
||||
[remap +lookup/references] #'+lookup/synonyms))
|
||||
|
||||
|
||||
;;;###package synosaurus
|
||||
(setq synosaurus-choose-method 'default) ; use ivy/helm instead of ido
|
||||
|
||||
@@ -8,14 +8,14 @@
|
||||
(package! helm))
|
||||
|
||||
;;
|
||||
(package! dumb-jump :pin "d86f59c4c0eb9371dd84bc2aaff5d7445f04ba27")
|
||||
(package! dumb-jump :pin "b81573184c97fbc6181d0a4fe408caa23c0d621b")
|
||||
(when (featurep! :completion ivy)
|
||||
(package! ivy-xref :pin "3d4c35fe2b243d948d8fe02a1f0d76a249d63de9"))
|
||||
(when (featurep! :completion helm)
|
||||
(package! helm-xref :pin "6b4a8bd91f5eaf82f51bd31b03f6587387fe6983"))
|
||||
|
||||
;; For dictionary and online lookup
|
||||
(package! request :pin "912525c772984c6af0fd84acd6699ee43d91037a")
|
||||
(package! request :pin "d02d1347ffdf138cffd380cbeac62ac8732036ef")
|
||||
|
||||
(when (featurep! +docsets)
|
||||
(package! dash-docs :pin "dafc8fc9f1ddb2e4e39e0b8d066c42d5d7ce8d06")
|
||||
@@ -28,11 +28,7 @@
|
||||
(if IS-MAC
|
||||
(package! osx-dictionary :pin "1b79ff64c72485cb078db9ab7ee3256b11a99f4b")
|
||||
(package! define-word :pin "08c71b1ff4fd07bf0c78d1fcf77efeaafc8f7443")
|
||||
;; HACK Fix #2945: the main package is broken due to
|
||||
;; SavchenkoValeriy/emacs-powerthesaurus#11
|
||||
(package! powerthesaurus
|
||||
:recipe (:host github :repo "maxchaos/emacs-powerthesaurus" :branch "pt-api-change")
|
||||
:pin "4a834782a394f2dc70fc02d68b6962b44d87f0cf")
|
||||
(package! powerthesaurus :pin "93036d3b111925ebc34f747ff846cb0b8669b92e")
|
||||
(when (featurep! +offline)
|
||||
(package! wordnut :pin "feac531404041855312c1a046bde7ea18c674915")
|
||||
(package! synosaurus :pin "14d34fc92a77c3a916b4d58400424c44ae99cd81"))))
|
||||
|
||||
@@ -35,6 +35,7 @@ As of this writing, this is the state of LSP support in Doom Emacs:
|
||||
| Module | Major modes | Default language server |
|
||||
|------------------+---------------------------------------------------------+---------------------------------------------------------------|
|
||||
| [[../../lang/cc/README.org][:lang cc]] | c-mode, c++-mode, objc-mode | ccls |
|
||||
| [[../../lang/clojure/README.org][:lang clojure]] | clojure-mode | clojure-lsp |
|
||||
| [[../../lang/csharp/README.org][:lang csharp]] | csharp-mode | omnisharp |
|
||||
| [[../../lang/elixir/README.org][:lang elixir]] | elixir-mode | elixir-ls |
|
||||
| [[../../lang/fsharp/README.org][:lang fsharp]] | fsharp-mode | Mono, .NET core |
|
||||
|
||||
@@ -3,13 +3,11 @@
|
||||
|
||||
(if (featurep! +eglot)
|
||||
(progn
|
||||
(package! eglot :pin "ac9239bed5e3bfbf057382d1a75cdfa23f2caddd")
|
||||
(package! project
|
||||
:recipe (:host github :repo "emacs-straight/project")
|
||||
:pin "da0333a697b18f0a863c1b1523d2fc7991b31174"))
|
||||
(package! lsp-mode :pin "5f3f9848b2d4afc69049121c60126a6405447106")
|
||||
(package! lsp-ui :pin "d92cf83d95c9ca177b735500ead88cf68dc2e2db")
|
||||
(package! eglot :pin "fb6b17e86eddc22b9ec81f52718fad6bcbb53668")
|
||||
(package! project :pin "da0333a697b18f0a863c1b1523d2fc7991b31174"))
|
||||
(package! lsp-mode :pin "edb81194f0974643861a24d1bbc386dd53554748")
|
||||
(package! lsp-ui :pin "1f3e9700395f4fae024ca45ca64c8d70e99b39d2")
|
||||
(when (featurep! :completion ivy)
|
||||
(package! lsp-ivy :pin "dce58b5509271bbedb53ba9d0278dcb563a43977"))
|
||||
(package! lsp-ivy :pin "4cdb739fc2bc47f7d4dcad824f9240c70c4cb37d"))
|
||||
(when (featurep! :completion helm)
|
||||
(package! helm-lsp :pin "5018af9c709a783de1b9e101e07c948cceed67f1")))
|
||||
(package! helm-lsp :pin "5c960e7800dc8f4432f3a1466a637d484b87dc35")))
|
||||
|
||||
@@ -53,7 +53,29 @@
|
||||
magit-diff-mode
|
||||
magit-stash-mode
|
||||
magit-status-mode))))
|
||||
'(display-buffer-same-window))))))
|
||||
'(display-buffer-same-window))
|
||||
|
||||
('(+magit--display-buffer-in-direction))))))
|
||||
|
||||
(defun +magit--display-buffer-in-direction (buffer alist)
|
||||
"`display-buffer-alist' handler that opens BUFFER in a direction.
|
||||
|
||||
This differs from `display-buffer-in-direction' in one way: it will try to use a
|
||||
window that already exists in that direction. It will split otherwise."
|
||||
(let ((direction (or (alist-get 'direction alist)
|
||||
+magit-open-windows-in-direction)))
|
||||
(if-let (window (window-in-direction direction))
|
||||
(select-window window)
|
||||
(if-let (window (window-in-direction
|
||||
(pcase direction
|
||||
(`right 'left)
|
||||
(`left 'right)
|
||||
((or `up `above) 'down)
|
||||
((or `down `below) 'up))))
|
||||
(select-window window)
|
||||
(split-window-horizontally)))
|
||||
(switch-to-buffer buffer)
|
||||
(selected-window)))
|
||||
|
||||
|
||||
;;
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
;;; tools/magit/config.el -*- lexical-binding: t; -*-
|
||||
|
||||
(defvar +magit-open-windows-in-direction 'right
|
||||
"What direction to open new windows from the status buffer.
|
||||
For example, diffs and log buffers. Accepts `left', `right', `up', and `down'.")
|
||||
|
||||
|
||||
;;
|
||||
;;; Packages
|
||||
|
||||
(use-package! magit
|
||||
:commands magit-file-delete
|
||||
:defer-incrementally (dash f s with-editor git-commit package eieio lv transient)
|
||||
@@ -11,16 +19,11 @@
|
||||
transient-history-file (concat doom-etc-dir "transient/history"))
|
||||
:config
|
||||
(setq transient-default-level 5
|
||||
magit-revision-show-gravatars '("^Author: " . "^Commit: ")
|
||||
magit-diff-refine-hunk t ; show granular diffs in selected hunk
|
||||
;; Don't autosave repo buffers. This is too magical, and saving can
|
||||
;; trigger a bunch of unwanted side-effects, like save hooks and
|
||||
;; formatters. Trust us to know what we're doing.
|
||||
magit-save-repository-buffers nil
|
||||
;; Magit runs git *a lot*. Having to scan your PATH so many times can
|
||||
;; add up with each invokation, especially on Catalina (macOS) or
|
||||
;; Windows, so we resolve it once.
|
||||
magit-git-executable (executable-find magit-git-executable))
|
||||
magit-save-repository-buffers nil)
|
||||
(add-hook 'magit-process-mode-hook #'goto-address-mode)
|
||||
|
||||
(defadvice! +magit-revert-repo-buffers-deferred-a (&rest _)
|
||||
@@ -154,10 +157,7 @@ ensure it is built when we actually use Forge."
|
||||
:after magit
|
||||
:config
|
||||
(setq magit-todos-keyword-suffix "\\(?:([^)]+)\\)?:?") ; make colon optional
|
||||
(define-key magit-todos-section-map "j" nil)
|
||||
;; Warns that jT isn't bound. Well, yeah, you don't need to tell me, that was
|
||||
;; on purpose ya goose.
|
||||
(advice-add #'magit-todos-mode :around #'doom-shut-up-a))
|
||||
(define-key magit-todos-section-map "j" nil))
|
||||
|
||||
|
||||
(use-package! magit-gitflow
|
||||
@@ -179,8 +179,12 @@ ensure it is built when we actually use Forge."
|
||||
(evil-define-key* 'normal magit-status-mode-map [escape] nil) ; q is enough
|
||||
(evil-define-key* '(normal visual) magit-mode-map
|
||||
"%" #'magit-gitflow-popup
|
||||
"zt" #'evil-scroll-line-to-top
|
||||
"zz" #'evil-scroll-line-to-center
|
||||
"g=" #'magit-diff-default-context)
|
||||
"zb" #'evil-scroll-line-to-bottom
|
||||
"g=" #'magit-diff-default-context
|
||||
"gi" #'forge-jump-to-issues
|
||||
"gm" #'forge-jump-to-pullreqs)
|
||||
(define-key! 'normal
|
||||
(magit-status-mode-map
|
||||
magit-stash-mode-map
|
||||
@@ -193,4 +197,8 @@ ensure it is built when we actually use Forge."
|
||||
(setcar desc (cdr key))))
|
||||
(evil-define-key* evil-magit-state git-rebase-mode-map
|
||||
"gj" #'git-rebase-move-line-down
|
||||
"gk" #'git-rebase-move-line-up)))
|
||||
"gk" #'git-rebase-move-line-up))
|
||||
(transient-replace-suffix 'magit-dispatch 'magit-worktree
|
||||
'("%" "Gitflow" magit-gitflow-popup))
|
||||
(transient-append-suffix 'magit-dispatch '(0 -1 -1)
|
||||
'("*" "Worktree" magit-worktree)))
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
;; -*- no-byte-compile: t; -*-
|
||||
;;; tools/magit/packages.el
|
||||
|
||||
(when (package! magit :pin "793e387a508984ae2586b93ff78afddf7a1164ac")
|
||||
(when (package! magit :pin "798aff56457aef4d1896db8129ab56d08ae12066")
|
||||
(when (featurep! +forge)
|
||||
(package! forge :pin "6f299d2d84a0c92a6656a6db03656c2d554d2cac"))
|
||||
(package! forge :pin "2c487465d0b78ffe34252b47fcc06e27039330c4"))
|
||||
(package! magit-gitflow :pin "cc41b561ec6eea947fe9a176349fb4f771ed865b")
|
||||
(package! magit-todos :pin "a0e5d1f3c7dfcb4f18c1b0d57f1746a4872df5c6")
|
||||
(package! github-review :pin "50c6bcc7cf4d7193577b3f74eea4dd72f2b7795b")
|
||||
(package! github-review :pin "fab440aeae4fbf6a8192fd11795052e9eb5d27d1")
|
||||
(when (featurep! :editor evil +everywhere)
|
||||
(package! evil-magit :pin "88dc26ce59dbf4acb4e2891c79c4bd329553ba56")))
|
||||
|
||||
Reference in New Issue
Block a user