Add Emacs desktop provisioning and dev toolchain packages

Install Emacs and copy the desktop .emacs.d config so the editor setup is managed with the rest of desktop dotfiles. Add vterm/build/debug dependencies plus C/C++ and Go tooling needed by the configured workflow.
This commit is contained in:
Fabio Scotto di Santolo
2026-03-17 11:50:59 +01:00
parent a94c34e053
commit 18fd0fa129
148 changed files with 2048 additions and 0 deletions

View File

@@ -0,0 +1,63 @@
;;; completion.el -*- lexical-binding: t; -*-
(use-package ivy
:ensure t
:config
(ivy-mode 1))
(use-package consult
:ensure t
:defer t)
(use-package company
:ensure t
:custom
(company-tooltip-align-annotations 't)
(company-minimum-prefix-length 1)
(company-idle-delay 0.1)
:hook (prog-mode . company-mode))
(with-eval-after-load 'company
(add-hook 'bash-ts-mode-hook 'company-mode))
;; Static analysis for code base
(use-package flycheck
:ensure t
:hook (prog-mode . flycheck-mode)
:config
(setq flycheck-check-syntax-automatically '(save mode-enabled)))
;; Snippets
(use-package yasnippet
:ensure t
:config
(setq yas/root-directory
(list "~/.emacs.d/snippets") yas-indent-line 'fixed)
(yas-global-mode))
(use-package orderless
:ensure t
:custom
(completion-styles '(orderless basic))
(completion-category-overrides '((file (styles partial-completion))))
(completion-pcm-leading-wildcard t)
:config
(setq ivy-re-builders-alist '((t . orderless-ivy-re-builder)))
(add-to-list 'ivy-highlight-functions-alist '(orderless-ivy-re-builder . orderless-ivy-highlight)))
(defun just-one-face (fn &rest args)
(let ((orderless-match-faces [completions-common-part]))
(apply fn args)))
(advice-add 'company-capf--candidates :around #'just-one-face)
(use-package smartparens
:ensure smartparens ;; install the package
:hook (prog-mode text-mode markdown-mode) ;; add `smartparens-mode` to these hooks
:config
;; load default config
(require 'smartparens-config))
(provide 'completion)
;;; completion.el ends here

View File

@@ -0,0 +1,24 @@
(use-package dap-mode
:ensure t
:after lsp-mode
:hook (lsp-mode . dap-mode)
:init
;; Enabling only some features
(setq dap-auto-configure-features '(sessions locals expressions repl))
:config
(dap-mode 1)
(dap-ui-mode 1)
(dap-ui-controls-mode 1)
;; Auto show breakpoints + REPL
(setq dap-ui-buffer-configurations
'(;; RIGHT SIDE — Debug data (like IntelliJ)
(dap-ui-locals . ((side . right) (slot . 1) (window-width . 0.30)))
(dap-ui-sessions . ((side . right) (slot . 2) (window-width . 0.30)))
(dap-ui-expressions . ((side . right) (slot . 3) (window-width . 0.30)))
;; BOTTOM — Console / REPL
(dap-ui-repl . ((side . bottom) (slot . 1) (window-height . 0.25)))
(dap-ui-console . ((side . bottom) (slot . 2) (window-height . 0.25)))))
;; Loading DAP adapters
;; For Python
(require 'dap-python)
(setq dap-python-debugger 'debugpy))

View File

@@ -0,0 +1,49 @@
;;; lsp.el -*- lexical-binding: t; -*-
(use-package lsp-mode
:ensure t
:commands (lsp lsp-deferred)
:hook
((c-mode
c-ts-mode
c++-mode
c++-ts-mode
python-mode
python-ts-mode
sh-mode
bash-ts-mode) . lsp-deferred)
:config
;; Performance
(setq lsp-enable-symbol-highlighting t
lsp-enable-snippet t
lsp-log-io nil
lsp-modeline-code-actions-enable nil
lsp-modeline-diagnostics-enable nil
lsp-signature-auto-activate nil
lsp-enable-on-type-formatting nil
lsp-completion-provider :capf
lsp-diagnostics-provider :flycheck
lsp-headerline-breadcrumb-enable nil
lsp-enable-indentation nil
;; Disable for huge projects
lsp-enable-file-watchers nil
lsp-idle-delay 0.5))
(use-package lsp-ui
:ensure t
:config
(setq lsp-ui-doc-enable t
lsp-ui-doc-delay 0.3
lsp-ui-sideline-enable t
lsp-ui-sideline-show-code-actions t))
(use-package consult-lsp
:ensure t
:after (consult lsp-mode)
:commands
(consult-lsp-symbols
consult-lsp-diagnostics))
(provide 'lsp)
;;; lsp.el ends here

View File

@@ -0,0 +1,25 @@
;;; project.el - lexical-binding *-*
(use-package projectile
:ensure t
:defer 1
:init
;; Root detection
(setq projectile-project-search-path '("~/Projects" "~/Work" "~/Progetti" "~/.local/src"))
(setq projectile-completion-system 'ivy)
:config
;; Performance
(setq projectile-enable-caching t)
(setq projectile-indexing-method 'hybrid)
(setq projectile-sort-order 'recently-active)
;; Projectile as single source of truth
(setq projectile-switch-project-action #'projectile-dired)
;; Use ripgrep if available
(when (executable-find "rg")
(setq projectile-generic-command "rg --files --hidden --glob '!.git'"))
;; Enable globally
(projectile-mode 1))
(provide 'project)
;;; project.el ends here

View File

@@ -0,0 +1,29 @@
;;; treesitter.el -*- lexical-binding: t; -*-
(use-package treesit
:ensure nil
:config
(setq treesit-font-lock-level 4)
(setq treesit-auto-install t)
(setq major-mode-remap-alist
'((c-mode . c-ts-mode)
(c++-mode . c++-ts-mode)
(go-mode . go-ts-mode)
(go-mod-mode . go-mod-ts-mode)
(python-mode . python-ts-mode)
(sh-mode . bash-ts-mode)))
(setq treesit-language-source-alist
'((bash "https://github.com/tree-sitter/tree-sitter-bash")
(c "https://github.com/tree-sitter/tree-sitter-c")
(cpp "https://github.com/tree-sitter/tree-sitter-cpp")
(dockerfile "https://github.com/camdencheek/tree-sitter-dockerfile")
(go "https://github.com/tree-sitter/tree-sitter-go")
(gomod "https://github.com/camdencheek/tree-sitter-go-mod")
(js "https://github.com/tree-sitter/tree-sitter-javascript")
(json "https://github.com/tree-sitter/tree-sitter-json")
(node "https://github.com/tree-sitter/node-tree-sitter")
(python "https://github.com/tree-sitter/tree-sitter-python"))))
(provide 'treesitter)
;;; treesitter.el ends here