From bb48ac228a49c5989008d0f7140199bba3696b13 Mon Sep 17 00:00:00 2001 From: Mateus Rodrigues Date: Sun, 12 Jul 2026 15:22:19 +0100 Subject: [PATCH] add some comments to separate more clearly sections of the config file. Add folding capabilities. Move some definitions around --- elisp/extras.el | 71 ++++++++++++++++++++++++++++++++++++------------- 1 file changed, 52 insertions(+), 19 deletions(-) diff --git a/elisp/extras.el b/elisp/extras.el index 6b0c38c..b0fa119 100644 --- a/elisp/extras.el +++ b/elisp/extras.el @@ -71,6 +71,10 @@ ;; Read feeds (use-package elfeed) +;; The following packages are base packages to enable a more featureful programming and, +;; more generally, text editing environment. Things like, better shell/terminals, git, +;; text folding, etc. + ;; Eshell configuration ;; We need colors in eshell (use-package xterm-color) @@ -115,12 +119,58 @@ (use-package company :hook (after-init . global-company-mode)) -(use-package tomlparse) - (use-package treemacs :demand t :bind ("" . treemacs)) +;; Text folding front end +(use-package kirigami + :custom + ;; Add Kirigami to the menu bar and context menu (`context-menu-mode'). + (kirigami-show-menu-bar t) + (kirigami-show-context-menu t) + :bind (("C-c z o" . kirigami-open-fold) ; Open fold at point + ("C-c z O" . kirigami-open-fold-rec) ; Open fold recursively + ("C-c z r" . kirigami-open-folds) ; Open all folds + ("C-c z c" . kirigami-close-fold) ; Close fold at point + ("C-c z m" . kirigami-close-folds) ; Close all folds + ("C-c z a" . kirigami-toggle-fold)) ; Toggle fold at point + :init + (kirigami-global-mode 1)) + +;; Text folding back ends +(use-package treesit-fold + :defer t + :hook (python-ts-mode . treesit-fold-mode)) + +(use-package eglot + :straight (:type built-in) + :defer t + :hook ((python-base-mode . eglot-ensure))) + +(use-package dape) + +;; For a more ergonomic Emacs and `dape' experience +(use-package repeat + :custom + (repeat-mode +1)) + +;; Left and right side windows occupy full frame height +(use-package emacs + :custom + (window-sides-vertical t)) + +;; SPECIFIC PROGRAMMING LANGUAGE PACKAGES AND CONFIGURATION + +;; TODO search if there already is a less hacky way to do this. +;; make emacs to call python-ts-mode whenever it would python-mode +(setq major-mode-remap-alist + '((python-mode . python-ts-mode))) + +;; TODO do I really need this, what was the use case for including this package? It can +;; also be better configured as by its README on its git repository. +(use-package tomlparse) + ;; Javascript and React (use-package rjsx-mode :config @@ -180,23 +230,6 @@ ;; View logs (use-package log4j-mode) -(use-package eglot - :straight (:type built-in) - :defer t - :hook ((python-base-mode . eglot-ensure))) - -(use-package dape) - -;; For a more ergonomic Emacs and `dape' experience -(use-package repeat - :custom - (repeat-mode +1)) - -;; Left and right side windows occupy full frame height -(use-package emacs - :custom - (window-sides-vertical t)) - ;; TRAMP (load "~/.emacs.d/elisp/tramp-setup.el") (load "~/.emacs.d/elisp/outline-keymap.el")