IMPORTANT NOTICE: Devheroes public code hosting will shut down at 1st of March 2023. Due to some difficulties, we have to shut down the instance. Since codeberg.org is pretty mature and welcoming, We highly recommend you to move your code there. Please be advised that on 1st of March, your data will be removed. Thanks for your time with us, and may the source be with you.

Browse Source

Abstract away rainbow delimiters and paredit into their cubes

ep12
Sameer Rahmani 2 months ago
parent
commit
9914395a4d
  1. 3
      core/cubes/clojure.el
  2. 27
      core/cubes/editor.el
  3. 9
      core/cubes/elisp.el
  4. 18
      core/cubes/langtool.el

3
core/cubes/clojure.el

@ -38,8 +38,7 @@ Also activates LSP and converts `fn` to λ." @@ -38,8 +38,7 @@ Also activates LSP and converts `fn` to λ."
(fpkg/use aggressive-indent-mode
:config (paredit-mode +1))
(fpkg/use rainbow-delimiters
:config (rainbow-delimiters-mode +1))
(fg42/rainbow-delimiters-cube)
(fpkg/use cider)

27
core/cubes/editor.el

@ -117,6 +117,33 @@ For more info checkout [[https://github.com/gregsexton/origami.el]]" @@ -117,6 +117,33 @@ For more info checkout [[https://github.com/gregsexton/origami.el]]"
(global-hl-line-mode))
(defcube fg42/rainbow-delimiters-cube
"rainbow-delimiters is a =rainbow parentheses= like mode which highlights delimiters
such as parentheses, brackets or braces according to their depth. Each successive level
is highlighted in a different color. This makes it easy to spot matching delimiters,
orient yourself in the code, and tell which statements are at a given depth."
(:title "Rainbow Delimiters Cube"
:flag rainbow-delimiters
:flag-default t)
(fpkg/use rainbow-delimiters
;; It doesn't work due to a problem/conflict in rainbow-delimiters
;; But we use it any way they might fix it
:hook (prog-mode . rainbow-delimiters-mode)))
(defcube fg42/paredit-cube
"=paredit= is a minor mode for performing structured editing of S-expression
data. The typical example of this would be Lisp or Scheme source code."
(:title "Paredit Cube"
:flag paredit
:flag-default t)
(fpkg/use paredit
:hook (prog-mode . paredit-mode)))
(defcube fg42/cursor-cube
"This cube controls the shape of the cursor."
(:title "Cursor cube"

9
core/cubes/elisp.el

@ -30,13 +30,8 @@ @@ -30,13 +30,8 @@
(:title "cubes/fg42/elisp-cube.org"
:no-flag t)
(fpkg/use rainbow-delimiters
;; It doesn't work due to a problem/conflict in rainbow-delimiters
;; But we use it any way they might fix it
:hook (prog-mode . rainbow-delimiters-mode))
(fpkg/use paredit
:hook (emacs-lisp-mode . paredit-mode))
(fg42/rainbow-delimiters-cube)
(fg42/paredit-cube)
(add-hook 'emacs-lisp-mode-hook #'rainbow-delimiters-mode))

18
core/cubes/langtool.el

@ -35,12 +35,18 @@ @@ -35,12 +35,18 @@
:flag language-tool
:flag-default t)
(fpkg/use lsp-ltex
:hook (text-mode . (lambda ()
(require 'lsp-ltex)
(lsp))) ; or lsp-deferred
:init
(setq lsp-ltex-version "15.2.0")))
(let ((user (plist-get fg42/langtool-cube-params :username))
(apikey (plist-get fg42/langtool-cube-params :api-key)))
(fpkg/use lsp-ltex
:hook (text-mode . (lambda ()
(require 'lsp-ltex)
(lsp))) ; or lsp-deferred
:init
(setq lsp-ltex-version "15.2.0")
(when user
(setq lsp-ltex-languagetool-http-server-uri "https://api.languagetoolplus.com/")
(setq lsp-ltex-languagetool-org-username user)
(setq lsp-ltex-languagetool-org-api-key apikey)))))
(provide 'cubes/langtool)
;;; langtool.el ends here

Loading…
Cancel
Save