Add Clojure, Python, Terraform, and YAML config
This commit is contained in:
parent
68e30e2455
commit
c3fc728d98
50
emacs/.emacs.d/config/init-clojure.el
Normal file
50
emacs/.emacs.d/config/init-clojure.el
Normal file
@ -0,0 +1,50 @@
|
||||
;; -*- lexical-binding: t; -*-
|
||||
|
||||
;; Clojure configuration
|
||||
(use-package clojure-mode
|
||||
:mode (("\\.clj\\'" . clojure-mode)
|
||||
("\\.cljs\\'" . clojurescript-mode)
|
||||
("\\.cljc\\'" . clojurec-mode)
|
||||
("\\.edn\\'" . clojure-mode))
|
||||
:config
|
||||
(define-clojure-indent
|
||||
(defroutes 'defun)
|
||||
(GET 2)
|
||||
(POST 2)
|
||||
(PUT 2)
|
||||
(DELETE 2)
|
||||
(HEAD 2)
|
||||
(ANY 2)
|
||||
(OPTIONS 2)
|
||||
(PATCH 2)
|
||||
(rfn 2)
|
||||
(let-routes 1)
|
||||
(context 2)
|
||||
(:= 3)
|
||||
(:+ 3)
|
||||
(match 1)
|
||||
(for-all 2)
|
||||
(checking 2)
|
||||
(let-flow 1)))
|
||||
|
||||
;; Flycheck support
|
||||
(use-package flycheck-clj-kondo
|
||||
:after (clojure-mode)
|
||||
:if (executable-find "clj-kondo"))
|
||||
|
||||
(use-package cider
|
||||
:commands (cider-mode cider-jack-in cider-jack-in-clojurescript)
|
||||
:custom
|
||||
(cider-known-endpoints
|
||||
'(("local" "localhost" "4005")))
|
||||
(cider-prompt-for-symbol nil)
|
||||
(general-def cider-mode-map "C-c t" cider-test-commands-map)
|
||||
:hook ((clojure-mode . cider-mode)
|
||||
(clojurescript-mode . cider-mode)
|
||||
(clojurec-mode . cider-mode))
|
||||
:general
|
||||
(cider-stacktrace-mode-map "SPC" leader-map)
|
||||
('normal cider-mode-map "M-." #'cider-find-var)
|
||||
(cider-repl-mode-map "C-c C-l" #'cider-repl-clear-buffer))
|
||||
|
||||
(provide 'init-clojure)
|
54
emacs/.emacs.d/config/init-python.el
Normal file
54
emacs/.emacs.d/config/init-python.el
Normal file
@ -0,0 +1,54 @@
|
||||
;; -*- lexical-binding: t; -*-
|
||||
|
||||
;; Python configuration
|
||||
(use-package python
|
||||
:defer t
|
||||
:straight (:type built-in)
|
||||
:config
|
||||
;; Redefine the python-mypy flycheck checker to account for projectile-compilation-dir
|
||||
(flycheck-define-checker python-mypy
|
||||
"Mypy syntax and type checker. Requires mypy>=0.580.
|
||||
|
||||
See URL `http://mypy-lang.org/'."
|
||||
:command ("mypy"
|
||||
"--show-column-numbers"
|
||||
(config-file "--config-file" flycheck-python-mypy-config)
|
||||
(option "--cache-dir" flycheck-python-mypy-cache-dir)
|
||||
source-original)
|
||||
:error-patterns
|
||||
((error line-start (file-name) ":" line (optional ":" column)
|
||||
": error:" (message) line-end)
|
||||
(warning line-start (file-name) ":" line (optional ":" column)
|
||||
": warning:" (message) line-end)
|
||||
(info line-start (file-name) ":" line (optional ":" column)
|
||||
": note:" (message) line-end))
|
||||
:modes python-mode
|
||||
;; Ensure the file is saved, to work around
|
||||
;; https://github.com/python/mypy/issues/4746.
|
||||
:predicate flycheck-buffer-saved-p
|
||||
:working-directory (lambda (checker)
|
||||
(or (projectile-compilation-dir)
|
||||
default-directory))))
|
||||
|
||||
;; pyvenv to track virtual environments
|
||||
(use-package pyvenv
|
||||
:defer 3
|
||||
:config
|
||||
(pyvenv-mode)
|
||||
(pyvenv-tracking-mode))
|
||||
|
||||
;; pyenv to track Python version
|
||||
(use-package pyenv-mode
|
||||
:defer t)
|
||||
|
||||
;; LSP using Microsoft's pyright language server
|
||||
(use-package lsp-pyright
|
||||
:hook (python-mode . (lambda ()
|
||||
(require 'lsp-pyright)
|
||||
(lsp-deferred)))
|
||||
:custom
|
||||
(lsp-pyright-use-library-code-for-types t)
|
||||
:general
|
||||
(python-mode-map "C-c C-d" #'lsp-describe-thing-at-point))
|
||||
|
||||
(provide 'init-python)
|
7
emacs/.emacs.d/config/init-terraform.el
Normal file
7
emacs/.emacs.d/config/init-terraform.el
Normal file
@ -0,0 +1,7 @@
|
||||
;; -*- lexical-binding: t; -*-
|
||||
|
||||
;; Configuration as code!
|
||||
(use-package terraform-mode
|
||||
:mode "\\.tf\\'")
|
||||
|
||||
(provide 'init-terraform)
|
9
emacs/.emacs.d/config/init-yaml.el
Normal file
9
emacs/.emacs.d/config/init-yaml.el
Normal file
@ -0,0 +1,9 @@
|
||||
;; -*- lexical-binding: t; -*-
|
||||
|
||||
;; YAML - literally the worst but still holds an important place in my life
|
||||
(use-package yaml-mode
|
||||
:mode ("\\.yaml\\'" "\\.yml\\'")
|
||||
:config
|
||||
(add-hook 'yaml-mode-hook #'highlight-indent-guides-mode))
|
||||
|
||||
(provide 'init-yaml)
|
@ -70,6 +70,10 @@
|
||||
(require 'init-ide)
|
||||
(require 'init-eshell)
|
||||
(require 'init-help)
|
||||
(require 'init-python)
|
||||
(require 'init-clojure)
|
||||
(require 'init-yaml)
|
||||
(require 'init-terraform)
|
||||
|
||||
;; Load the custom file
|
||||
(when (file-exists-p custom-file)
|
||||
|
Loading…
Reference in New Issue
Block a user