dev: merge branch 'master' of github.com:doomemacs
This commit is contained in:
commit
a2ae771393
36 changed files with 792 additions and 241 deletions
|
@ -22,7 +22,7 @@ https://assets.doomemacs.org/completion/company/overlay.png
|
|||
|
||||
** Module flags
|
||||
- +childframe ::
|
||||
Display completion candidates in a [[https://www.gnu.org/software/emacs/manual/html_node/elisp/Child-Frames.html][child frame]] rather than an overlay or
|
||||
Display completion candidates in a [[https://www.gnu.org/software/emacs/manual/html_node/elisp/Child-Frames.html][childframe]] rather than an overlay or
|
||||
tooltip. *Requires GUI Emacs.*
|
||||
- +tng ::
|
||||
Invoke completion on [[kbd:][TAB]] instad of [[kbd:][C-SPC]]. When company is active, [[kbd:][TAB]] and
|
||||
|
|
|
@ -511,8 +511,8 @@
|
|||
:desc "Copy link to homepage" "Y" #'+vc/browse-at-remote-kill-homepage
|
||||
:desc "Git time machine" "t" #'git-timemachine-toggle
|
||||
(:when (modulep! :ui vc-gutter)
|
||||
:desc "Revert hunk at point" "r" #'+vc-gutter/revert-hunk
|
||||
:desc "stage hunk at point" "s" #'+vc-gutter/stage-hunk
|
||||
:desc "Revert hunk at point" "r" #'+vc-gutter/save-and-revert-hunk
|
||||
:desc "Stage hunk at point" "s" #'+vc-gutter/stage-hunk
|
||||
:desc "Jump to next hunk" "]" #'+vc-gutter/next-hunk
|
||||
:desc "Jump to previous hunk" "[" #'+vc-gutter/previous-hunk)
|
||||
(:when (modulep! :tools magit)
|
||||
|
|
|
@ -181,8 +181,8 @@ This is performed with an asyncronous Emacs process, except when
|
|||
(defun +literate-recompile-maybe-h ()
|
||||
"Recompile literate config to `doom-user-dir'.
|
||||
|
||||
We assume any org file in `doom-user-dir' is connected to your literate
|
||||
config, and should trigger a recompile if changed."
|
||||
We assume any org file in `doom-user-dir' is connected to your literate config,
|
||||
and should trigger a recompile if changed."
|
||||
(and (file-in-directory-p
|
||||
(buffer-file-name (buffer-base-buffer))
|
||||
(file-name-directory (file-truename +literate-config-file)))
|
||||
|
|
|
@ -369,8 +369,7 @@ directives. By default, this only recognizes C directives.")
|
|||
;;
|
||||
;;; Keybinds
|
||||
|
||||
;; Keybinds that have no Emacs+evil analogues (i.e. don't exist):
|
||||
;; zu{q,w} - undo last marking
|
||||
;; TODO: zu{q,w} - undo last marking
|
||||
|
||||
(map! :v "@" #'+evil:apply-macro
|
||||
:m [C-i] #'evil-jump-forward
|
||||
|
@ -530,6 +529,7 @@ directives. By default, this only recognizes C directives.")
|
|||
;; evil-easymotion
|
||||
(:after evil-easymotion
|
||||
:m "gs" evilem-map
|
||||
;; TODO: Use named functions
|
||||
(:map evilem-map
|
||||
"a" (evilem-create #'evil-forward-arg)
|
||||
"A" (evilem-create #'evil-backward-arg)
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
#+title: `(+file-templates-module-for-path)`
|
||||
#+subtitle: <A one-line quip about this module to display in init.example.el>
|
||||
#+created: `(format-time-string "%B %d, %Y")`
|
||||
#+since: `(car (split-string doom-version "-"))` (#COMMIT-OR-PR-REF)
|
||||
#+since: `(car (split-string doom-modules-version "-"))` (#COMMIT-OR-PR-REF)
|
||||
|
||||
* Description :unfold:
|
||||
$0Replace this with a short (1-2 sentence) description of what this module does.
|
||||
|
|
|
@ -38,9 +38,6 @@ this."
|
|||
(after! org
|
||||
(setq org-ellipsis +fold-ellipsis))
|
||||
|
||||
(after! mule-util
|
||||
(setq truncate-string-ellipsis +fold-ellipsis))
|
||||
|
||||
|
||||
;;
|
||||
;;; Packages
|
||||
|
|
55
modules/emacs/eww/README.org
Normal file
55
modules/emacs/eww/README.org
Normal file
|
@ -0,0 +1,55 @@
|
|||
:PROPERTIES:
|
||||
:ID: 4f6e0ee2-7837-4d15-853f-c8863d065f21
|
||||
:END:
|
||||
#+title: :emacs eww
|
||||
#+subtitle: The internet is gross
|
||||
#+created: September 11, 2024
|
||||
#+since: 24.10
|
||||
|
||||
* Description :unfold:
|
||||
This module augments eww (Emacs Web Wowser); Emacs' built-in web browser, with
|
||||
some reasonable defaults and helper commands.
|
||||
|
||||
** Maintainers
|
||||
/This module has no dedicated maintainers./ [[doom-contrib-maintainer:][Become a maintainer?]]
|
||||
|
||||
** Module flags
|
||||
/This module has no flags./
|
||||
|
||||
** Packages
|
||||
/This module doesn't install any packages./
|
||||
|
||||
** Hacks
|
||||
- The buffer is renamed to match the current page's URL or title.
|
||||
|
||||
** TODO Changelog
|
||||
# This section will be machine generated. Don't edit it by hand.
|
||||
/This module does not have a changelog yet./
|
||||
|
||||
* Installation
|
||||
[[id:01cffea4-3329-45e2-a892-95a384ab2338][Enable this module in your ~doom!~ block.]]
|
||||
|
||||
/This module has no external requirements./
|
||||
|
||||
* Usage
|
||||
#+begin_quote
|
||||
/This module's usage documentation is incomplete./ [[doom-contrib-module:][Complete it?]]
|
||||
#+end_quote
|
||||
|
||||
Type ~M-x eww~ and enter an URL.
|
||||
|
||||
* TODO Configuration
|
||||
#+begin_quote
|
||||
This module has no configuration documentation yet. [[doom-contrib-module:][Write some?]]
|
||||
#+end_quote
|
||||
|
||||
* Troubleshooting
|
||||
/There are no known problems with this module./ [[doom-report:][Report one?]]
|
||||
|
||||
* Frequently asked questions
|
||||
/This module has no FAQs yet./ [[doom-suggest-faq:][Ask one?]]
|
||||
|
||||
* TODO Appendix
|
||||
#+begin_quote
|
||||
This module has no appendix yet. [[doom-contrib-module:][Write one?]]
|
||||
#+end_quote
|
128
modules/emacs/eww/autoload.el
Normal file
128
modules/emacs/eww/autoload.el
Normal file
|
@ -0,0 +1,128 @@
|
|||
;;; emacs/eww/autoload.el -*- lexical-binding: t; -*-
|
||||
|
||||
;; NOTE: Many of these functions were adapted from Protesilaos Stavrou's
|
||||
;; dotfiles. See https://protesilaos.com/codelog/2021-03-25-emacs-eww
|
||||
|
||||
;; Adapted from `prot-eww-jump-to-url-on-page'
|
||||
(defun eww--capture-url-on-page (&optional position)
|
||||
"Capture all the links on the current web page.
|
||||
|
||||
Return a list of strings. Strings are in the form LABEL @ URL.
|
||||
When optional argument POSITION is non-nil, include position info in the strings
|
||||
too, so strings take the form: LABEL @ URL ~ POSITION."
|
||||
(let (links match)
|
||||
(save-excursion
|
||||
(goto-char (point-max))
|
||||
;; NOTE 2021-07-25: The first clause in the `or' is meant to address a bug
|
||||
;; where if a URL is in `point-min' it does not get captured.
|
||||
(while (setq match (text-property-search-backward 'shr-url))
|
||||
(let* ((raw-url (prop-match-value match))
|
||||
(start-point-prop (prop-match-beginning match))
|
||||
(end-point-prop (prop-match-end match))
|
||||
(url (when (stringp raw-url)
|
||||
(propertize raw-url 'face 'link)))
|
||||
(label (replace-regexp-in-string
|
||||
"\n" " " ; NOTE 2021-07-25: newlines break completion
|
||||
(buffer-substring-no-properties
|
||||
start-point-prop end-point-prop)))
|
||||
(point start-point-prop)
|
||||
(line (line-number-at-pos point t))
|
||||
(column (save-excursion (goto-char point) (current-column)))
|
||||
(coordinates (propertize
|
||||
(format "%d,%d (%d)" line column point)
|
||||
'face 'shadow)))
|
||||
(when url
|
||||
(push (if position
|
||||
(format "%-15s ~ %s @ %s" coordinates label url)
|
||||
(format "%s @ %s" label url))
|
||||
links)))))
|
||||
links))
|
||||
|
||||
;; Adapted from `prot-eww--rename-buffer'
|
||||
(defun +eww-page-title-or-url (&rest _)
|
||||
(let ((prop (if (string-empty-p (plist-get eww-data :title)) :url :title)))
|
||||
(format "*%s # eww*" (plist-get eww-data prop))))
|
||||
|
||||
|
||||
;;
|
||||
;;; Commands
|
||||
|
||||
;; Adapted from `prot-eww-quit'
|
||||
;;;###autoload
|
||||
(defun +eww/quit ()
|
||||
"Quit eww and kill all its buffers."
|
||||
(interactive nil 'eww-mode)
|
||||
(when (yes-or-no-p "Are you sure you want to quit eww?")
|
||||
(save-match-data
|
||||
(cl-loop with case-fold-search = t
|
||||
for buf in (doom-buffer-list)
|
||||
if (with-current-buffer buf
|
||||
(or (eq major-mode 'eww-mode)
|
||||
(and (derived-mode-p 'special-mode)
|
||||
(string-match "\\*.*eww.*\\*" (buffer-name)))))
|
||||
do (kill-buffer buf)))))
|
||||
|
||||
;; Adapted from `prot-eww-jump-to-url-on-page'
|
||||
;;;###autoload
|
||||
(defun +eww/jump-to-url-on-page (&optional arg)
|
||||
"Jump to URL position on the page using completion.
|
||||
|
||||
When called without ARG (\\[universal-argument]) get URLs only
|
||||
from the visible portion of the buffer. But when ARG is provided
|
||||
consider whole buffer."
|
||||
(interactive "P" 'eww-mode)
|
||||
(unless (derived-mode-p 'eww-mode)
|
||||
(user-error "Not in an eww buffer!"))
|
||||
(let* ((links
|
||||
(if arg
|
||||
(eww--capture-url-on-page t)
|
||||
(save-restriction
|
||||
(if (use-region-p)
|
||||
(narrow-to-region (region-beginning) (region-end))
|
||||
(narrow-to-region (window-start) (window-end)))
|
||||
(eww--capture-url-on-page t))))
|
||||
(prompt-scope (if arg
|
||||
(propertize "URL on the page" 'face 'warning)
|
||||
"visible URL"))
|
||||
(prompt (format "Jump to %s: " prompt-scope))
|
||||
(selection (completing-read prompt links nil t))
|
||||
(position (replace-regexp-in-string "^.*(\\([0-9]+\\))[\s\t]+~" "\\1" selection))
|
||||
(point (string-to-number position)))
|
||||
(goto-char point)
|
||||
(recenter)))
|
||||
|
||||
;; Adapted from `prot-eww-open-in-other-window'
|
||||
;;;###autoload
|
||||
(defun +eww/open-in-other-window ()
|
||||
"Use `eww-open-in-new-buffer' in another window."
|
||||
(interactive nil 'ewe-mode)
|
||||
(other-window-prefix)
|
||||
(eww-open-in-new-buffer))
|
||||
|
||||
;;;###autoload
|
||||
(defun +eww/copy-current-url ()
|
||||
"Copy the open page's URL to the kill ring."
|
||||
(interactive nil 'eww-mode)
|
||||
(let ((url (eww-current-url)))
|
||||
(kill-new url)
|
||||
(message url)))
|
||||
|
||||
;;;###autoload
|
||||
(defun +eww/increase-font-size ()
|
||||
"Increase the font size in `eww-mode'."
|
||||
(interactive nil 'eww-mode)
|
||||
(if shr-use-fonts
|
||||
(let* ((cur (face-attribute 'shr-text :height nil))
|
||||
(cur (if (floatp cur) cur 1.0)))
|
||||
(set-face-attribute 'shr-text nil :height (+ cur 0.1)))
|
||||
(text-scale-increase 0.5)))
|
||||
|
||||
;;;###autoload
|
||||
(defun +eww/decrease-font-size ()
|
||||
"Decrease the font size in `eww-mode'."
|
||||
(interactive nil 'eww-mode)
|
||||
(if shr-use-fonts
|
||||
(let* ((cur (face-attribute 'shr-text :height nil))
|
||||
(cur (if (floatp cur) cur 1.0)))
|
||||
(set-face-attribute 'shr-text nil :height (- cur 0.1)))
|
||||
(text-scale-decrease 0.5)))
|
48
modules/emacs/eww/config.el
Normal file
48
modules/emacs/eww/config.el
Normal file
|
@ -0,0 +1,48 @@
|
|||
;;; emacs/eww/config.el -*- lexical-binding: t; -*-
|
||||
|
||||
(use-package! eww
|
||||
:defer t
|
||||
:config
|
||||
(map! :map eww-mode-map
|
||||
[remap text-scale-increase] #'+eww/increase-font-size
|
||||
[remap text-scale-decrease] #'+eww/decrease-font-size
|
||||
[remap imenu] #'+eww/jump-to-url-on-page
|
||||
[remap quit-window] #'+eww/quit
|
||||
:ni [C-return] #'+eww/open-in-other-window
|
||||
:n "yy" #'+eww/copy-current-url
|
||||
:n "zk" #'text-scale-increase
|
||||
:n "zj" #'text-scale-decrease
|
||||
|
||||
(:localleader
|
||||
:desc "external browser" "e" #'eww-browse-with-external-browser
|
||||
:desc "buffers" "b" #'eww-switch-to-buffer
|
||||
|
||||
(:prefix ("t" . "toggle")
|
||||
:desc "readable" "r" #'eww-readable
|
||||
:desc "colors" "c" #'eww-toggle-colors
|
||||
:desc "fonts" "f" #'eww-toggle-fonts
|
||||
:desc "images" "i" #'eww-toggle-images)
|
||||
|
||||
(:prefix ("y" . "copy")
|
||||
:desc "copy url" "y" #'+eww/copy-current-url
|
||||
:desc "copy for Org" "o" #'org-eww-copy-for-org-mode)))
|
||||
|
||||
;; HACK: There are packages that use eww to pop up html documentation; we want
|
||||
;; those to open in a popup, but if the user calls `eww' directly, it should
|
||||
;; open in the current window.
|
||||
(defadvice! +eww-open-in-fullscreen-if-interactive-a (fn &rest args)
|
||||
:around #'eww
|
||||
(if (called-interactively-p 'any)
|
||||
(apply fn args)
|
||||
(let (display-buffer-alist)
|
||||
(apply fn args))))
|
||||
|
||||
;; HACK: Rename the eww buffer to match the open page's title or URL.
|
||||
(if (boundp 'eww-auto-rename-buffer)
|
||||
(setq eww-auto-rename-buffer #'+eww-page-title-or-url) ; for >=29.1
|
||||
;; REVIEW: Remove when we drop 28 support
|
||||
(add-hook! 'eww-after-render-hook
|
||||
(defun +eww--rename-buffer-to-page-title-or-url-h (&rest _)
|
||||
(rename-buffer (+eww-page-title-or-url))))
|
||||
(advice-add #'eww-back-url :after #'+eww--rename-buffer-to-page-title-or-url-h)
|
||||
(advice-add #'eww-forward-url :after #'+eww--rename-buffer-to-page-title-or-url-h)))
|
4
modules/emacs/eww/packages.el
Normal file
4
modules/emacs/eww/packages.el
Normal file
|
@ -0,0 +1,4 @@
|
|||
;; -*- no-byte-compile: t; -*-
|
||||
;;; emacs/eww/packages.el
|
||||
|
||||
(package! eww :built-in t)
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
(defvar +mu4e-backend 'mbsync
|
||||
"Which backend to use. Can either be offlineimap, mbsync or nil (manual).")
|
||||
(make-obsolete-variable '+mu4e-backend "Use the :email mu4e module's +mbsync or +offlineimap flags instead" "3.0.0")
|
||||
(make-obsolete-variable '+mu4e-backend "Use the :email mu4e module's +mbsync or +offlineimap flags instead" "24.09")
|
||||
|
||||
(defvar +mu4e-personal-addresses 'nil
|
||||
"Alternative to mu4e-personal-addresses that can be set for each account (mu4e context).")
|
||||
|
|
64
modules/lang/graphviz/README.org
Normal file
64
modules/lang/graphviz/README.org
Normal file
|
@ -0,0 +1,64 @@
|
|||
:PROPERTIES:
|
||||
:ID: 3efe8402-e4a1-41c3-ad1a-9aaa3783f68f
|
||||
:END:
|
||||
#+title: :lang graphviz
|
||||
#+subtitle: Diagrams to confuse yourself even more
|
||||
#+created: Nov 14, 2023
|
||||
#+since: 23.09.0-pre
|
||||
|
||||
* Description :unfold:
|
||||
This module adds graphviz support to Emacs, allowing you to generate diagrams
|
||||
from plain text. Flycheck is supported.
|
||||
|
||||
** Maintainers
|
||||
/This module has no dedicated maintainers./ [[doom-contrib-maintainer:][Become a maintainer?]]
|
||||
|
||||
** Module flags
|
||||
/This module has no flags./
|
||||
|
||||
** Packages
|
||||
- [[doom-package:graphviz-dot-mode]]
|
||||
|
||||
** Hacks
|
||||
/No hacks documented for this module./
|
||||
|
||||
** TODO Changelog
|
||||
# This section will be machine generated. Don't edit it by hand.
|
||||
/This module does not have a changelog yet./
|
||||
|
||||
* Installation
|
||||
[[id:01cffea4-3329-45e2-a892-95a384ab2338][Enable this module in your ~doom!~ block.]]
|
||||
|
||||
This module requires that the =graphviz= package be installed on your system to
|
||||
build diagrams with. You can install it using:
|
||||
#+begin_src shell
|
||||
sudo dnf install graphviz # For fedora
|
||||
sudo apt install graphviz # For debian/ubuntu
|
||||
#+end_src
|
||||
|
||||
* Usage
|
||||
This module should configure "out-of-the-box" if you have installed graphviz on
|
||||
your system.
|
||||
|
||||
With org-babel LaTeX/PDF-export, use a file naming ending with ".pdf", otherwise
|
||||
LaTeX might complain about a non-existant ~\\includesvg~ command.
|
||||
#+begin_src dot :file graph-1.pdf
|
||||
digraph {
|
||||
A -> B;
|
||||
B -> D;
|
||||
}
|
||||
#+end_src
|
||||
|
||||
* Configuration
|
||||
There is nothing to configure. Just install dot and it should work.
|
||||
|
||||
* Troubleshooting
|
||||
/There are no known problems with this module./ [[doom-report:][Report one?]]
|
||||
|
||||
* Frequently asked questions
|
||||
/This module has no FAQs yet./ [[doom-suggest-faq:][Ask one?]]
|
||||
|
||||
* TODO Appendix
|
||||
#+begin_quote
|
||||
This module has no appendix yet. [[doom-contrib-module:][Write one?]]
|
||||
#+end_quote
|
19
modules/lang/graphviz/autoload.el
Normal file
19
modules/lang/graphviz/autoload.el
Normal file
|
@ -0,0 +1,19 @@
|
|||
;;; lang/graphviz/autoload.el -*- lexical-binding: t; -*-
|
||||
|
||||
;;;###autoload
|
||||
(cl-defun +graphviz-formatter (&key _buffer scratch callback &allow-other-keys)
|
||||
"Format graphviz graphs."
|
||||
(with-current-buffer scratch
|
||||
(let ((inhibit-message t)
|
||||
(message-log-max nil))
|
||||
(goto-char (point-min))
|
||||
(graphviz-dot-indent-graph))
|
||||
(funcall callback)))
|
||||
|
||||
;;;###autoload
|
||||
(defun +graphviz/toggle-preview ()
|
||||
"Toggle `graphviz-dot-auto-preview-on-save'."
|
||||
(interactive nil 'graphviz-dot-mode)
|
||||
(if graphviz-dot-auto-preview-on-save
|
||||
(graphviz-turn-off-live-preview)
|
||||
(graphviz-turn-on-live-preview)))
|
37
modules/lang/graphviz/config.el
Normal file
37
modules/lang/graphviz/config.el
Normal file
|
@ -0,0 +1,37 @@
|
|||
;;; lang/graphviz/config.el -*- lexical-binding: t; -*-
|
||||
|
||||
(use-package! graphviz-dot-mode
|
||||
:mode "\\.\\(?:nw\\|rack\\)diag\\'"
|
||||
:init
|
||||
(after! org-src
|
||||
(add-to-list 'org-src-lang-modes '("dot" . graphviz-dot)))
|
||||
:config
|
||||
(set-company-backend! 'graphviz-dot-mode 'company-graphviz-dot-backend)
|
||||
(set-formatter! 'graphviz-dot #'+graphviz-formatter :modes '(graphviz-dot-mode))
|
||||
(set-tree-sitter-lang! 'graphviz-dot-mode 'dot)
|
||||
|
||||
(when (modulep! +tree-sitter)
|
||||
(add-hook 'graphiz-dot-mode-hook #'tree-sitter!))
|
||||
|
||||
(after! dtrt-indent
|
||||
(add-to-list 'dtrt-indent-hook-mapping-list '(graphviz-mode graphviz-dot-indent-width)))
|
||||
|
||||
(when (and (modulep! :checker syntax)
|
||||
(not (modulep! :checker syntax +flymake)))
|
||||
(after! flycheck
|
||||
(flycheck-define-checker graphviz-dot
|
||||
"A checker using graphviz dot."
|
||||
:command ("dot")
|
||||
:standard-input t
|
||||
:error-patterns ((error line-start "Error: <stdin>: " (message "syntax error in line " line (* nonl)))
|
||||
;; I have no idea if this can actually be printed
|
||||
(error line-start "Error: <stdin>: " (message)))
|
||||
:modes graphviz-dot-mode)
|
||||
(add-to-list 'flycheck-checkers 'graphviz-dot)))
|
||||
|
||||
(map! :map graphviz-dot-mode-map
|
||||
:localleader
|
||||
:desc "External view" :nv "e" #'graphviz-dot-view
|
||||
:desc "Preview" :nv "p" #'graphviz-dot-preview
|
||||
:prefix ("t" . "toggle")
|
||||
:desc "Preview" :nv "p" #'+graphviz/toggle-preview))
|
6
modules/lang/graphviz/doctor.el
Normal file
6
modules/lang/graphviz/doctor.el
Normal file
|
@ -0,0 +1,6 @@
|
|||
;; -*- lexical-binding: t; no-byte-compile: t; -*-
|
||||
;;; lang/graphviz/doctor.el
|
||||
|
||||
(when (require 'graphviz-dot-mode nil t)
|
||||
(unless (executable-find graphviz-dot-dot-program)
|
||||
(warn! "Couldn't find dot. Previewing and exporting will not work")))
|
4
modules/lang/graphviz/packages.el
Normal file
4
modules/lang/graphviz/packages.el
Normal file
|
@ -0,0 +1,4 @@
|
|||
;; -*- no-byte-compile: t; -*-
|
||||
;;; lang/graphviz/packages.el
|
||||
|
||||
(package! graphviz-dot-mode :pin "8ff793b13707cb511875f56e167ff7f980a31136")
|
|
@ -14,8 +14,12 @@ This module adds support for the [[https://www.racket-lang.org/][Racket programm
|
|||
Enable support for ~racket-mode~. Requires [[doom-module::tools lsp]] and a langserver
|
||||
(supports [[https://github.com/jeapostrophe/racket-langserver][racket-langserver]]).
|
||||
- +xp ::
|
||||
Enable the explore mode (~racket-xp-mode~), which "analyzes expanded code to
|
||||
explain and explore."
|
||||
Enable the explore minor mode (~racket-xp-mode~), which "analyzes expanded
|
||||
code to explain and explore."
|
||||
- +hash-lang ::
|
||||
Enable the hash-lang major mode (~racket-hash-lang-mode~), which "uses
|
||||
color-lexer, indent, and navigation supplied by a #lang." This flag can be
|
||||
used along with the ~+xp~ flag.
|
||||
|
||||
** Packages
|
||||
- [[doom-package:racket-mode]]
|
||||
|
|
|
@ -8,88 +8,106 @@
|
|||
;;
|
||||
;;; Packages
|
||||
|
||||
(use-package! racket-mode
|
||||
:mode "\\.rkt\\'" ; give it precedence over :lang scheme
|
||||
:config
|
||||
(set-repl-handler! 'racket-mode #'+racket/open-repl)
|
||||
(set-lookup-handlers! '(racket-mode racket-repl-mode)
|
||||
:definition #'+racket-lookup-definition
|
||||
:documentation #'+racket-lookup-documentation)
|
||||
(set-docsets! 'racket-mode "Racket")
|
||||
(set-ligatures! 'racket-mode
|
||||
:lambda "lambda"
|
||||
:map "map"
|
||||
:dot ".")
|
||||
(set-rotate-patterns! 'racket-mode
|
||||
:symbols '(("#true" "#false")))
|
||||
(set-formatter! 'raco-fmt '("raco" "fmt") :modes '(racket-mode))
|
||||
(let (mode
|
||||
mode-map
|
||||
mode-exts
|
||||
mode-hook
|
||||
mode-local-vars-hook)
|
||||
(if (modulep! +hash-lang)
|
||||
(setq mode 'racket-hash-lang-mode
|
||||
mode-exts '("\\.rkt\\'" ; Racket
|
||||
"\\.scrbl\\'" ; Scribble
|
||||
"\\.rhm\\'")) ; Rhombus
|
||||
(setq mode 'racket-mode
|
||||
mode-exts `("\\.rkt\\'")))
|
||||
(let ((mode-name (symbol-name mode)))
|
||||
(setq mode-map (intern (format "%s-map" mode-name))
|
||||
mode-hook (intern (format "%s-hook" mode-name))
|
||||
mode-local-vars-hook (intern (format "%s-local-vars-hook" mode-name))))
|
||||
|
||||
(add-hook! 'racket-mode-hook
|
||||
#'rainbow-delimiters-mode
|
||||
#'highlight-quoted-mode)
|
||||
(use-package! racket-mode
|
||||
:defer t
|
||||
:init
|
||||
(dolist (entry mode-exts)
|
||||
(add-to-list 'auto-mode-alist (cons entry mode)))
|
||||
:config
|
||||
(set-repl-handler! mode #'+racket/open-repl)
|
||||
(set-lookup-handlers! `(,mode racket-repl-mode)
|
||||
:definition #'+racket-lookup-definition
|
||||
:documentation #'+racket-lookup-documentation)
|
||||
(set-docsets! mode "Racket")
|
||||
(set-ligatures! mode
|
||||
:lambda "lambda"
|
||||
:map "map"
|
||||
:dot ".")
|
||||
(set-rotate-patterns! mode :symbols '(("#true" "#false")))
|
||||
(set-formatter! 'raco-fmt '("raco" "fmt") :modes (list mode))
|
||||
|
||||
(when (modulep! +lsp)
|
||||
(add-hook 'racket-mode-local-vars-hook #'lsp! 'append))
|
||||
(add-hook mode-hook #'rainbow-delimiters-mode)
|
||||
(add-hook mode-hook #'highlight-quoted-mode)
|
||||
|
||||
(when (modulep! +xp)
|
||||
(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 (modulep! :checkers syntax)
|
||||
(add-hook! 'racket-xp-mode-hook
|
||||
(defun +racket-disable-flycheck-h ()
|
||||
(cl-pushnew 'racket flycheck-disabled-checkers)))))
|
||||
(when (modulep! +lsp)
|
||||
(add-hook mode-local-vars-hook #'lsp! 'append))
|
||||
|
||||
(unless (or (modulep! :editor parinfer)
|
||||
(modulep! :editor lispy))
|
||||
(add-hook 'racket-mode-hook #'racket-smart-open-bracket-mode))
|
||||
(when (modulep! +xp)
|
||||
(add-hook 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 (modulep! :checkers syntax)
|
||||
(add-hook! 'racket-xp-mode-hook
|
||||
(defun +racket-disable-flycheck-h ()
|
||||
(cl-pushnew 'racket flycheck-disabled-checkers)))))
|
||||
|
||||
(map! (:map racket-xp-mode-map
|
||||
[remap racket-doc] #'racket-xp-documentation
|
||||
[remap racket-visit-definition] #'racket-xp-visit-definition
|
||||
[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")
|
||||
"b" #'racket-unvisit
|
||||
"d" #'racket-visit-definition
|
||||
"m" #'racket-visit-module
|
||||
"r" #'racket-open-require-path)
|
||||
(:prefix ("s" . "send")
|
||||
"d" #'racket-send-definition
|
||||
"e" #'racket-send-last-sexp
|
||||
"r" #'racket-send-region)
|
||||
:map racket-repl-mode-map
|
||||
"l" #'racket-logger
|
||||
"h" #'racket-repl-documentation
|
||||
"y" #'racket-insert-lambda
|
||||
"u" #'racket-backward-up-list
|
||||
(:prefix ("m" . "macros")
|
||||
"d" #'racket-expand-definition
|
||||
"e" #'racket-expand-last-sexp
|
||||
"f" #'racket-expand-file
|
||||
"r" #'racket-expand-region)
|
||||
(:prefix ("g" . "goto")
|
||||
"b" #'racket-unvisit
|
||||
"m" #'racket-visit-module
|
||||
"d" #'racket-repl-visit-definition))))
|
||||
(unless (or (modulep! :editor parinfer)
|
||||
(modulep! :editor lispy))
|
||||
(add-hook mode-hook #'racket-smart-open-bracket-mode))
|
||||
|
||||
(map! (:map racket-xp-mode-map
|
||||
[remap racket-doc] #'racket-xp-documentation
|
||||
[remap racket-visit-definition] #'racket-xp-visit-definition
|
||||
[remap next-error] #'racket-xp-next-error
|
||||
[remap previous-error] #'racket-xp-previous-error)
|
||||
(:localleader
|
||||
:map ,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")
|
||||
"b" #'racket-unvisit
|
||||
"d" #'racket-visit-definition
|
||||
"m" #'racket-visit-module
|
||||
"r" #'racket-open-require-path)
|
||||
(:prefix ("s" . "send")
|
||||
"d" #'racket-send-definition
|
||||
"e" #'racket-send-last-sexp
|
||||
"r" #'racket-send-region)
|
||||
:map racket-repl-mode-map
|
||||
"l" #'racket-logger
|
||||
"h" #'racket-repl-documentation
|
||||
"y" #'racket-insert-lambda
|
||||
"u" #'racket-backward-up-list
|
||||
(:prefix ("m" . "macros")
|
||||
"d" #'racket-expand-definition
|
||||
"e" #'racket-expand-last-sexp
|
||||
"f" #'racket-expand-file
|
||||
"r" #'racket-expand-region)
|
||||
(:prefix ("g" . "goto")
|
||||
"b" #'racket-unvisit
|
||||
"m" #'racket-visit-module
|
||||
"d" #'racket-repl-visit-definition)))))
|
||||
|
|
|
@ -91,6 +91,16 @@
|
|||
"P" #'rubocop-autocorrect-project))
|
||||
|
||||
|
||||
(use-package! ruby-json-to-hash
|
||||
:defer t
|
||||
:init
|
||||
(map! :after ruby-mode
|
||||
:map ruby-mode-map
|
||||
:localleader
|
||||
"J" #'ruby-json-to-hash-parse-json
|
||||
"j" #'ruby-json-to-hash-toggle-let))
|
||||
|
||||
|
||||
;;
|
||||
;;; Package & Ruby version management
|
||||
|
||||
|
@ -182,6 +192,9 @@
|
|||
"v" #'minitest-verify))
|
||||
|
||||
|
||||
;;
|
||||
;;; Rails integration
|
||||
|
||||
(use-package! projectile-rails
|
||||
:when (modulep! +rails)
|
||||
:hook ((ruby-mode inf-ruby-mode projectile-rails-server-mode) . projectile-rails-mode)
|
||||
|
@ -199,3 +212,29 @@
|
|||
(map! :localleader
|
||||
:map projectile-rails-mode-map
|
||||
"r" #'projectile-rails-command-map))
|
||||
|
||||
(use-package! rails-routes
|
||||
:when (featurep! +rails)
|
||||
:defer t
|
||||
:init
|
||||
(map! :after ruby-mode
|
||||
:map ruby-mode-map
|
||||
"C-c o" #'rails-routes-insert
|
||||
"C-c C-o" #'rails-routes-insert-no-cache
|
||||
"C-c ! o" #'rails-routes-jump)
|
||||
(map! :after web-mode
|
||||
:map web-mode-map
|
||||
"C-c o" #'rails-routes-insert
|
||||
"C-c C-o" #'rails-routes-insert-no-cache
|
||||
"C-c ! o" #'rails-routes-jump))
|
||||
|
||||
(use-package! rails-i18n
|
||||
:when (featurep! +rails)
|
||||
:defer t
|
||||
:init
|
||||
(map! :after ruby-mode
|
||||
:map ruby-mode-map
|
||||
"C-c i" #'rails-i18n-insert-with-cache)
|
||||
(map! :after web-mode
|
||||
:map web-mode-map
|
||||
"C-c i" #'rails-i18n-insert-with-cache))
|
||||
|
|
|
@ -30,7 +30,12 @@
|
|||
(package! rspec-mode :pin "29df3d081c6a1cbdf840cd13d45ea1c100c5bbaa")
|
||||
(package! minitest :pin "5999c45c047212cee15a2be67e78787776a79c35")
|
||||
|
||||
;; Refactoring
|
||||
(package! ruby-json-to-hash :pin "383b22bb2e007289ac0dba146787d02ff99d4415")
|
||||
|
||||
;; Rails
|
||||
(when (modulep! +rails)
|
||||
(package! rails-routes :pin "eab995a9297ca5bd9bd4f4c2737f2fecfc36def0")
|
||||
(package! rails-i18n :pin "8e87e4e48e31902b8259ded28a208c2e7efea6e9")
|
||||
(package! projectile-rails :pin "701784df7befe17b861f1b53fe9cbc59d0b94b9f")
|
||||
(package! inflections :pin "55caa66a7cc6e0b1a76143fd40eff38416928941"))
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
;; This file supplies some metadata about this module repo to Doom's module
|
||||
;; manager. None of them are required, but it's a good idea to include them so
|
||||
;; Doom can perform some sanity checks for you.
|
||||
|
||||
:root "./" ; where the module tree starts
|
||||
:version "21.12" ; version of this repo
|
||||
:requires "3.0.0" ; minimum supported version of Doom's core
|
|
@ -45,6 +45,8 @@ be enabled. If any function returns non-nil, the mode will not be activated."
|
|||
;; TODO: Uncomment once we support treesit
|
||||
;; (setq indent-bars-treesit-support (modulep! :tools tree-sitter))
|
||||
|
||||
;; indent-bars adds this to `enable-theme-functions', which was introduced in
|
||||
;; 29.1, which will be redundant with `doom-load-theme-hook'.
|
||||
(unless (boundp 'enable-theme-functions)
|
||||
(add-hook 'doom-load-theme-hook #'indent-bars-reset-styles))
|
||||
|
||||
|
|
|
@ -3,4 +3,4 @@
|
|||
|
||||
(package! indent-bars
|
||||
:recipe (:host github :repo "jdtsmith/indent-bars")
|
||||
:pin "c8376cf4373a6444ca88e88736db7576dedb51d6")
|
||||
:pin "c8376cf4373a6444ca88e88736db7576dedb51d6")
|
||||
|
|
|
@ -124,6 +124,11 @@ and cannot run in."
|
|||
(setq prettify-symbols-unprettify-at-point 'right-edge)
|
||||
|
||||
(when (modulep! +extra)
|
||||
;; Lisp modes offer their own defaults for `prettify-symbols-mode' (just a
|
||||
;; lambda symbol substitution), but this might be unexpected if the user
|
||||
;; enables +extra but has unset `+ligatures-extra-symbols'.
|
||||
(setq lisp-prettify-symbols-alist nil)
|
||||
|
||||
(add-hook 'after-change-major-mode-hook #'+ligatures-init-extra-symbols-h))
|
||||
|
||||
(cond
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue