This commit is contained in:
laura 2025-10-22 15:37:58 -03:00
parent fdd1f91482
commit 709f48fca0
Signed by: w
GPG key ID: BCD2117C99E69817
3 changed files with 402 additions and 149 deletions

View file

@ -7,23 +7,32 @@
** Generic optimizations
#+begin_src emacs-lisp
(setq gc-cons-threshold most-positive-fixnum)
(add-hook 'emacs-startup-hook
(lambda ()
(setq gc-cons-threshold (* 50 1024 1024))))
(add-hook
'emacs-startup-hook
(lambda () (setq gc-cons-threshold (* 50 1024 1024))))
(setq backup-directory-alist '(("." . "~/.config/emacs/backups")))
(setq auto-save-file-name-transforms '((".*" "~/.config/emacs/auto-save-list/" t)))
(setq delete-old-versions t
(setq auto-save-file-name-transforms
'((".*" "~/.config/emacs/auto-save-list/" t)))
(setq
delete-old-versions t
kept-new-versions 6
kept-old-versions 2
version-control t)
(setq undo-limit (* 8 1024 1024))
(save-place-mode 1)
#+end_src
#+RESULTS:
: t
** Declutter user interface
#+begin_src emacs-lisp
(menu-bar-mode -1)
(tool-bar-mode -1)
(scroll-bar-mode -1)
(setq warning-minimum-level :error)
#+end_src
** Tweak appearance
@ -45,11 +54,13 @@
help-window-select t
use-short-answers t)
(dolist (mode '(term-mode-hook
(dolist (mode
'(term-mode-hook
shell-mode-hook
treemacs-mode-hook
eshell-mode-hook
help-mode-hook
neotree-mode-hook
vterm-mode-hook))
(add-hook mode (lambda () (display-line-numbers-mode 0))))
#+end_src
@ -104,19 +115,21 @@
* EDITING & MODAL INPUT
** Meow modal editing
#+begin_src emacs-lisp
(use-package meow
(use-package
meow
:ensure t
:preface
(defun meow-word ()
"Expand word/symbol under cursor."
(interactive)
(if (and (use-region-p)
(equal (car (region-bounds))
(bounds-of-thing-at-point 'word)))
(equal
(car (region-bounds)) (bounds-of-thing-at-point 'word)))
(meow-mark-symbol 1)
(progn
(when (and (mark)
(equal (car (region-bounds))
(equal
(car (region-bounds))
(bounds-of-thing-at-point 'symbol)))
(meow-pop-selection))
(meow-mark-word 1))))
@ -131,8 +144,7 @@
"Kill till end of line and switch to INSERT state."
(interactive)
(meow--cancel-selection)
(meow-end-of-thing
(car (rassoc 'line meow-char-thing-table)))
(meow-end-of-thing (car (rassoc 'line meow-char-thing-table)))
(meow-change))
(defun meow-save-clipboard ()
@ -200,11 +212,10 @@
(defun meow-ergo-setup ()
(setq meow-cheatsheet-layout meow-cheatsheet-layout-qwerty)
(setq meow-normal-state-keymap (make-sparse-keymap))
(setf (alist-get 'normal meow-keymap-alist) meow-normal-state-keymap)
(setf (alist-get 'normal meow-keymap-alist)
meow-normal-state-keymap)
(meow-motion-define-key
'("l" . meow-next)
'("j" . meow-prev)
'("<escape>" . ignore))
'("l" . meow-next) '("j" . meow-prev) '("<escape>" . ignore))
(meow-leader-define-key
'("1" . meow-digit-argument)
'("2" . meow-digit-argument)
@ -219,9 +230,8 @@
'("/" . meow-keypad-describe-key)
'("?" . meow-cheatsheet))
(meow-thing-register 'angle
'(pair ("<") (">"))
'(pair ("<") (">")))
(meow-thing-register
'angle '(pair ("<") (">")) '(pair ("<") (">")))
(setq meow-char-thing-table
'((?f . round)
@ -328,9 +338,7 @@
'("<escape>" . ignore)))
:config
(meow-ergo-setup)
(meow-global-mode 1))
:config (meow-ergo-setup) (meow-global-mode 1))
#+end_src
** Formatter
@ -342,6 +350,9 @@
"Auto-format whole buffer."
(interactive)
(cond
((and (bound-and-true-p eglot--managed-mode)
(eglot-managed-p))
(eglot-format-buffer))
((derived-mode-p 'prolog-mode)
(prolog-indent-buffer))
((derived-mode-p 'emacs-lisp-mode)
@ -355,6 +366,9 @@
(add-hook 'prog-mode-hook #'format-all-ensure-formatter))
#+end_src
#+RESULTS:
: [nil 26871 47188 711924 nil elpaca-process-queues nil nil 283000 nil]
* PROGRAMMING FEATURES
** Syntax highlighting
#+begin_src emacs-lisp
@ -367,94 +381,239 @@
(global-treesit-auto-mode))
#+end_src
#+RESULTS:
: [nil 26870 64740 146030 nil elpaca-process-queues nil nil 133000 nil]
** LSP
#+begin_src emacs-lisp
(use-package lsp-mode
:ensure t
:hook
(prog-mode . lsp-deferred)
(lsp-mode . lsp-enable-which-key-integration)
:commands (lsp lsp-deferred)
:init
(setq lsp-keymap-prefix "C-c l")
:custom
(lsp-idle-delay 0.500)
(lsp-log-io nil)
(lsp-completion-provider :none)
(lsp-headerline-breadcrumb-enable nil))
;; (use-package
;; lsp-mode
;; :ensure t
;; :hook
;; (prog-mode . lsp-deferred)
;; (lsp-mode . lsp-enable-which-key-integration)
;; :commands (lsp lsp-deferred)
;; :init (setq lsp-keymap-prefix "C-c l")
;; :custom
;; (lsp-completion-provider :none)
;; (lsp-headerline-breadcrumb-enable nil))
(use-package flycheck
:ensure t
(use-package eglot
:hook
(prog-mode . eglot-ensure)
:custom
(eglot-events-buffer-size 0)
(eglot-sync-connect t)
(eglot-autoshutdown t)
(eglot-report-progress t)
:bind (:map eglot-mode-map
("C-c l r" . eglot-rename)
("C-c l a" . eglot-code-actions)
("C-c l f" . eglot-format)
("C-c l F" . eglot-format-buffer)
("C-c l d" . xref-find-definitions)
("C-c l R" . xref-find-references)
("C-c l h" . eldoc))
:config
(global-flycheck-mode +1))
(add-to-list 'eglot-server-programs
'((js-mode typescript-mode tsx-ts-mode typescript-ts-mode js-ts-mode)
. ("deno" "lsp" :initializationOptions
(:enable t
:lint t
:unstable t
:config nil)))))
(use-package
sideline
:ensure t
:hook (flymake-mode . sideline-mode)
:init (setq sideline-backends-right '(sideline-flymake)))
(use-package
sideline-flymake
:ensure t
:after sideline
:hook (flymake-mode . sideline-flymake-setup))
#+end_src
#+RESULTS:
: [nil 26873 7819 534617 nil elpaca-process-queues nil nil 890000 nil]
qq
: #[128 "\304\300\"\205 \304\301\"\207" [lsp-display-warning-advise #<subr display-warning> :before-while nil apply] 4 advice]
** Indentation preferences
#+begin_src emacs-lisp
(setq-default
indent-tabs-mode t
tab-width 4
standard-indent 4)
(setq tab-always-indent 1)
(setq tab-always-indent t)
(use-package dtrt-indent
(use-package
dtrt-indent
:ensure t
:hook (prog-mode . dtrt-indent-mode))
(use-package whitespace
:hook (prog-mode . whitespace-mode)
(use-package
highlight-indent-guides
:ensure t
:hook
(prog-mode . highlight-indent-guides-mode)
(org-mode . highlight-indent-guides-mode)
:custom
(whitespace-style '(face tabs tab-mark trailing))
(whitespace-display-mappings
'((tab-mark ?\t [?→ ?\t] [?> ?\t]))))
(highlight-indent-guides-auto-enabled nil)
(highlight-indent-guides-method 'bitmap)
:config
(set-face-background 'highlight-indent-guides-odd-face "#252A2E")
(set-face-background 'highlight-indent-guides-even-face "#16191C")
(set-face-foreground 'highlight-indent-guides-character-face "#252A2E"))
#+end_src
#+RESULTS:
: [nil 26871 55888 184183 nil elpaca-process-queues nil nil 358000 nil]
** Emacs Lisp Tools
#+begin_src emacs-lisp
(use-package elisp-autofmt
:ensure t)
#+end_src
#+RESULTS:
: [nil 26871 52804 309295 nil elpaca-process-queues nil nil 101000 nil]
* COMPLETION SYSTEM
** Helpful documentation
#+begin_src emacs-lisp
(use-package helpful
:ensure t
:bind
([remap describe-function] . helpful-callable)
([remap describe-variable] . helpful-variable)
([remap describe-key] . helpful-key))
(use-package helpful
:ensure t
:bind
([remap describe-function] . helpful-callable)
([remap describe-variable] . helpful-variable)
([remap describe-key] . helpful-key))
#+end_src
** Minibuffer completion (Vertico + Marginalia)
#+begin_src emacs-lisp
(use-package marginalia
(use-package
marginalia
:ensure t
:bind (:map minibuffer-local-map
("M-A" . marginalia-cycle))
:init
(marginalia-mode))
:bind (:map minibuffer-local-map ("M-A" . marginalia-cycle))
:init (marginalia-mode))
(use-package vertico
(use-package
vertico
:ensure t
:custom
(vertico-cycle t)
:init
(vertico-mode))
:custom (vertico-cycle t)
:init (vertico-mode))
(use-package savehist
:init
(savehist-mode))
(use-package savehist :init (savehist-mode))
(use-package orderless
(use-package
orderless
:ensure t
:custom
(completion-styles '(orderless basic))
(completion-category-defaults nil)
(completion-category-overrides '((file (styles partial-completion)))))
(completion-category-overrides
'((file (styles partial-completion)))))
(use-package
consult
:ensure t
:bind
( ;; C-c bindings (mode-specific-map)
("C-c h" . consult-history)
("C-c m" . consult-mode-command)
("C-c k" . consult-kmacro)
;; C-x bindings (ctl-x-map)
("C-x M-:" . consult-complex-command)
("C-x b" . consult-buffer)
("C-x 4 b" . consult-buffer-other-window)
("C-x 5 b" . consult-buffer-other-frame)
("C-x r b" . consult-bookmark)
;; M-g bindings (goto-map)
("M-g e" . consult-compile-error)
("M-g g" . consult-goto-line)
("M-g M-g" . consult-goto-line)
("M-g o" . consult-outline)
("M-g m" . consult-mark)
("M-g k" . consult-global-mark)
("M-g i" . consult-imenu)
("M-g I" . consult-imenu-multi)
;; M-s bindings (search-map)
("M-s d" . consult-find)
("M-s D" . consult-locate)
("M-s g" . consult-grep)
("M-s G" . consult-git-grep)
("M-s r" . consult-ripgrep)
("M-s l" . consult-line)
("M-s L" . consult-line-multi)
("M-s k" . consult-keep-lines)
("M-s u" . consult-focus-lines)
;; Isearch integration
("M-s e" . consult-isearch-history)
:map
isearch-mode-map
("M-e" . consult-isearch-history)
("M-s e" . consult-isearch-history)
("M-s l" . consult-line)
("M-s L" . consult-line-multi)
;; Minibuffer history
:map
minibuffer-local-map
("M-s" . consult-history)
("M-r" . consult-history))
:hook (completion-list-mode . consult-preview-at-point-mode)
:init
(setq
xref-show-xrefs-function #'consult-xref
xref-show-definitions-function #'consult-xref)
:custom (consult-preview-key 'any) (consult-narrow-key "<")
:config
(consult-customize
consult-theme
:preview-key
'(:debounce 0.2 any)
consult-ripgrep
consult-git-grep
consult-grep
consult-bookmark
consult-recent-file
consult-xref
consult--source-bookmark
consult--source-file-register
consult--source-recent-file
consult--source-project-recent-file
:preview-key '(:debounce 0.4 any)))
(use-package
consult-projectile
:ensure t
:after (consult projectile)
:bind
("C-c p p" . consult-projectile-switch-project)
("C-c p f" . consult-projectile-find-file)
("C-c p s" . consult-projectile-ripgrep))
(use-package
consult-eglot
:ensure t
:after (consult eglot)
:bind
(:map eglot-mode-map ("C-c l s" . consult-eglot-symbols)))
#+end_src
** Minibuffer settings
#+begin_src emacs-lisp
(use-package emacs
:custom
(context-menu-mode t)
(enable-recursive-minibuffers t)
(read-extended-command-predicate #'command-completion-default-include-p)
(use-package
emacs
:custom (context-menu-mode t) (enable-recursive-minibuffers t)
(read-extended-command-predicate
#'command-completion-default-include-p)
(text-mode-ispell-word-completion nil)
(minibuffer-prompt-properties
'(read-only t cursor-intangible t face minibuffer-prompt)))
@ -462,31 +621,27 @@
** In-buffer completion (Corfu + Cape)
#+begin_src emacs-lisp
(use-package corfu
(use-package
corfu
:ensure t
:custom
(corfu-auto t)
(corfu-cycle t)
(corfu-preselect 'prompt)
:init
(global-corfu-mode)
(corfu-history-mode)
(corfu-popupinfo-mode)
:custom (corfu-auto t) (corfu-cycle t) (corfu-preselect 'prompt)
:init (global-corfu-mode) (corfu-history-mode) (corfu-popupinfo-mode)
:bind
(:map corfu-map
(:map
corfu-map
("TAB" . corfu-next)
([tab] . corfu-next)
("S-TAB" . corfu-previous)
([backtab] . corfu-previous)))
(use-package cape
(use-package
cape
:ensure t
:bind ("C-c p" . cape-prefix-map)
:hook
((completion-at-point-functions . cape-dabbrev)
(completion-at-point-functions . cape-file)
(completion-at-point-functions . cape-elisp-block)))
#+end_src
#+RESULTS:
@ -495,41 +650,74 @@
* VISUAL APPEARANCE
** Theme and colors
#+begin_src emacs-lisp
(use-package doom-themes
(use-package base16-theme
:ensure t
:custom
(doom-themes-enable-bold t)
(doom-themes-enable-italic t)
:config
(load-theme 'doom-moonlight t)
(doom-themes-visual-bell-config)
(doom-themes-org-config)
(load-theme 'base16-moonlight t)
(let ((bg "#16191C")
(fg "#C5CACE")
(bg-alt "#252A2E")
(fg-alt "#A3AAAF")
(fg-muted "#50555A"))
(custom-set-faces
`(default ((t (:background ,bg :foreground ,fg))))
(custom-theme-set-faces `user
`(default
((t (:background ,bg :foreground ,fg))))
`(fringe ((t (:background ,bg))))
`(hl-line ((t (:background ,bg-alt))))
`(mode-line ((t (:background ,bg-alt :foreground ,fg))))
`(mode-line-inactive ((t (:background ,bg :foreground ,fg-muted))))
`(line-number ((t (:foreground ,fg-muted :background ,bg))))
`(line-number-current-line ((t (:foreground ,fg-alt :background ,bg-alt :weight bold))))
`(font-lock-comment-face ((t (:foreground ,fg-alt)))))))
`(mode-line
((t
(:background
,bg-alt
:foreground ,fg))))
`(mode-line-inactive
((t
(:background
,bg
:foreground ,fg-muted))))
`(line-number
((t
(:foreground
,fg-muted
:background ,bg))))
`(line-number-current-line
((t
(:foreground
,fg-alt
:background ,bg-alt
:weight bold))))
`(font-lock-comment-face
((t (:foreground ,fg-alt))))
(add-hook 'org-mode-hook
(lambda ()
(set-face-background 'org-block "#16191C")
(set-face-foreground 'org-block "#C5CACE")
(set-face-background 'org-block-begin-line "#252A2E")
(set-face-foreground 'org-block-begin-line "#A3AAAF")
(set-face-background 'org-block-end-line "#252A2E")
(set-face-foreground 'org-block-end-line "#A3AAAF")))
;; Whitespace
`(whitespace-space-after-tab
((t (:background ,bg :foreground ,bg-alt))))
`(whitespace-space--tab
((t (:background ,bg :foreground ,bg-alt))))
`(whitespace-indentation
((t (:background ,bg :foreground ,bg-alt))))
`(whitespace-newline
((t (:background ,bg :foreground ,bg-alt))))
`(whitespace-trailing
((t (:background ,bg :foreground ,bg-alt))))
;; Org blocks
`(org-block
((t (:background ,bg :foreground ,fg))))
`(org-block-begin-line
((t
(:background
,bg-alt
:foreground ,fg-alt))))
`(org-block-end-line
((t
(:background
,bg-alt
:foreground ,fg-alt)))))))
#+end_src
#+RESULTS:
: [nil 26871 55003 957999 nil elpaca-process-queues nil nil 979000 nil]
** Modeline
#+begin_src emacs-lisp
(use-package doom-modeline
@ -545,8 +733,10 @@
(colorful-use-prefix t)
(colorful-only-strings 'only-prog)
(css-fontify-colors nil)
:hook
(prog-mode . colorful-mode)
(org-mode . colorful-mode)
:config
(global-colorful-mode t)
(add-to-list 'global-colorful-modes 'helpful-mode))
(use-package rainbow-delimiters
@ -555,13 +745,19 @@
#+end_src
#+RESULTS:
: [nil 26870 59644 357807 nil elpaca-process-queues nil nil 727000 nil]
: [nil 26871 58654 83112 nil elpaca-process-queues nil nil 37000 nil]
* INTEGRATIONS & UTILITIES
** Discord presence
#+begin_src emacs-lisp
(use-package elcord
:ensure t
:custom
(elcord-client-id "1430340921655824454")
(elcord-icon-base "https://raw.githubusercontent.com/xwra/elcord/master/icons/")
(elcord-refresh-rate 5)
(elcord-idle-timer 150)
(elcord-show-small-icon nil)
:config
(elcord-mode +1))
#+end_src
@ -598,32 +794,54 @@
:config
(add-hook 'elpaca-after-init-hook #'dashboard-insert-startupify-lists)
(add-hook 'elpaca-after-init-hook #'dashboard-initialize)
(dashboard-setup-startup-hook))
(dashboard-setup-startup-hook)
(setq initial-buffer-choice (lambda () (get-buffer "*dashboard*"))))
#+end_src
** File tree
#+begin_src emacs-lisp
(use-package treemacs
(use-package neotree
:ensure t
:bind ("C-c t" . treemacs)
:config
(setq treemacs-width 30))
(use-package treemacs-projectile
:ensure t
:after (treemacs projectile))
(use-package treemacs-all-the-icons
:ensure t
:after (treemacs all-the-icons)
:config
(treemacs-load-theme "all-the-icons"))
(use-package treemacs-icons-dired
:ensure t
:hook (dired-mode . treemacs-icons-dired-enable-once))
:bind ("C-c t" . neotree-toggle))
#+end_src
#+RESULTS:
: [nil 26870 60289 404113 nil elpaca-process-queues nil nil 420000 nil]
: [nil 26872 5674 84936 nil elpaca-process-queues nil nil 792000 nil]
** Which-key and navigation
#+begin_src emacs-lisp
(use-package
which-key
:ensure t
:custom
(which-key-idle-delay 0.3)
(which-key-popup-type 'side-window)
(which-key-side-window-location 'bottom)
(which-key-side-window-max-height 0.1)
(which-key-max-description-length 32)
(which-key-add-column-padding 1)
(which-key-sort-order 'which-key-key-order-alpha)
(which-key-separator " → ")
(which-key-prefix-prefix "+")
(which-key-allow-imprecise-window-fit nil)
:config (which-key-mode +1))
(use-package
eldoc-box
:ensure t
:hook (eglot-managed-mode . eldoc-box-hover-at-point-mode)
:custom
(eldoc-box-max-pixel-width 800)
(eldoc-box-max-pixel-height 600))
(use-package
embark
:ensure t
:bind
(("C-." . embark-act)
("C-;" . embark-dwim)
("C-h C-z" . embark-bindings))
:config (setq prefix-help-command #'embark-prefix-help-command))
#+end_src
#+RESULTS:
: [nil 26873 9253 947918 nil elpaca-process-queues nil nil 729000 nil]

View file

@ -10,3 +10,36 @@
(expand-file-name
"config.org"
user-emacs-directory))
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(custom-safe-themes
'("c7951fc937039f8f1640fce55d97628d8b2cd124461d6a28dce13fcc29fbed1d"
default))
'(package-selected-packages '(eglot)))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(default ((t (:background "#16191C" :foreground "#C5CACE"))))
'(flycheck-error ((t (:underline (:style line :color "#ff5370")))))
'(flycheck-info ((t (:underline (:style line :color "#2df4c0")))))
'(flycheck-warning ((t (:underline (:style line :color "#ffc777")))))
'(font-lock-comment-face ((t (:foreground "#A3AAAF"))))
'(fringe ((t (:background "#16191C"))))
'(hl-line ((t (:background "#252A2E"))))
'(line-number ((t (:foreground "#50555A" :background "#16191C"))))
'(line-number-current-line ((t (:foreground "#A3AAAF" :background "#252A2E" :weight bold))))
'(mode-line ((t (:background "#252A2E" :foreground "#C5CACE"))))
'(mode-line-inactive ((t (:background "#16191C" :foreground "#50555A"))))
'(org-block ((t (:background "#16191C" :foreground "#C5CACE"))))
'(org-block-begin-line ((t (:background "#252A2E" :foreground "#A3AAAF"))))
'(org-block-end-line ((t (:background "#252A2E" :foreground "#A3AAAF"))))
'(whitespace-indentation ((t (:background "#16191C" :foreground "#252A2E"))))
'(whitespace-newline ((t (:background "#16191C" :foreground "#252A2E"))))
'(whitespace-space--tab ((t (:background "#16191C" :foreground "#252A2E"))))
'(whitespace-space-after-tab ((t (:background "#16191C" :foreground "#252A2E"))))
'(whitespace-trailing ((t (:background "#16191C" :foreground "#252A2E")))))

View file

@ -113,6 +113,8 @@ mode "normal" {
# Activate workspaces mode with Super+x
bindsym $mod+x mode "normal"
bindsym $mod+tab workspace back_and_forth
#
# Resizing containers:
#