From bb4b0cd3e3340af4cd168abc35f7a513fd1d628b Mon Sep 17 00:00:00 2001 From: Rawley Fowler <75388349+rawleyfowler@users.noreply.github.com> Date: Sun, 5 Jun 2022 21:41:10 -0600 Subject: [PATCH] Create modes.el --- emacs.d/modes.el | 53 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 emacs.d/modes.el diff --git a/emacs.d/modes.el b/emacs.d/modes.el new file mode 100644 index 0000000..7a75ffe --- /dev/null +++ b/emacs.d/modes.el @@ -0,0 +1,53 @@ +;;; modes.el --- Various modes +;;; Commentary: +;;; This file contains various Emacs modes that I use. +;;; Code: +(require 'lsp-mode) +;; Language modes + configurations +(use-package typescript-mode + :mode + ("\\.tsx?\\'" . typescript-mode) + :hook + (typescript-mode . lsp-deferred) + :config + (setq typescript-indent-level 2)) + +(use-package clojure-mode + :mode + ("\\.cljs?\\'" . clojure-mode) + :hook + (clojure-mode . lsp-deferred)) + +(use-package go-mode + :mode + ("\\.go\\'" . go-mode) + :hook + (go-mode . lsp-deferred)) + +(use-package markdown-mode + :mode + ("\\.md\\'" . markdown-mode) + :hook + (markdown-mode . auto-fill-mode)) + +;; Java/Meghanada +(use-package meghanada) +(add-hook 'java-mode-hook + (lambda () + (meghanada-mode t) + (setq c-basic-offset 2) + (add-hook 'before-save-hook 'meghanada-code-beautify-before-save))) +(setq meghanada-java-path "java") +(setq meghanada-maven-path "mvn") + +;; No config modes +(use-package json-mode) +(use-package yaml-mode) + +;; Built-in mode configs +; Ruby +(add-to-list 'auto-mode-alist + '("\\.\\(?:cap\\|gemspec\\|irbrc\\|gemrc\\|rake\\|rb\\|ru\\|thor\\)\\'" . ruby-mode)) +(add-to-list 'auto-mode-alist + '("\\(?:Brewfile\\|Capfile\\|Gemfile\\|[rR]akefile\\)\\'" . ruby-mode)) +;;; modes.el ends here