Create modes.el

This commit is contained in:
Rawley Fowler 2022-06-05 21:41:10 -06:00 committed by GitHub
parent 2cc6d1076a
commit bb4b0cd3e3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

53
emacs.d/modes.el Normal file
View file

@ -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