Compare commits

...

12 Commits

Author SHA1 Message Date
Jeremy Dormitzer
8235d8d0ae Use the correct command to start spend-service 2021-04-05 10:47:12 -04:00
Jeremy Dormitzer
1227a9f837 Formatting 2021-04-05 10:47:04 -04:00
Jeremy Dormitzer
6d88f3df5e Add lexical binding to init-vterm.el 2021-04-05 10:46:49 -04:00
Jeremy Dormitzer
410a34ef3e Use non-byte-compiled files when loading if they are newer 2021-04-05 10:46:30 -04:00
Jeremy Dormitzer
c7c56078b8 Add k9s command 2021-04-05 10:46:20 -04:00
Jeremy Dormitzer
3d3c04eb5f Use shell-script-mode for .env.local files 2021-04-05 10:45:54 -04:00
Jeremy Dormitzer
05f144b85e Configure cider eval'ing to a comment 2021-04-05 10:45:35 -04:00
Jeremy Dormitzer
1c71105efe Use hs-minor-mode in all programming language buffers 2021-04-05 10:45:19 -04:00
Jeremy Dormitzer
15ddb2763a Add nXML config 2021-04-05 10:45:07 -04:00
Jeremy Dormitzer
a6f2b96937 Set up LSP and js-comint for javascript editing 2021-04-05 10:44:49 -04:00
Jeremy Dormitzer
4f7594b71f Add web-mode 2021-04-05 10:44:24 -04:00
Jeremy Dormitzer
2584727852 Add some elisp-mode keybindings 2021-04-05 10:43:20 -04:00
13 changed files with 110 additions and 3 deletions

View File

@ -56,4 +56,10 @@
:config :config
(evil-collection-occur-setup)) (evil-collection-occur-setup))
(use-package hideshow
:straight (:type built-in)
:hook (prog-mode . hs-minor-mode)
:init
(general-def 'normal "zM" #'hs-hide-level))
(provide 'init-built-ins) (provide 'init-built-ins)

View File

