dotfiles/common/.config/emacs/languages.org
2024-08-15 19:31:35 -05:00

4.2 KiB

Emacs Programming Language Setup

Shell Script

Run eglot on shell script files.

  (add-hook 'sh-mode-hook 'jj/eglot-setup)

C

Run eglot on C and C++ files.

  (add-hook 'c-mode-hook 'jj/eglot-setup)
  (add-hook 'c++-mode-hook 'jj/eglot-setup)
  (add-hook 'cc-mode-hook 'jj/eglot-setup)

Run eglot on CMake files.

  (use-package cmake-mode
    :init
    (add-hook 'cmake-mode-hook 'jj/eglot-setup))

Turn off C mode in lex and yacc files.

  (add-to-list 'auto-mode-alist '("\\.l$" . prog-mode))
  (add-to-list 'auto-mode-alist '("\\.y$" . prog-mode))

Web

Run eglot on HTML files.

  (add-hook 'html-mode-hook 'jj/eglot-setup)

Run eglot on CSS files.

  (add-hook 'css-mode-hook 'jj/eglot-setup)

Run eglot on JavaScript files.

  (add-hook 'js-json-mode-hook 'jj/eglot-setup)
  (add-hook 'js-mode-hook 'jj/eglot-setup)

Python

Run eglot on Python files.

  (add-hook 'python-mode-hook 'jj/eglot-setup)

Go

Install Go support and run eglot on Go files.

  (use-package go-mode
    :init
    (add-hook 'go-mode-hook 'jj/eglot-setup))

Get documentation for Go variables, functions, and arguments.

  (use-package go-eldoc
    :init
    (add-hook 'go-mode-hook 'go-eldoc-setup))

Automatically generate tests in Go.

  (use-package go-gen-test)

Get refactoring tools from go-guru.

  (use-package go-guru
    :hook (go-mode . go-guru-hl-identifier-mode))

Lua

Install Lua support and run eglot on Lua files.

  (use-package lua-mode
    :init
    (add-hook 'lua-mode-hook 'jj/eglot-setup))

Better Lisp editing with lispy.

  (use-package lispy
    :hook (emacs-lisp-mode . lispy-mode))
  (use-package lispyville
    :after lispy
    :hook (lispy-mode . lispyville-mode))

Better parentheses handling in lisp with parinfer-rust-mode.

  (use-package parinfer-rust-mode
    :hook (emacs-lisp-mode . parinfer-rust-mode)
    :init
    (setq parinfer-rust-auto-download t))

Markdown

Install Markdown support and run eglot on Markdown files.

  (use-package markdown-mode
    :init
    (add-hook 'markdown-mode-hook 'jj/eglot-setup))

LaTeX

Run eglot on TeX files.

  (add-hook 'tex-mode-hook 'jj/eglot-setup)

Use AUCTeX for extra LaTeX integration.

  (use-package auctex
    :config
    (add-hook 'LaTeX-mode-hook 'jj/eglot-setup)
    (add-hook 'LaTeX-mode-hook
            (lambda ()
              (put 'LaTeX-mode 'eglot-language-id "latex"))))

Use CDLaTeX for environment and macro insertion.

  (use-package cdlatex
    :config
    (add-hook 'LaTeX-mode-hook #'turn-on-cdlatex))

YAML

Install YAML support and run eglot on YAML files.

  (use-package yaml-mode
    :init
    (add-hook 'yaml-mode-hook 'jj/eglot-setup))