Remove projectile.el in favor of project.el
This commit is contained in:
parent
cb1b5058fd
commit
a1aab4a3fc
@ -100,8 +100,8 @@
|
|||||||
|
|
||||||
;; Otros atajos
|
;; Otros atajos
|
||||||
(evil-define-key 'motion 'global (kbd "<leader>xb") 'consult-buffer) ;; Cambiar de buffer
|
(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>xp") 'consult-project-extra-find) ;; 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>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>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>xr") 'consult-recent-file) ;; Lista de archivos recientes
|
||||||
(evil-define-key 'motion 'global (kbd "<leader>rg") 'consult-ripgrep) ;; Búsqueda rápida con ripgrep
|
(evil-define-key 'motion 'global (kbd "<leader>rg") 'consult-ripgrep) ;; Búsqueda rápida con ripgrep
|
||||||
|
@ -45,7 +45,8 @@
|
|||||||
("C-x 4 b" . consult-buffer-other-window) ;; orig. switch-to-buffer-other-window
|
("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 5 b" . consult-buffer-other-frame) ;; orig. switch-to-buffer-other-frame
|
||||||
("C-x r b" . consult-bookmark) ;; orig. bookmark-jump
|
("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
|
;; Custom M-# bindings for fast register access
|
||||||
("M-#" . consult-register-load)
|
("M-#" . consult-register-load)
|
||||||
("M-'" . consult-register-store) ;; orig. abbrev-prefix-mark (unrelated)
|
("M-'" . consult-register-store) ;; orig. abbrev-prefix-mark (unrelated)
|
||||||
@ -62,14 +63,10 @@
|
|||||||
("M-g i" . consult-imenu)
|
("M-g i" . consult-imenu)
|
||||||
("M-g I" . consult-imenu-multi)
|
("M-g I" . consult-imenu-multi)
|
||||||
;; M-s bindings in `search-map'
|
;; M-s bindings in `search-map'
|
||||||
("M-s d" . consult-find)
|
("M-s f" . consult-find)
|
||||||
("M-s D" . consult-locate)
|
("M-s l" . consult-locate)
|
||||||
("M-s L" . consult-line-multi)
|
("M-s L" . consult-line-multi)
|
||||||
("M-s k" . consult-keep-lines)
|
("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
|
;; Minibuffer history
|
||||||
:map minibuffer-local-map
|
:map minibuffer-local-map
|
||||||
@ -130,10 +127,12 @@
|
|||||||
:defer t
|
:defer t
|
||||||
:hook (ibuffer-mode . nerd-icons-ibuffer-mode))
|
:hook (ibuffer-mode . nerd-icons-ibuffer-mode))
|
||||||
|
|
||||||
;; Integración entre consult y projectile
|
;; Integración entre consult y project
|
||||||
(use-package consult-projectile
|
(use-package consult-project-extra
|
||||||
:defer t
|
:ensure t
|
||||||
:bind ("C-x p" . consult-projectile))
|
:bind
|
||||||
|
(("C-x p" . consult-project-extra-find)
|
||||||
|
("C-c p o" . consult-project-extra-find-other-window)))
|
||||||
|
|
||||||
;; Descripciones en el minibufer
|
;; Descripciones en el minibufer
|
||||||
(use-package marginalia
|
(use-package marginalia
|
||||||
|
@ -262,45 +262,36 @@
|
|||||||
(use-package prettier
|
(use-package prettier
|
||||||
:defer t)
|
:defer t)
|
||||||
|
|
||||||
;; Paquete para manejo de proyectos
|
(use-package project
|
||||||
(use-package projectile
|
|
||||||
:defer t
|
:defer t
|
||||||
:bind ("C-c p" . projectile-command-map)
|
:ensure nil
|
||||||
:hook (elpaca-after-init . projectile-mode)
|
|
||||||
:init
|
|
||||||
(setq projectile-mode-line-prefix ""
|
|
||||||
projectile-sort-order 'recentf
|
|
||||||
projectile-use-git-grep t)
|
|
||||||
:config
|
: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
|
(setq frame-title-format
|
||||||
'(
|
'(
|
||||||
(:eval
|
(:eval
|
||||||
(let ((project-name (projectile-project-name)))
|
(let ((project-name (kj/project-name)))
|
||||||
(unless (string= "-" project-name)
|
(unless (null project-name)
|
||||||
(format "[%s] " project-name))))
|
(format "[%s] " project-name))))
|
||||||
"%b"
|
"%b"
|
||||||
" - Emacs")
|
" - 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
|
;; Recentf - Guarda registro de los archivos abiertos recientemente
|
||||||
(use-package recentf
|
(use-package recentf
|
||||||
@ -317,7 +308,6 @@
|
|||||||
;; Busqueda rápida con ripgrep
|
;; Busqueda rápida con ripgrep
|
||||||
(use-package rg
|
(use-package rg
|
||||||
:defer t
|
:defer t
|
||||||
:defines projectile-command-map
|
|
||||||
:hook (elpaca-after-init . rg-enable-default-bindings)
|
:hook (elpaca-after-init . rg-enable-default-bindings)
|
||||||
:bind (:map rg-global-map
|
:bind (:map rg-global-map
|
||||||
("c" . rg-dwim-current-dir)
|
("c" . rg-dwim-current-dir)
|
||||||
@ -326,10 +316,7 @@
|
|||||||
:init (setq rg-group-result t
|
:init (setq rg-group-result t
|
||||||
rg-show-columns t)
|
rg-show-columns t)
|
||||||
:config
|
:config
|
||||||
(cl-pushnew '("tmpl" . "*.tmpl") rg-custom-type-aliases)
|
(cl-pushnew '("tmpl" . "*.tmpl") rg-custom-type-aliases))
|
||||||
|
|
||||||
(with-eval-after-load 'projectile
|
|
||||||
(bind-key "s R" #'rg-project projectile-command-map)))
|
|
||||||
|
|
||||||
;; Guardar la posición del cursor en un archivo para volver allí cuando se lo vuelva a abrir.
|
;; Guardar la posición del cursor en un archivo para volver allí cuando se lo vuelva a abrir.
|
||||||
(use-package saveplace
|
(use-package saveplace
|
||||||
|
Loading…
Reference in New Issue
Block a user