85 lines
3.4 KiB
EmacsLisp
85 lines
3.4 KiB
EmacsLisp
;;; base-keys.el --- Archivo de configuración de atajos
|
|
|
|
;; Author: kj <webmaster@outcontrol.net>
|
|
;; URL: https://git.kj2.me/kj/confi-emacs-actual
|
|
|
|
;;; Commentary:
|
|
|
|
;; Aquí se configuran los atajos globales.
|
|
;; Es posible que haya otros, ya que muchos se configuran
|
|
;; directamente en los paquetes/extensiones y dependen de los mismos.
|
|
|
|
;;; Code:
|
|
|
|
(global-set-key (kbd "C-x C-z") nil) ; Unbind C-x C-z (don't minimize)
|
|
(global-set-key (kbd "C-z") 'undo) ; Unbind C-z y hacerlo funcionar para deshacer cambios
|
|
(global-set-key (kbd "C-S-z") 'undo-redo) ; Rehacer cambios con C-S-z
|
|
(global-set-key (kbd "C-S-a") 'mark-whole-buffer) ; Seleccionar todo con CTRL+SHIFT+a.
|
|
|
|
(global-set-key (kbd "C-x c c")
|
|
'comment-or-uncomment-region) ; Comentar/descomentar en lote
|
|
|
|
(global-set-key (kbd "C-<f6>") 'create-tags) ; Generar o Regeneral el archivo TAGS
|
|
|
|
(global-set-key (kbd "C-<f11>") 'toggle-frame-maximized) ; Maximizar / restaurar
|
|
|
|
(global-set-key (kbd "C-c a") 'org-agenda) ; Abrir la agenda.
|
|
(global-set-key (kbd "C-c c") 'org-capture) ; Abrir la crear una entrada.
|
|
|
|
;; Cambios rápidos de major modes
|
|
(global-set-key (kbd "C-x m") nil) ; Unbind mail on C-x m
|
|
(global-set-key (kbd "C-x mh") 'html-mode)
|
|
(global-set-key (kbd "C-x mj") 'js-mode)
|
|
(global-set-key (kbd "C-x mp") 'php-mode)
|
|
|
|
;; Vterm
|
|
(global-set-key (kbd "C-x tt") 'multi-vterm-dedicated-toggle)
|
|
(global-set-key (kbd "C-x tf") 'multi-vterm)
|
|
(global-set-key (kbd "C-x tp") 'multi-vterm-project)
|
|
|
|
;; Atajos de windmove
|
|
(global-set-key (kbd "C-x C-<left>") 'windmove-left)
|
|
(global-set-key (kbd "C-x C-<right>") 'windmove-right)
|
|
(global-set-key (kbd "C-x C-<up>") 'windmove-up)
|
|
(global-set-key (kbd "C-x C-<down>") 'windmove-down)
|
|
|
|
;; Atajos para reemplazar (los por fedecto no van bien para el teclado en español)
|
|
(global-set-key (kbd "C-x /") 'query-replace-regexp)
|
|
(global-set-key (kbd "M-/") 'query-replace)
|
|
|
|
;; Atajo para origami-mode
|
|
(global-set-key (kbd "C-<tab>") 'origami-toggle-node)
|
|
(global-set-key (kbd "C-<iso-lefttab>") 'origami-toggle-all-nodes)
|
|
|
|
;; Atajo para counsel-proyectile
|
|
(global-set-key (kbd "C-x p") 'counsel-projectile)
|
|
|
|
;; Atajos de Ivy
|
|
(global-set-key (kbd "C-x s") 'swiper)
|
|
(global-set-key (kbd "C-x C-r") 'ivy-resume)
|
|
(global-set-key (kbd "C-x b") 'ivy-switch-buffer)
|
|
(global-set-key (kbd "C-x C-b") 'ivy-switch-buffer)
|
|
(define-key ivy-minibuffer-map (kbd "TAB") 'ivy-partial)
|
|
(define-key ivy-minibuffer-map (kbd "<escape>") 'minibuffer-keyboard-quit)
|
|
|
|
;; Atajos projectile
|
|
(global-set-key (kbd "C-c p") 'projectile-command-map)
|
|
|
|
;; Atajos counsel
|
|
(global-set-key (kbd "M-x") 'counsel-M-x)
|
|
(global-set-key (kbd "C-x C-f") 'counsel-find-file)
|
|
(global-set-key (kbd "M-y") 'counsel-yank-pop)
|
|
(define-key company-active-map (kbd "<tab>") 'company-indent-or-complete-common) ; autocompletar con tab como se haría en bash-competition en la terminal de linux
|
|
(define-key company-active-map (kbd "<escape>") 'company-abort) ; cerrar las sugerencias de autocompletado precionando escape.
|
|
|
|
;; Atajos org-roam
|
|
(global-set-key (kbd "C-c r i") 'org-roam-node-insert)
|
|
(global-set-key (kbd "C-c r f") 'org-roam-node-find)
|
|
(global-set-key (kbd "C-c r t") 'org-roam-buffer-toggle)
|
|
|
|
;; Meta atajos (atajos de atajos)
|
|
(global-set-key (kbd "C-c l d") "\C-a\C- \C-n\M-w\C-y") ; Duplicar línea
|
|
|
|
(provide 'base-keys)
|
|
;;; base-keys.el ends here
|