Compare commits

..

No commits in common. "29328974c2205b399ac8a3bcedefd10a8c8a9eae" and "c60c4b8a11aa9cdf3624e3854e6924aa62de5a71" have entirely different histories.

4 changed files with 119 additions and 111 deletions

View File

@ -96,7 +96,7 @@
(show-paren-mode 1) ; Habilitar resaltado de brackets. (show-paren-mode 1) ; Habilitar resaltado de brackets.
(pending-delete-mode t) ; Cuando selecciono un texto y escribo, el texto se borra (emacs por defecto solo escribe donde está el cursor). (pending-delete-mode t) ; Cuando selecciono un texto y escribo, el texto se borra (emacs por defecto solo escribe donde está el cursor).
;; (global-hl-line-mode) ; Resaltar línea actual por defecto. ;; (global-hl-line-mode) ; Resaltar línea actual por defecto.
(setq use-short-answers t) ; Usar respuesta cortas (y/n) en lugar de las largas (yes/no)
(setq-default (setq-default
cursor-type 'bar ; Usar la barrita como cursor cursor-type 'bar ; Usar la barrita como cursor
cursor-in-non-selected-windows nil ; Desaparecer el cursor en frames no activos. cursor-in-non-selected-windows nil ; Desaparecer el cursor en frames no activos.

View File

@ -22,7 +22,9 @@
:hook ((elpaca-after-init . global-corfu-mode) :hook ((elpaca-after-init . global-corfu-mode)
(corfu-mode . corfu-popupinfo-mode)) (corfu-mode . corfu-popupinfo-mode))
:bind (("<escape>" . corfu-quit) :bind (("<escape>" . corfu-quit)
("<SPC>" . corfu-insert-separator)) ("<SPC>" . corfu-insert-separator)
:map corfu-map
([tab] . nil))
:custom :custom
(corfu-auto t) (corfu-auto t)
:config :config
@ -35,8 +37,10 @@
) )
(use-package orderless (use-package orderless
:defer t
:config :config
(setq completion-styles '(orderless basic) (setq completion-styles '(orderless basic)
completion-category-defaults nil
completion-category-overrides '((file (styles partial-completion))))) completion-category-overrides '((file (styles partial-completion)))))
(use-package cape (use-package cape

View File

@ -10,138 +10,134 @@
;;; Code: ;;; Code:
;; UI para completado ;; Autocompletado y sugerencias para el minibuffer
(use-package vertico (use-package counsel
:defer t :defer t
:bind (:map vertico-map :diminish ivy-mode counsel-mode
("RET" . vertico-directory-enter) :bind (("C-s" . swiper-isearch)
("DEL" . vertico-directory-delete-char) ("C-r" . counsel-rg)
("M-DEL" . vertico-directory-delete-word)) ("M-x" . counsel-M-x)
:hook ((elpaca-after-init . vertico-mode) ("<menu>" . counsel-M-x)
(elpaca-after-init . savehist-mode) ;; savehist sirve para recordar el último comando de M-x
(rfn-eshadow-update-overlay . vertico-directory-tidy)))
;; Reemplazo para counsel ;; ("C-c C-r" . ivy-resume)
(use-package consult ;; ("C-c v p" . ivy-push-view)
:defer t ;; ("C-c v o" . ivy-pop-view)
:bind (;; C-c bindings in `mode-specific-map' ;; ("C-c v ." . ivy-switch-view)
("C-s" . consult-line)
("C-r" . consult-ripgrep)
("C-S-s" . isearch-forward)
("C-S-r" . isearch-backward)
("M-m" . consult-mode-command)
("C-c h" . consult-history)
("C-c k" . consult-kmacro)
([remap Info-search] . consult-info) ;; Colocando isearch en otro keybind
([remap imenu] . consult-imenu) ("C-S-s" . isearch-forward)
([remap recentf-open-files] . consult-recent-file) ("C-S-r" . isearch-backward)
;; C-x bindings in `ctl-x-map'
("C-x M-." . consult-complex-command) ;; orig. repeat-complex-command
("C-x b" . consult-buffer) ;; orig. switch-to-buffer
("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
;; Custom M-# bindings for fast register access
("M-#" . consult-register-load)
("M-'" . consult-register-store) ;; orig. abbrev-prefix-mark (unrelated)
("M-¡" . consult-register)
;; Other custom bindings
("M-y" . consult-yank-pop) ;; orig. yank-pop
;; M-g bindings in `goto-map'
("M-g f" . consult-flymake) ;; Alternative: consult-flycheck
("M-g g" . consult-goto-line) ;; orig. goto-line
("M-g M-g" . consult-goto-line) ;; orig. goto-line
("M-g o" . consult-outline) ;; Alternative: consult-org-heading
("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 in `search-map'
("M-s d" . consult-find)
("M-s D" . 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 :map isearch-mode-map
("M-e" . consult-isearch-history) ;; orig. isearch-edit-string ("C-S-s" . isearch-repeat-forward)
("C-S-r" . isearch-repeat-backward)
;; Minibuffer history :map counsel-mode-map
:map minibuffer-local-map ([remap swiper] . counsel-grep-or-swiper)
([remap swiper-backward] . counsel-grep-or-swiper-backward)
([remap dired] . counsel-dired)
([remap set-variable] . counsel-set-variable)
([remap insert-char] . counsel-unicode-char)
([remap recentf-open-files] . counsel-recentf)
([remap org-capture] . counsel-org-capture)
([remap jump-to-register] . counsel-register)
:map ivy-minibuffer-map
("C-w" . ivy-yank-word)
("<tab>" . ivy-partial)
("<escape>" . minibuffer-keyboard-quit) ("<escape>" . minibuffer-keyboard-quit)
("C-s" . (lambda ()
"Insert the currunt symbol."
(interactive)
(insert (save-excursion
(set-buffer (window-buffer (minibuffer-selected-window)))
(or (thing-at-point 'symbol t) "")))))
("M-s" . consult-history) ;; orig. next-matching-history-element
("M-r" . consult-history)) ;; orig. previous-matching-history-element
;; Enable automatic preview at point in the *Completions* buffer. This is :map counsel-find-file-map
;; relevant when you use the default completion UI. ("C-h" . counsel-up-directory)
:hook (completion-list-mode . consult-preview-at-point-mode)
;; The :init configuration is always executed (Not lazy) :map swiper-map
("M-%" . swiper-query-replace)
)
:hook ((ivy-mode . counsel-mode))
:init :init
;; Optionally configure the register formatting. This improves the register (setq enable-recursive-minibuffers t) ; Allow commands in minibuffers
;; preview for `consult-register', `consult-register-load',
;; `consult-register-store' and the Emacs built-ins.
(setq register-preview-delay 0.5
register-preview-function #'consult-register-format)
;; Optionally tweak the register preview window. (setq ivy-height 12
;; This adds thin lines, sorting and hides the mode line of the window. ivy-use-selectable-prompt t
(advice-add #'register-preview :override #'consult-register-window) ivy-use-virtual-buffers t ; Enable bookmarks and recentf
ivy-fixed-height-minibuffer t
ivy-count-format "(%d/%d) "
ivy-on-del-error-function #'ignore
ivy-initial-inputs-alist nil)
;; Use Consult to select xref locations with preview ;; Use orderless regex strategy
(with-eval-after-load 'xref (setq ivy-re-builders-alist '((t . ivy--regex-ignore-order)))
(setq xref-show-xrefs-function #'consult-xref
xref-show-definitions-function #'consult-xref))
;; Set minibuffer height for different commands
(setq ivy-height-alist '((counsel-evil-registers . 5)
(counsel-yank-pop . 8)
(counsel-git-log . 4)
(swiper . 15)
(counsel-projectile-ag . 15)
(counsel-projectile-rg . 15)))
(setq swiper-action-recenter t)
(setq counsel-find-file-at-point t
counsel-preselect-current-file t
counsel-yank-pop-separator "\n────────\n")
(add-hook 'counsel-grep-post-action-hook #'recenter)
;; Use the faster search tools
(when (executable-find "rg")
(setq counsel-grep-base-command "rg -S --no-heading --line-number --color never '%s' '%s'"))
(when (executable-find "fd")
(setq counsel-fzf-cmd
"fd --type f --hidden --follow --exclude .git --color never '%s'"))
)
;; Integración entre projectile y counsel
(use-package counsel-projectile
:defer t
:bind*
("C-x p" . counsel-projectile)
:hook (counsel-mode . counsel-projectile-mode)
:init (setq counsel-projectile-grep-initial-input '(ivy-thing-at-point)))
;; Autocompletado, sugerencias y menú de búsqueda mejorados (este paquete incluye counsel y swiper)
(use-package ivy
:defer t
:hook (elpaca-after-init . ivy-mode)
:config :config
;; Optionally configure preview. The default value (setq ivy-use-virtual-buffers nil))
;; is 'any, such that any key triggers the preview.
;; (setq consult-preview-key 'any)
(setq consult-preview-key "M-.")
;; (setq consult-preview-key '("S-<down>" "S-<up>"))
;; For some commands and buffer sources it is useful to configure the
;; :preview-key on a per-command basis using the `consult-customize' macro.
(consult-customize
consult-goto-line
consult-theme :preview-key '(:debounce 0.4 any))
;; Optionally configure the narrowing key. ;; Ivy pero con más detalles en pantalla
;; Both < and C-+ work reasonably well. (use-package ivy-rich
(setq consult-narrow-key "<") ;; "C-+" :defer t
:ensure t
:hook ((counsel-projectile-mode . ivy-rich-mode) ; MUST after `counsel-projectile'
(ivy-rich-mode . ivy-rich-project-root-cache-mode)
(ivy-rich-mode . (lambda ()
"Use abbreviate in `ivy-rich-mode'."
(setq ivy-virtual-abbreviate
(or (and ivy-rich-mode 'abbreviate) 'name)))))
:init
;; For better performance
(setq ivy-rich-parse-remote-buffer nil))
;; Optionally make narrowing help available in the minibuffer. ;; nerd-icons en ivy
;; You may want to use `embark-prefix-help-command' or which-key instead. (use-package nerd-icons-ivy-rich
(define-key consult-narrow-map (vconcat consult-narrow-key "?") #'consult-narrow-help)) :defer t
:ensure t
:hook (ivy-mode . nerd-icons-ivy-rich-mode))
;; nerd-icons en ibuffer ;; nerd-icons en ibuffer
(use-package nerd-icons-ibuffer (use-package nerd-icons-ibuffer
:defer t :defer t
:hook (ibuffer-mode . nerd-icons-ibuffer-mode)) :hook (ibuffer-mode . nerd-icons-ibuffer-mode))
;; Integración entre consult y projectile ;; Ordenar los comandos usados en M-x (por uso y luego alfabéticamente)
(use-package consult-projectile (use-package smex
:defer t :defer t
:bind ("C-x p" . consult-projectile)) :after (counsel))
;; Descripciones en el minibufer
(use-package marginalia
:defer t
:hook (elpaca-after-init . marginalia-mode))
;; Nerd icons para vertico
(use-package nerd-icons-completion
:after nerd-icons
:config (nerd-icons-completion-mode))
(provide 'init-minibuffer) (provide 'init-minibuffer)
;;; init-minibuffer.el ends here ;;; init-minibuffer.el ends here

View File

@ -194,6 +194,7 @@
:defer t :defer t
:bind ("C-c p" . projectile-command-map) :bind ("C-c p" . projectile-command-map)
:hook (elpaca-after-init . projectile-mode) :hook (elpaca-after-init . projectile-mode)
:custom ((projectile-completion-system 'ivy))
:init :init
(setq projectile-mode-line-prefix "" (setq projectile-mode-line-prefix ""
projectile-sort-order 'recentf projectile-sort-order 'recentf
@ -203,6 +204,13 @@
(setq projectile-cache-file (expand-file-name "projectile.cache" temp-dir)) (setq projectile-cache-file (expand-file-name "projectile.cache" temp-dir))
(setq projectile-known-projects-file (expand-file-name (setq projectile-known-projects-file (expand-file-name
"projectile-bookmarks.eld" temp-dir)) "projectile-bookmarks.eld" temp-dir))
;; Carpetas donde tienes tus proyectos (deben tener un archivo .projectile o un repro git inicio).
(when (file-directory-p "~/Proyectos")
(setq projectile-project-search-path '("~/Proyectos")))
(when (file-directory-p "~/mnt/Nginx")
(setq projectile-project-search-path (append
projectile-project-search-path
'("~/mnt/Nginx"))))
;; Cambiar el título de la ventana de emacs ;; Cambiar el título de la ventana de emacs
(setq frame-title-format (setq frame-title-format