mirror of
https://gitlab.com/dwt1/dotfiles.git
synced 2026-04-24 03:50:24 +10:00
Moving to Doom Emacs!
This commit is contained in:
12
.emacs.d/modules/lang/racket/autoload.el
Normal file
12
.emacs.d/modules/lang/racket/autoload.el
Normal file
@@ -0,0 +1,12 @@
|
||||
;;; lang/racket/autoload.el -*- lexical-binding: t; -*-
|
||||
|
||||
;;;###autoload
|
||||
(defun +racket/open-repl ()
|
||||
"Open the Racket REPL."
|
||||
(interactive)
|
||||
(pop-to-buffer
|
||||
(or (get-buffer "*Racket REPL*")
|
||||
(progn (racket-run-and-switch-to-repl)
|
||||
(let ((buf (get-buffer "*Racket REPL*")))
|
||||
(bury-buffer buf)
|
||||
buf)))))
|
||||
59
.emacs.d/modules/lang/racket/config.el
Normal file
59
.emacs.d/modules/lang/racket/config.el
Normal file
@@ -0,0 +1,59 @@
|
||||
;;; lang/racket/config.el -*- lexical-binding: t; -*-
|
||||
|
||||
(after! projectile
|
||||
(add-to-list 'projectile-project-root-files "info.rkt"))
|
||||
|
||||
|
||||
;;
|
||||
;;; Packages
|
||||
|
||||
(use-package! racket-mode
|
||||
:hook (racket-repl-mode . racket-unicode-input-method-enable)
|
||||
:config
|
||||
(set-repl-handler! 'racket-mode #'+racket/open-repl)
|
||||
(set-lookup-handlers! 'racket-mode
|
||||
:definition #'racket-visit-definition
|
||||
:documentation #'racket-describe)
|
||||
(set-docsets! 'racket-mode "Racket")
|
||||
(set-pretty-symbols! 'racket-mode
|
||||
:lambda "lambda"
|
||||
:map "map"
|
||||
:dot ".")
|
||||
(set-rotate-patterns! 'racket-mode
|
||||
:symbols '(("#true" "#false")))
|
||||
|
||||
(add-hook! 'racket-mode-hook
|
||||
#'rainbow-delimiters-mode
|
||||
#'highlight-quoted-mode
|
||||
#'racket-smart-open-bracket-mode)
|
||||
|
||||
(map! :localleader
|
||||
:map racket-mode-map
|
||||
"a" #'racket-align
|
||||
"A" #'racket-unalign
|
||||
"f" #'racket-fold-all-tests
|
||||
"F" #'racket-unfold-all-tests
|
||||
"h" #'racket-doc
|
||||
"i" #'racket-unicode-input-method-enable
|
||||
"l" #'racket-logger
|
||||
"o" #'racket-profile
|
||||
"p" #'racket-cycle-paren-shapes
|
||||
"r" #'racket-run
|
||||
"R" #'racket-run-and-switch-to-repl
|
||||
"t" #'racket-test
|
||||
"u" #'racket-backward-up-list
|
||||
"y" #'racket-insert-lambda
|
||||
(:prefix ("m" . "macros")
|
||||
"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)))
|
||||
11
.emacs.d/modules/lang/racket/doctor.el
Normal file
11
.emacs.d/modules/lang/racket/doctor.el
Normal file
@@ -0,0 +1,11 @@
|
||||
;; -*- lexical-binding: t; no-byte-compile: t; -*-
|
||||
;;; lang/racket/doctor.el
|
||||
|
||||
(unless (executable-find "drracket")
|
||||
(warn! "Could not find drracket executable; code-completion and syntax checking will not work."))
|
||||
|
||||
(unless (executable-find "racket")
|
||||
(warn! "Could not find racket executable; REPL will not work."))
|
||||
|
||||
(unless (executable-find "raco")
|
||||
(warn! "Could not find raco executable; commands for install packages and build libraries will not work."))
|
||||
4
.emacs.d/modules/lang/racket/packages.el
Normal file
4
.emacs.d/modules/lang/racket/packages.el
Normal file
@@ -0,0 +1,4 @@
|
||||
;; -*- no-byte-compile: t; -*-
|
||||
;;; lang/racket/packages.el
|
||||
|
||||
(package! racket-mode)
|
||||
Reference in New Issue
Block a user