Add Emacs config with install scripts for laptop and work
Shared: init.el / early-init.el with Vertico stack, Corfu, Eglot, treesit-auto, Catppuccin Mocha, doom-modeline, Magit, avy, harpoon, embark, wgrep, expand-region, envrc, org-mode, and drop-in lang loader. Lang configs split by stow target: - shared: elisp, org - laptop: C/C++, Rust, Go, LaTeX (AUCTeX + latexmk + Zathura) - work: C#, JS/TS/HTML/CSS/React (apheleia+prettier), Copilot install-personal.sh: Fedora — gcc/clang, rustup, Go, texlive, zathura install-work.sh: Ubuntu 24.04 WSL — dotnet-sdk-10.0, Node 22 via nvm, ts-ls Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
16
work/.config/emacs/lisp/langs/copilot.el
Normal file
16
work/.config/emacs/lisp/langs/copilot.el
Normal file
@@ -0,0 +1,16 @@
|
||||
;;; lisp/langs/copilot.el --- GitHub Copilot -*- lexical-binding: t -*-
|
||||
|
||||
;; copilot.el is not on MELPA; installed via package-vc (Emacs 29+)
|
||||
(use-package copilot
|
||||
:vc (:url "https://github.com/copilot-emacs/copilot.el" :rev :newest)
|
||||
:hook (prog-mode . copilot-mode)
|
||||
:bind (:map copilot-completion-map
|
||||
;; copilot-completion-map is only active when ghost text is showing,
|
||||
;; so these bindings don't interfere with Corfu's popup
|
||||
("<tab>" . copilot-accept-completion)
|
||||
("TAB" . copilot-accept-completion)
|
||||
("M-f" . copilot-accept-completion-by-word)
|
||||
("M-n" . copilot-next-completion)
|
||||
("M-p" . copilot-previous-completion))
|
||||
:custom
|
||||
(copilot-idle-delay 0.5))
|
||||
9
work/.config/emacs/lisp/langs/csharp.el
Normal file
9
work/.config/emacs/lisp/langs/csharp.el
Normal file
@@ -0,0 +1,9 @@
|
||||
;;; lisp/langs/csharp.el --- C# -*- lexical-binding: t -*-
|
||||
|
||||
;; csharp-ts-mode is built-in since Emacs 29
|
||||
(with-eval-after-load 'eglot
|
||||
(add-to-list 'eglot-server-programs
|
||||
'((csharp-mode csharp-ts-mode) . ("csharp-ls"))))
|
||||
|
||||
(dolist (hook '(csharp-mode-hook csharp-ts-mode-hook))
|
||||
(add-hook hook #'eglot-ensure))
|
||||
42
work/.config/emacs/lisp/langs/web.el
Normal file
42
work/.config/emacs/lisp/langs/web.el
Normal file
@@ -0,0 +1,42 @@
|
||||
;;; lisp/langs/web.el --- JS / TS / HTML / CSS / React -*- lexical-binding: t -*-
|
||||
|
||||
;; web-mode for JSX, TSX, and HTML template files
|
||||
(use-package web-mode
|
||||
:mode (("\\.jsx\\'" . web-mode)
|
||||
("\\.tsx\\'" . web-mode)
|
||||
("\\.html?\\'" . web-mode))
|
||||
:custom
|
||||
(web-mode-markup-indent-offset 2)
|
||||
(web-mode-css-indent-offset 2)
|
||||
(web-mode-code-indent-offset 2))
|
||||
|
||||
;; typescript-language-server handles JS, TS, JSX, TSX
|
||||
(with-eval-after-load 'eglot
|
||||
(add-to-list 'eglot-server-programs
|
||||
'((js-mode js-ts-mode typescript-ts-mode tsx-ts-mode web-mode)
|
||||
. ("typescript-language-server" "--stdio")))
|
||||
(add-to-list 'eglot-server-programs
|
||||
'((html-mode mhtml-mode)
|
||||
. ("vscode-html-language-server" "--stdio")))
|
||||
(add-to-list 'eglot-server-programs
|
||||
'((css-mode css-ts-mode)
|
||||
. ("vscode-css-language-server" "--stdio"))))
|
||||
|
||||
(dolist (hook '(js-mode-hook js-ts-mode-hook
|
||||
typescript-ts-mode-hook tsx-ts-mode-hook
|
||||
web-mode-hook
|
||||
html-mode-hook mhtml-mode-hook
|
||||
css-mode-hook css-ts-mode-hook))
|
||||
(add-hook hook #'eglot-ensure))
|
||||
|
||||
;; Async formatting via Prettier (apheleia runs formatters without blocking)
|
||||
(use-package apheleia
|
||||
:hook ((js-mode . apheleia-mode)
|
||||
(js-ts-mode . apheleia-mode)
|
||||
(typescript-ts-mode . apheleia-mode)
|
||||
(tsx-ts-mode . apheleia-mode)
|
||||
(css-mode . apheleia-mode)
|
||||
(css-ts-mode . apheleia-mode)
|
||||
(web-mode . apheleia-mode))
|
||||
:config
|
||||
(setf (alist-get 'web-mode apheleia-mode-alist) '(prettier)))
|
||||
Reference in New Issue
Block a user