This repository has been archived on 2024-03-23. You can view files and clone it, but cannot push or open issues or pull requests.
dianciemacs/lisp/languages.el

55 lines
1.5 KiB
EmacsLisp
Raw Normal View History

;;; lisp/languages.el --- Support for programming languages -*- lexical-binding: t; -*-
;;; Commentary:
;;
;; Trivial changes done by almost everyone - no editor supports every language by default.
;; You will probably be adding on to the stuff in this file - in the `user/' directory, of course.
;;
;;; Code:
2022-11-13 18:41:10 +00:00
;; This file contains configuration for languages
;; Markdown
(use-package markdown-mode)
2022-11-14 21:24:46 +00:00
;; Diagnostics
2022-11-20 18:10:03 +00:00
(use-package flycheck-rust
:after flycheck
:init
(add-hook 'flycheck-mode-hook #'flycheck-rust-setup)) ; Enable flycheck-rust where flycheck is enabled. If not a rust file, does nothing.
(use-package flycheck-inline
:after flycheck
:hook
(flycheck-mode . flycheck-inline-mode)) ; Enable flycheck-inline where flycheck is enabled
(use-package flycheck
2022-11-20 18:10:03 +00:00
:hook prog-mode
:init
2022-11-20 18:10:03 +00:00
(with-eval-after-load 'flycheck
(push 'rustic-clippy flycheck-checkers))) ; Use clippy for Rust
2022-11-13 18:41:10 +00:00
;; eglot - Language Server Protocol ingegration
(use-package eglot)
;; Go
(use-package go-mode
:config
2022-11-20 18:10:03 +00:00
(add-hook 'before-save-hook 'gofmt-before-save)) ; Format on save
2022-11-13 18:41:10 +00:00
2022-11-15 22:02:39 +00:00
;; Rust
(use-package rustic
:custom
2022-11-16 21:54:13 +00:00
(rustic-format-trigger 'on-save) ; Format buffer on save
2022-11-15 22:02:39 +00:00
(rustic-lsp-client 'eglot)) ; Make eglot the default LSP client
;; Disable flymake for eglot - in favour of flycheck
(add-hook 'eglot--managed-mode-hook (lambda () (flymake-mode -1)))
2022-11-15 22:02:39 +00:00
;; Lua
(use-package lua-mode)
;; Autobrackets
2022-11-13 18:41:10 +00:00
(add-hook 'prog-mode-hook 'electric-pair-mode)
;;; languages.el ends here