summaryrefslogtreecommitdiff
path: root/init.el
diff options
context:
space:
mode:
Diffstat (limited to 'init.el')
-rw-r--r--init.el240
1 files changed, 128 insertions, 112 deletions
diff --git a/init.el b/init.el
index 1cf49b8..bcb133c 100644
--- a/init.el
+++ b/init.el
@@ -6,8 +6,8 @@
;; Restore GC threshold after startup (maximized in early-init.el)
(add-hook 'emacs-startup-hook
- (lambda ()
- (setq gc-cons-threshold (* 100 1024 1024))))
+ (lambda ()
+ (setq gc-cons-threshold (* 100 1024 1024))))
;; =====================================
;; 📦 Package Management (straight.el)
@@ -19,18 +19,18 @@
;; Bootstrap straight.el from XDG config directory
(defvar bootstrap-version)
(let* ((user-dir (file-name-as-directory
- (or (getenv "XDG_CONFIG_HOME") "~/.config/")))
- (emacs-dir (concat user-dir "emacs/"))
- (bootstrap-file
- (expand-file-name "straight/repos/straight.el/bootstrap.el" emacs-dir))
- (bootstrap-version 6))
+ (or (getenv "XDG_CONFIG_HOME") "~/.config/")))
+ (emacs-dir (concat user-dir "emacs/"))
+ (bootstrap-file
+ (expand-file-name "straight/repos/straight.el/bootstrap.el" emacs-dir))
+ (bootstrap-version 6))
(unless (file-exists-p bootstrap-file)
- (with-current-buffer
- (url-retrieve-synchronously
- "https://raw.githubusercontent.com/radian-software/straight.el/develop/install.el"
- 'silent 'inhibit-cookies)
- (goto-char (point-max))
- (eval-print-last-sexp)))
+ (with-current-buffer
+ (url-retrieve-synchronously
+ "https://raw.githubusercontent.com/radian-software/straight.el/develop/install.el"
+ 'silent 'inhibit-cookies)
+ (goto-char (point-max))
+ (eval-print-last-sexp)))
(load bootstrap-file nil 'nomessage))
;; Freeze File
@@ -41,8 +41,8 @@
(setq straight-use-package-by-default t)
;; Essential use-package utilities
-(use-package diminish) ;; Hide/abbreviate minor modes
-(use-package bind-key) ;; Key binding utilities
+(use-package diminish) ;; Hide/abbreviate minor modes
+(use-package bind-key) ;; Key binding utilities
;; =====================================
;; 🎨 UI & Visual Configuration
@@ -58,40 +58,44 @@
;; Disable startup messages and bell
(setq inhibit-startup-screen t
- inhibit-startup-message t
- inhibit-startup-echo-area-message t
- ring-bell-function 'ignore)
+ inhibit-startup-message t
+ inhibit-startup-echo-area-message t
+ ring-bell-function 'ignore)
;; Configure line numbers with themed colors
(global-display-line-numbers-mode 1)
-(setq display-line-numbers-type 'relative) ;; Relative line numbers for Evil mode
+(setq display-line-numbers-type 'relative) ;; Relative line numbers for Evil mode
(set-face-attribute 'line-number nil
- :foreground "#4fa8a8" ;; Softer cyan for line numbers
+ :foreground "#4fa8a8" ;; Softer cyan for line numbers
:background "#003636")
(set-face-attribute 'line-number-current-line nil
- :foreground "#8affff" ;; Bright cyan for current line
+ :foreground "#8affff" ;; Bright cyan for current line
:background "#003636"
:weight 'bold)
(set-face-attribute 'fringe nil :background "#003636")
;; Configure cursor and selection colors
(set-face-attribute 'cursor nil
- :background "#FFC600") ;; Yellow/gold cursor
+ :background "#FFC600") ;; Yellow/gold cursor
(set-face-attribute 'region nil
- :background "#395e5e" ;; Dark teal selection
+ :background "#395e5e" ;; Dark teal selection
:foreground 'unspecified) ;; Keep text color unchanged
;; Configure mode-line colors
(set-face-attribute 'mode-line nil
- :background "#004344" ;; Dark teal background
- :foreground "#8affff" ;; Bright cyan text
+ :background "#004344" ;; Dark teal background
+ :foreground "#8affff" ;; Bright cyan text
:box nil) ;; Remove border
- ;;:box '(:line-width 3 :color "#004344")) ;; Add padding for icons
+;;:box '(:line-width 3 :color "#004344")) ;; Add padding for icons
(set-face-attribute 'mode-line-inactive nil
- :background "#003030" ;; Darker background for inactive
- :foreground "#808080" ;; Gray text for inactive
+ :background "#003030" ;; Darker background for inactive
+ :foreground "#808080" ;; Gray text for inactive
:box nil) ;; Remove border
+;; Configure window divider color (between buffers)
+(set-face-attribute 'vertical-border nil
+ :foreground "#74c4c4") ;; Window divider color
+
;; =====================================
;; 🔧 Editing Behavior
;; =====================================
@@ -108,8 +112,8 @@
;; Global tab settings
(setq-default indent-tabs-mode t) ;; Use tabs, not spaces
-(setq-default tab-width 4) ;; Display tabs as 4 spaces wide
-(setq-default tab-stop-list (number-sequence 4 200 4)) ;; Tab stops every 4 spaces
+(setq-default tab-width 4) ;; Display tabs as 4 spaces wide
+(setq-default tab-stop-list (number-sequence 4 200 4)) ;; Tab stops every 4 spaces
;; Don't convert tabs to spaces when deleting
(setq backward-delete-char-untabify-method nil)
@@ -129,30 +133,30 @@
;; Configure mode-specific indentation offsets to match tab-width
;; This ensures electric-indent uses the right width for ALL major languages
-(setq-default c-basic-offset 4) ;; C, C++, Java, PHP
-(setq-default js-indent-level 4) ;; JavaScript, JSON
-(setq-default typescript-indent-level 4) ;; TypeScript
-(setq-default css-indent-offset 4) ;; CSS
-(setq-default sh-basic-offset 4) ;; Shell scripts
-(setq-default python-indent-offset 4) ;; Python
-(setq-default rust-indent-offset 4) ;; Rust
-(setq-default ruby-indent-level 4) ;; Ruby
-(setq-default perl-indent-level 4) ;; Perl
-(setq-default lua-indent-level 4) ;; Lua
-(setq-default go-ts-mode-indent-offset 4) ;; Go (tree-sitter)
-(setq-default haskell-indent-offset 4) ;; Haskell
+(setq-default c-basic-offset 4) ;; C, C++, Java, PHP
+(setq-default js-indent-level 4) ;; JavaScript, JSON
+(setq-default typescript-indent-level 4) ;; TypeScript
+(setq-default css-indent-offset 4) ;; CSS
+(setq-default sh-basic-offset 4) ;; Shell scripts
+(setq-default python-indent-offset 4) ;; Python
+(setq-default rust-indent-offset 4) ;; Rust
+(setq-default ruby-indent-level 4) ;; Ruby
+(setq-default perl-indent-level 4) ;; Perl
+(setq-default lua-indent-level 4) ;; Lua
+(setq-default go-ts-mode-indent-offset 4) ;; Go (tree-sitter)
+(setq-default haskell-indent-offset 4) ;; Haskell
(setq-default haskell-indentation-left-offset 4)
-(setq-default swift-mode:basic-offset 4) ;; Swift
-(setq-default kotlin-tab-width 4) ;; Kotlin
-(setq-default scala-indent:step 4) ;; Scala
-(setq-default lisp-indent-offset 4) ;; Lisp, Scheme
-(setq-default sgml-basic-offset 4) ;; HTML, XML
-(setq-default nxml-child-indent 4) ;; XML (nxml-mode)
-(setq-default web-mode-markup-indent-offset 4) ;; Web-mode HTML
-(setq-default web-mode-css-indent-offset 4) ;; Web-mode CSS
-(setq-default web-mode-code-indent-offset 4) ;; Web-mode JS/etc
-(setq-default yaml-indent-offset 4) ;; YAML
-(setq-default standard-indent 4) ;; Fallback for other modes
+(setq-default swift-mode:basic-offset 4) ;; Swift
+(setq-default kotlin-tab-width 4) ;; Kotlin
+(setq-default scala-indent:step 4) ;; Scala
+(setq-default lisp-indent-offset 4) ;; Lisp, Scheme
+(setq-default sgml-basic-offset 4) ;; HTML, XML
+(setq-default nxml-child-indent 4) ;; XML (nxml-mode)
+(setq-default web-mode-markup-indent-offset 4) ;; Web-mode HTML
+(setq-default web-mode-css-indent-offset 4) ;; Web-mode CSS
+(setq-default web-mode-code-indent-offset 4) ;; Web-mode JS/etc
+(setq-default yaml-indent-offset 4) ;; YAML
+(setq-default standard-indent 4) ;; Fallback for other modes
;; Make sure electric-indent respects tabs
(setq electric-indent-inhibit nil)
@@ -161,10 +165,10 @@
(defun tabify-current-line ()
"Convert leading spaces to tabs on the current line."
(when indent-tabs-mode
- (save-excursion
- (beginning-of-line)
- (when (looking-at "[ \t]+")
- (tabify (point) (match-end 0))))))
+ (save-excursion
+ (beginning-of-line)
+ (when (looking-at "[ \t]+")
+ (tabify (point) (match-end 0))))))
;; Run after electric-indent
(add-hook 'post-self-insert-hook 'tabify-current-line)
@@ -175,44 +179,44 @@
;; Show whitespace characters like Vim's listchars
(use-package whitespace
- :straight nil ;; Built-in package
+ :straight nil ;; Built-in package
:hook (prog-mode . whitespace-mode)
:config
;; What to visualize
(setq whitespace-style '(face
- tabs
- spaces
- trailing
- space-mark
- tab-mark
- newline
- newline-mark))
+ tabs
+ spaces
+ trailing
+ space-mark
+ tab-mark
+ newline
+ newline-mark))
;; Character mappings (like Vim listchars)
(setq whitespace-display-mappings
- '(
- ;; tab: show as "│»»»" (char 9 = tab)
- (tab-mark 9 [9474 187 187 187] [124 187 187 187])
- ;; space: show as "·" (char 32 = space)
- (space-mark 32 [183] [46])
- ;; newline: show as "↲" (char 10 = newline)
- (newline-mark 10 [8626 10] [182 10])
- ;; non-breaking space: show as "␣"
- (space-mark 160 [9251] [95])))
+ '(
+ ;; tab: show as "│»»»" (char 9 = tab)
+ (tab-mark 9 [9474 187 187 187] [124 187 187 187])
+ ;; space: show as "·" (char 32 = space)
+ (space-mark 32 [183] [46])
+ ;; newline: show as "↲" (char 10 = newline)
+ (newline-mark 10 [8626 10] [182 10])
+ ;; non-breaking space: show as "␣"
+ (space-mark 160 [9251] [95])))
;; Face colors for whitespace characters
(set-face-attribute 'whitespace-tab nil
- :foreground "#016868"
- :background nil)
+ :foreground "#016868"
+ :background nil)
(set-face-attribute 'whitespace-space nil
- :foreground "#016868"
- :background nil)
+ :foreground "#016868"
+ :background nil)
(set-face-attribute 'whitespace-newline nil
- :foreground "#016868"
- :background nil)
+ :foreground "#016868"
+ :background nil)
(set-face-attribute 'whitespace-trailing nil
- :foreground "#d2691e"
- :background "#003030"))
+ :foreground "#d2691e"
+ :background "#003030"))
;; Toggle whitespace-mode with a keybinding
;; (global-set-key (kbd "C-c w") 'whitespace-mode)
@@ -225,52 +229,52 @@
;; Uses composition-function-table for proper ligature rendering
(defconst jetbrains-mono-ligatures
'("-->" "//" "/**" "/*" "*/" "<!--" ":=" "->>" "<<-" "->" "<-"
- "<=>" "==" "!=" "<=" ">=" "=:=" "!==" "&&" "||" "..." ".."
- "|||" "///" "&&&" "===" "++" "--" "=>" "|>" "<|" "||>" "<||"
- "|||>" "<|||" ">>" "<<" "::=" "|]" "[|" "{|" "|}"
- "[<" ">]" ":?>" ":?" "/=" "[||]" "!!" "?:" "?." "::"
- "+++" "??" "###" "##" ":::" "####" ".?" "?=" "=!=" "<|>"
- "<:" ":<" ":>" ">:" "<>" "***" ";;" "/==" ".=" ".-" "__"
- "=/=" "<-<" "<<<" ">>>" "<=<" "<<=" "<==" "<==>" "==>" "=>>"
- ">=>" ">>=" ">>-" ">-" "<~>" "-<" "-<<" "=<<" "---" "<-|"
- "<=|" "/\\" "\\/" "|=>" "|~>" "<~~" "<~" "~~" "~~>" "~>"
- "<$>" "<$" "$>" "<+>" "<+" "+>" "<*>" "<*" "*>" "</>" "</" "/>"
- "<->" "..<" "~=" "~-" "-~" "~@" "^=" "-|" "_|_" "|-" "||-"
- "|=" "||=" "#{" "#[" "]#" "#(" "#?" "#_" "#_(" "#:" "#!" "#="
- "&="))
+ "<=>" "==" "!=" "<=" ">=" "=:=" "!==" "&&" "||" "..." ".."
+ "|||" "///" "&&&" "===" "++" "--" "=>" "|>" "<|" "||>" "<||"
+ "|||>" "<|||" ">>" "<<" "::=" "|]" "[|" "{|" "|}"
+ "[<" ">]" ":?>" ":?" "/=" "[||]" "!!" "?:" "?." "::"
+ "+++" "??" "###" "##" ":::" "####" ".?" "?=" "=!=" "<|>"
+ "<:" ":<" ":>" ">:" "<>" "***" ";;" "/==" ".=" ".-" "__"
+ "=/=" "<-<" "<<<" ">>>" "<=<" "<<=" "<==" "<==>" "==>" "=>>"
+ ">=>" ">>=" ">>-" ">-" "<~>" "-<" "-<<" "=<<" "---" "<-|"
+ "<=|" "/\\" "\\/" "|=>" "|~>" "<~~" "<~" "~~" "~~>" "~>"
+ "<$>" "<$" "$>" "<+>" "<+" "+>" "<*>" "<*" "*>" "</>" "</" "/>"
+ "<->" "..<" "~=" "~-" "-~" "~@" "^=" "-|" "_|_" "|-" "||-"
+ "|=" "||=" "#{" "#[" "]#" "#(" "#?" "#_" "#_(" "#:" "#!" "#="
+ "&="))
;; Sort ligatures by length (longest first) to ensure proper matching
(setq jetbrains-mono-ligatures
- (sort jetbrains-mono-ligatures
- (lambda (x y) (> (length x) (length y)))))
+ (sort jetbrains-mono-ligatures
+ (lambda (x y) (> (length x) (length y)))))
;; Register each ligature pattern in the composition function table
(dolist (ligature jetbrains-mono-ligatures)
(let ((pattern (regexp-quote ligature))
- (first-char (aref ligature 0)))
- (set-char-table-range composition-function-table
- first-char
- (nconc (char-table-range composition-function-table first-char)
- (list (vector pattern
- 0
- 'compose-gstring-for-graphic))))))
+ (first-char (aref ligature 0)))
+ (set-char-table-range composition-function-table
+ first-char
+ (nconc (char-table-range composition-function-table first-char)
+ (list (vector pattern
+ 0
+ 'compose-gstring-for-graphic))))))
;; =====================================
;; Smooth Scrolling
;; =====================================
;; (use-package ultra-scroll
-;; ;:vc (:url "https://github.com/jdtsmith/ultra-scroll") ; if desired (emacs>=v30)
-;; :init
-;; (setq scroll-conservatively 3 ; or whatever value you prefer, since v0.4
-;; scroll-margin 0) ; important: scroll-margin>0 not yet supported
-;; :config
-;; (ultra-scroll-mode 1))
+;; ;:vc (:url "https://github.com/jdtsmith/ultra-scroll") ; if desired (emacs>=v30)
+;; :init
+;; (setq scroll-conservatively 3 ; or whatever value you prefer, since v0.4
+;; scroll-margin 0) ; important: scroll-margin>0 not yet supported
+;; :config
+;; (ultra-scroll-mode 1))
(pixel-scroll-precision-mode 1)
(setq scroll-conservatively 101
- scroll-margin 0
- scroll-preserve-screen-position t)
+ scroll-margin 0
+ scroll-preserve-screen-position t)
;; =====================================
@@ -290,3 +294,15 @@
;; =====================================
(load (expand-file-name "config/modeline.el" user-emacs-directory))
+
+;; =====================================
+;; 🌲 Treemacs
+;; =====================================
+
+(load (expand-file-name "config/treemacs.el" user-emacs-directory))
+
+;; =====================================
+;; 🪄 Magit
+;; =====================================
+
+(load (expand-file-name "config/magit.el" user-emacs-directory))