@ -38,6 +38,7 @@
(cider-known-endpoints (cider-known-endpoints
'(("local" "localhost" "4005"))) '(("local" "localhost" "4005")))
(cider-prompt-for-symbol nil) (cider-prompt-for-symbol nil)
(cider-comment-prefix ";; => ")
:hook ((clojure-mode . cider-mode) :hook ((clojure-mode . cider-mode)
(clojurescript-mode . cider-mode) (clojurescript-mode . cider-mode)
(clojurec-mode . cider-mode)) (clojurec-mode . cider-mode))
@ -49,6 +50,7 @@
(cider-stacktrace-mode-map "SPC" leader-map) (cider-stacktrace-mode-map "SPC" leader-map)
(normal cider-mode-map "M-." #'cider-find-var) (normal cider-mode-map "M-." #'cider-find-var)
(cider-mode-map "C-c M-b" #'cider-debug-defun-at-point) (cider-mode-map "C-c M-b" #'cider-debug-defun-at-point)
(cider-mode-map "C-c M-;" #'cider-pprint-eval-defun-to-comment)
(cider-repl-mode-map "C-c C-l" #'cider-repl-clear-buffer)) (cider-repl-mode-map "C-c C-l" #'cider-repl-clear-buffer))
(provide 'init-clojure) (provide 'init-clojure)

View File

@ -4,6 +4,7 @@
:defer 2 :defer 2
:init :init
(add-to-list 'auto-mode-alist '("\\.env\\'" . shell-script-mode)) (add-to-list 'auto-mode-alist '("\\.env\\'" . shell-script-mode))
(add-to-list 'auto-mode-alist '("\\.env.local\\'" . shell-script-mode))
:config :config
(direnv-mode) (direnv-mode)
(add-hook 'eshell-mode-hook #'direnv-update-directory-environment) (add-hook 'eshell-mode-hook #'direnv-update-directory-environment)

View File

@ -0,0 +1,5 @@
(use-package elisp-mode
:straight (:type built-in)
:general
(emacs-lisp-mode-map "C-c C-c" #'eval-defun
"C-c C-k" #'eval-buffer))

View File

@ -4,6 +4,41 @@
(use-package nvm (use-package nvm
:commands (nvm-use :commands (nvm-use
nvm-use-for nvm-use-for
nvm-use-for-buffer)) nvm-use-for-buffer
nvm--installed-versions)
:init
(defun nvm (version)
(interactive (list
(completing-read "Node version: "
(mapcar #'car
(nvm--installed-versions)))))
(nvm-use version)))
(use-package js
:straight (:type built-in)
:defer t
:config
(add-hook 'js-mode-hook #'lsp-deferred))
;; Make sure we load LSP in React files
(with-eval-after-load 'lsp-clients
(defun lsp-typescript-javascript-tsx-jsx-activate-p (filename major-mode)
"Checks if the javascript-typescript language server should be enabled
based on FILE-NAME and MAJOR-MODE"
(or (member major-mode '(typescript-mode typescript-tsx-mode js-mode js2-mode rjsx-mode))
(and (eq major-mode 'web-mode)
(or (string-suffix-p ".tsx" filename t)
(string-suffix-p ".jsx" filename t)
(string-suffix-p ".js" filename t))))))
(use-package js-comint
:commands (run-js)
:config
(js-do-use-nvm)
:general
(js-mode-map "C-c M-j" #'run-js
"C-x C-e" #'js-send-last-sexp
"C-c C-k" #'js-send-buffer
"C-c M-z" #'js-send-buffer-and-go))
(provide 'init-js) (provide 'init-js)

View File

@ -50,4 +50,12 @@
kubectl-deployments kubectl-deployments
kubectl-statefulsets)) kubectl-statefulsets))
(when (executable-find "k9s")
(defun k9s ()
(interactive)
(let ((k9s-buf (vterm "*k9s*")))
(switch-to-buffer k9s-buf)
(vterm-send-string (executable-find "k9s"))
(vterm-send-return))))
(provide 'init-kubernetes) (provide 'init-kubernetes)

View File

@ -360,7 +360,7 @@
:name "spend-service" :name "spend-service"
:tags '(lola backend) :tags '(lola backend)
:command "~/lola/python_services/spend/bin/start.sh" :command "~/lola/python_services/spend/bin/start.sh"
:args '("web") :args '("web-dev")
:cwd "~/lola/python_services" :cwd "~/lola/python_services"
:stop-signal 'int :stop-signal 'int
:init-async (python-service-setup "~/lola/python_services/.venv" :init-async (python-service-setup "~/lola/python_services/.venv"

View File

@ -7,5 +7,4 @@
(global-undo-tree-mode) (global-undo-tree-mode)
:bind ("C-c C-r" . undo-tree-visualize)) :bind ("C-c C-r" . undo-tree-visualize))
(provide 'init-undo) (provide 'init-undo)

View File

@ -1,3 +1,5 @@
;; -*- lexical-binding: t; -*-
(use-package vterm (use-package vterm
:commands vterm :commands vterm
:init :init

View File

@ -0,0 +1,29 @@
;; -*- lexical-binding: t; -*-
(use-package web-mode
:mode (("\\.phtml\\'" . web-mode)
("\\.tpl\\.php\\'" . web-mode)
("\\.[agj]sp\\'" . web-mode)
("\\.as[cp]x\\'" . web-mode)
("\\.erb\\'" . web-mode)
("\\.mustache\\'" . web-mode)
("\\.djhtml\\'" . web-mode)
("\\.hbs\\'" . web-mode)
("\\.html?\\'" . web-mode)
("\\.jsx?\\'" . web-mode)
("\\.mako\\'" . web-mode)
("\\.jinja2\\'" . web-mode))
:config
(setq web-mode-engines-alist
'(("django" . "\\.jinja2\\'")))
(add-hook 'web-mode-hook
(lambda ()
(when (equal web-mode-content-type "javascript")
(web-mode-set-content-type "jsx"))
(when (or (equal web-mode-content-type "javascript")
(equal web-mode-content-type "jsx"))
(lsp-deferred))))
:custom
(web-mode-enable-auto-pairing nil))
(provide 'init-web)

View File

@ -0,0 +1,15 @@
;; -*- lexical-binding: t; -*-
(use-package nxml-mode
:straight (:type built-in)
:defer t
:config
(add-to-list 'hs-special-modes-alist
'(nxml-mode
"<!--\\|<[^/>]*[^/]>" ;; regexp for start block
"-->\\|</[^/>]*[^/]>" ;; regexp for end block
"<!--"
nxml-forward-element
nil)))
(provide 'init-xml)

View File

@ -1,5 +1,7 @@
;; -*- lexical-binding: t; -*- ;; -*- lexical-binding: t; -*-
(setq load-prefer-newer t)
;; Some startup time optimizations stolen from Doom emacs ;; Some startup time optimizations stolen from Doom emacs
(setq gc-cons-threshold most-positive-fixnum ; 2^61 bytes (setq gc-cons-threshold most-positive-fixnum ; 2^61 bytes
gc-cons-percentage 0.6) gc-cons-percentage 0.6)

View File

@ -66,6 +66,7 @@
(require 'init-keybindings) (require 'init-keybindings)
(require 'init-auth) (require 'init-auth)
(require 'init-lib) (require 'init-lib)
(require 'init-elisp)
(require 'init-org) (require 'init-org)
(require 'init-profiler) (require 'init-profiler)
(require 'init-built-ins) (require 'init-built-ins)
@ -88,6 +89,8 @@
(require 'init-clojure) (require 'init-clojure)
(require 'init-lisp) (require 'init-lisp)
(require 'init-js) (require 'init-js)
(require 'init-web)
(require 'init-xml)
(require 'init-yaml) (require 'init-yaml)
(require 'init-groovy) (require 'init-groovy)
(require 'init-terraform) (require 'init-terraform)