Split Emacs configuration in modules

This commit is contained in:
Fabio Scotto di Santolo
2025-12-23 10:29:49 +01:00
parent c793146ebb
commit 7711e4156f
24 changed files with 864 additions and 895 deletions

View File

@@ -0,0 +1,23 @@
;;; core-editor
(setq standard-indent 4)
(setq tab-stop-list nil)
(setq indent-tabs-mode nil)
;; C / C++ fallback style (Linux-like)
(setq c-default-style "linux"
c-basic-offset 4
tab-width 8)
(add-hook 'c-mode-common-hook
(lambda ()
(setq indent-tabs-mode t)))
;; Tree-sitter C/C++
(setq c-ts-mode-indent-offset 4)
(setq c++-ts-mode-indent-offset 4)
;; Setting variables
(setq vc-follow-symlinks 't)
(prefer-coding-system 'utf-8-unix)
(setq custom-file (null-device))

View File

@@ -0,0 +1,3 @@
;; Legacy alias (keep muscle memory)
(global-set-key (kbd "C-c v g") #'magit-status)
(global-set-key (kbd "C-c g") #'fscotto/magit-dispatch)

View File

@@ -0,0 +1,15 @@
;; core-packages.el -*- lexical-binding: t; -*-
(require 'use-package)
(use-package package
:config
;; Setting repo priorities
(setq package-archive-priorities
'(("melpa-stable" . 2)
("MELPA" . 1)
("gnu" . 0)))
;; Setting repo URL
(setq package-archives
'(("melpa-stable" . "https://stable.melpa.org/packages/")
("MELPA" . "https://melpa.org/packages/")
("gnu" . "https://elpa.gnu.org/packages/"))))

View File

@@ -0,0 +1,22 @@
;;; core-performance.el -*-
;; --- Startup speed tweaks ----------------------------------------------------
;; Temporarily increase GC threshold during init
(defvar fscotto/gc-cons-threshold-orig gc-cons-threshold)
(setq gc-cons-threshold (* 50 1000 1000)) ;; 50MB for init
;; Speedup file-name-handler during init
(defvar fscotto/file-name-handler-alist-orig file-name-handler-alist)
(setq file-name-handler-alist nil)
;; Restore after init
(add-hook 'emacs-startup-hook
(lambda ()
(setq gc-cons-threshold fscotto/gc-cons-threshold-orig)
(setq file-name-handler-alist fscotto/file-name-handler-alist-orig)
(garbage-collect)))
;; LSP responsiveness
(setq read-process-output-max (* 1024 1024)) ;; 1MB, utile per lsp-mode
(setq lsp-idle-delay 0.5) ;; meno ritardo prima che LSP aggiorni info
(setq inhibit-compacting-font-caches t)

View File

@@ -0,0 +1,67 @@
;;;; core-ui.el -*-
;; Load default theme
(load-theme 'wombat)
;; Setting default font
(set-frame-font "Iosevka Nerd Font 14" nil t)
;; Remove toolbar
(tool-bar-mode -1)
;; Remove menu
(menu-bar-mode -1)
;; Disable startup screen
(setq inhibit-startup-screen t)
;; Disable splash screen
(setq inhibit-splash-screen t)
;; Start all frames maximized
(add-to-list 'default-frame-alist '(fullscreen . maximized))
;; Remove scrollbar
(scroll-bar-mode -1)
;; Simple 'y' for 'yes' and 'n' for 'no'
(defalias 'yes-or-no-p 'y-or-n-p)
;; Set global value for paragraph witdh
(setq-default fill-column 120)
;; Stop Emacs from losing informations
(setq undo-limit 8000000)
(setq undo-strong-limit 12000000)
;; Smooth scroll
(setq scroll-step 3)
(setq ring-bell-function 'ignore)
;; Add column number in the status line
(column-number-mode)
;; View clock in the status line
(display-time)
;; Enable line numbers in the programming mode only
(add-hook 'prog-mode-hook 'display-line-numbers-mode)
;; Enable line numbers in the configuration mode only
(add-hook 'conf-mode-hook 'display-line-numbers-mode)
;; Setting default directory for Org files
(setq org-directory "~/Remotes/pCloud/Org")
(use-package ivy
:ensure t
:config
(ivy-mode 1))
(use-package consult
:ensure t
:defer t)
(use-package ibuffer
:ensure t
:bind (:map global-map ("C-x C-b" . ibuffer)))