Compare commits

...

2 Commits

Author SHA1 Message Date
KJ
a1aab4a3fc Remove projectile.el in favor of project.el 2024-04-13 19:02:22 -04:00
KJ
cb1b5058fd Delete unused config file. 2024-04-13 18:52:01 -04:00
4 changed files with 32 additions and 106 deletions

View File

@ -100,8 +100,8 @@
;; Otros atajos
(evil-define-key 'motion 'global (kbd "<leader>xb") 'consult-buffer) ;; Cambiar de buffer
(evil-define-key 'motion 'global (kbd "<leader>xp") 'consult-projectile) ;; Archivos del proyecto (o abrir proyecto si no hay alguno)
(evil-define-key 'motion 'global (kbd "<leader>cp") 'projectile-switch-project) ;; Cambiar proyecto
(evil-define-key 'motion 'global (kbd "<leader>xp") 'consult-project-extra-find) ;; Archivos del proyecto (o abrir proyecto si no hay alguno)
(evil-define-key 'motion 'global (kbd "<leader>cp") 'project-switch-project) ;; Cambiar proyecto
(evil-define-key 'motion 'global (kbd "<leader>xf") 'find-file) ;; Abrir archivo
(evil-define-key 'motion 'global (kbd "<leader>xr") 'consult-recent-file) ;; Lista de archivos recientes
(evil-define-key 'motion 'global (kbd "<leader>rg") 'consult-ripgrep) ;; Búsqueda rápida con ripgrep

View File

@ -45,7 +45,8 @@
("C-x 4 b" . consult-buffer-other-window) ;; orig. switch-to-buffer-other-window
("C-x 5 b" . consult-buffer-other-frame) ;; orig. switch-to-buffer-other-frame
("C-x r b" . consult-bookmark) ;; orig. bookmark-jump
("C-x p b" . consult-project-buffer) ;; orig. project-switch-to-buffer
("C-c p b" . consult-project-buffer) ;; orig. project-switch-to-buffer
("C-c p p" . project-switch-project) ;; orig. project-switch-to-buffer
;; Custom M-# bindings for fast register access
("M-#" . consult-register-load)
("M-'" . consult-register-store) ;; orig. abbrev-prefix-mark (unrelated)
@ -62,14 +63,10 @@
("M-g i" . consult-imenu)
("M-g I" . consult-imenu-multi)
;; M-s bindings in `search-map'
("M-s d" . consult-find)
("M-s D" . consult-locate)
("M-s f" . consult-find)
("M-s l" . consult-locate)
("M-s L" . consult-line-multi)
("M-s k" . consult-keep-lines)
("M-s u" . consult-focus-lines)
;; Isearch integration
:map isearch-mode-map
("M-e" . consult-isearch-history) ;; orig. isearch-edit-string
;; Minibuffer history
:map minibuffer-local-map
@ -130,10 +127,12 @@
:defer t
:hook (ibuffer-mode . nerd-icons-ibuffer-mode))
;; Integración entre consult y projectile
(use-package consult-projectile
:defer t
:bind ("C-x p" . consult-projectile))
;; Integración entre consult y project
(use-package consult-project-extra
:ensure t
:bind
(("C-x p" . consult-project-extra-find)
("C-c p o" . consult-project-extra-find-other-window)))
;; Descripciones en el minibufer
(use-package marginalia

View File

@ -262,46 +262,37 @@
(use-package prettier
:defer t)
;; Paquete para manejo de proyectos
(use-package projectile
(use-package project
:defer t
:bind ("C-c p" . projectile-command-map)
:hook (elpaca-after-init . projectile-mode)
:init
(setq projectile-mode-line-prefix ""
projectile-sort-order 'recentf
projectile-use-git-grep t)
:ensure nil
:config
;; Rutas de archivos temporales.
(setq projectile-cache-file (expand-file-name "projectile.cache" temp-dir))
(setq projectile-known-projects-file (expand-file-name
"projectile-bookmarks.eld" temp-dir))
;; Cambiar el título de la ventana de emacs
(defun kj/project-name (&optional project)
"Return the name for PROJECT.
If PROJECT is not specified, assume current project root."
(when-let (root (or project (kj/project-root)))
(file-name-nondirectory
(directory-file-name
(file-name-directory root)))))
(defun kj/project-root ()
"Return the current project root."
(when-let (project (project-current))
(project-root project)))
;; Colocamos un título del frame más bonito y útil que el por defecto
(setq frame-title-format
'(
(:eval
(let ((project-name (projectile-project-name)))
(unless (string= "-" project-name)
(let ((project-name (kj/project-name)))
(unless (null project-name)
(format "[%s] " project-name))))
"%b"
" - Emacs")
)
)
(defun projectile-desktop-save-hook ()
"Nombres de los archivos de desktop-save según el nombre del proyecto."
(setq desktop-hash
(secure-hash 'md5 (concat (projectile-project-root))))
(setq
desktop-base-file-name (concat ".emacs-" desktop-hash ".desktop")
desktop-base-lock-name (concat ".emacs-" desktop-hash ".desktop" ".lock"))
)
(add-hook 'projectile-after-switch-project-hook #'projectile-desktop-save-hook)
)
;; Recentf - Guarda registro de los archivos abiertos recientemente
(use-package recentf
:defer t
@ -317,7 +308,6 @@
;; Busqueda rápida con ripgrep
(use-package rg
:defer t
:defines projectile-command-map
:hook (elpaca-after-init . rg-enable-default-bindings)
:bind (:map rg-global-map
("c" . rg-dwim-current-dir)
@ -326,10 +316,7 @@
:init (setq rg-group-result t
rg-show-columns t)
:config
(cl-pushnew '("tmpl" . "*.tmpl") rg-custom-type-aliases)
(with-eval-after-load 'projectile
(bind-key "s R" #'rg-project projectile-command-map)))
(cl-pushnew '("tmpl" . "*.tmpl") rg-custom-type-aliases))
;; Guardar la posición del cursor en un archivo para volver allí cuando se lo vuelva a abrir.
(use-package saveplace

View File

@ -1,60 +0,0 @@
;;; init-treemacs.el --- Extensiones/paquetes instalados y su configuración -*- lexical-binding: t -*-
;; Author: kj <webmaster@outcontrol.net>
;; URL: https://git.kj2.me/kj/confi-emacs-actual
;;; Commentary:
;; Aquí se encuentran las configuraciones y paquetes relacionados
;; con treemacs.
;;
;; treemacs es esa barra lateral con los archivos en modo árbol.
;;; Code:
(use-package treemacs
:defer t
:commands (treemacs-follow-mode
treemacs-filewatch-mode
treemacs-fringe-indicator-mode
treemacs-git-mode)
:custom-face
(cfrs-border-color ((t (:background ,(face-foreground 'font-lock-comment-face nil t)))))
:bind (([f9] . treemacs)
([f8] . treemacs-display-current-project-exclusively)
:map treemacs-mode-map
([mouse-1] . treemacs-single-click-expand-action))
:config
(setq treemacs-collapse-dirs (if treemacs-python-executable 3 0)
treemacs-missing-project-action 'remove
treemacs-sorting 'alphabetic-asc
treemacs-follow-after-init t
treemacs-width 30)
:config
(treemacs-follow-mode t)
(treemacs-filewatch-mode t)
(pcase (cons (not (null (executable-find "git")))
(not (null (executable-find "python3"))))
(`(t . t)
(treemacs-git-mode 'deferred))
(`(t . _)
(treemacs-git-mode 'simple))))
(use-package treemacs-projectile
:defer t
:after (treemacs projectile)
:bind (:map projectile-command-map
("h" . treemacs-projectile)))
(use-package treemacs-magit
:defer t
:after magit
:commands treemacs-magit--schedule-update
:hook ((magit-post-commit
git-commit-post-finish
magit-post-stage
magit-post-unstage)
. treemacs-magit--schedule-update))
(provide 'init-treemacs)
;;; init-treemacs.el ends here