116 lines
3.1 KiB
EmacsLisp
116 lines
3.1 KiB
EmacsLisp
;;; init-vc.el --- Configuración del control de versiones -*- lexical-binding: t -*-
|
|
|
|
;; Author: kj <webmaster@outcontrol.net>
|
|
;; URL: https://git.kj2.me/kj/confi-emacs-actual
|
|
|
|
;;; Commentary:
|
|
|
|
;; Archivo de configuración específico para el control de versiones.
|
|
;;
|
|
;; Puedes que hoy en día la norma es usar git para este trabajo,
|
|
;; la gran mayoría de configuraciones son justamente para el mismo.
|
|
|
|
|
|
;;; Code:
|
|
|
|
;; Resolver diferencias entre 2 archivos o versiones del mismo.
|
|
(use-package ediff
|
|
:defer t
|
|
:ensure nil
|
|
:config
|
|
(setq ediff-diff-options "")
|
|
(setq ediff-custom-diff-options "-u")
|
|
(setq ediff-window-setup-function 'ediff-setup-windows-plain)
|
|
(setq ediff-split-window-function 'split-window-vertically))
|
|
|
|
;; Git Gutter - Marca a la izq. si una linea ha sido agregada, editada o eliminada desde el último commit.
|
|
(use-package git-gutter
|
|
:defer t
|
|
:hook
|
|
(elpaca-after-init . global-git-gutter-mode)
|
|
:config
|
|
(defhydra hydra-git-gutter (:hint nil)
|
|
"
|
|
^Navigation^ | ^Actions^ | ^Others^
|
|
-^-----------^-+-^----^--------+-^-------^----------
|
|
_p_: previous | _s_: stage | _m_: mark
|
|
_n_: next | _r_: revert | _SPC_: toggle info
|
|
-^-----------^-+-^----^--------+-^-------^----------
|
|
"
|
|
("p" git-gutter:previous-hunk)
|
|
("n" git-gutter:next-hunk)
|
|
("s" git-gutter:stage-hunk)
|
|
("r" git-gutter:revert-hunk)
|
|
("m" git-gutter:mark-hunkmark)
|
|
("SPC" git-gutter:toggle-popup-hunk))
|
|
)
|
|
|
|
;; Visitar rápidamente viejas versiones de un archivo rápidamente
|
|
(use-package git-timemachine
|
|
:ensure t
|
|
:defer t)
|
|
|
|
;; Generador automatizado de archivos de licencia
|
|
(use-package license-templates
|
|
:defer t)
|
|
|
|
;; Magia para git
|
|
(use-package magit
|
|
:defer t)
|
|
|
|
;; Todolist en magit de todos los archivos del projecto.
|
|
(use-package magit-todos
|
|
:defer t
|
|
:after magit
|
|
:config (magit-todos-mode 1))
|
|
|
|
;; Modo para resolución de confictos
|
|
(use-package smerge-mode
|
|
:ensure nil
|
|
:defer t
|
|
:config
|
|
(defhydra hydra-smerge (:color pink
|
|
:hint nil)
|
|
"
|
|
^Move^ ^Keep^ ^Diff^ ^Other^
|
|
^^-----------^^-------------------^^---------------------^^-------
|
|
_n_ext _b_ase _<_: upper/base _C_ombine
|
|
_p_rev _u_pper _=_: upper/lower _r_esolve
|
|
^^ _l_ower _>_: base/lower _k_ill current
|
|
^^ _a_ll _R_efine
|
|
^^ _RET_: current _E_diff
|
|
"
|
|
("n" smerge-next)
|
|
("p" smerge-prev)
|
|
("b" smerge-keep-base)
|
|
("u" smerge-keep-upper)
|
|
("l" smerge-keep-lower)
|
|
("a" smerge-keep-all)
|
|
("RET" smerge-keep-current)
|
|
("\C-m" smerge-keep-current)
|
|
("<" smerge-diff-base-upper)
|
|
("=" smerge-diff-upper-lower)
|
|
(">" smerge-diff-base-lower)
|
|
("R" smerge-refine)
|
|
("E" smerge-ediff)
|
|
("C" smerge-combine-with-next)
|
|
("r" smerge-resolve)
|
|
("k" smerge-kill-current)
|
|
("q" nil "cancel" :color blue))
|
|
)
|
|
|
|
(use-package transient
|
|
:defer t
|
|
:ensure t)
|
|
|
|
;; Mostrar el último commit que modificó la linea actual
|
|
(use-package vc-msg
|
|
:defer t
|
|
:bind (("C-c v" . vc-msg-show)
|
|
("C-c C-v" . vc-msg-show))
|
|
)
|
|
|
|
|
|
(provide 'init-vc)
|
|
;;; init-vc.el ends here
|