mirror of
https://codeberg.org/scip/dot-emacs.git
synced 2025-12-17 04:20:57 +01:00
enhanced magit navigation, added magit-todos
This commit is contained in:
@@ -1,9 +1,16 @@
|
||||
;; *** Magit
|
||||
|
||||
;; TODO: add blamer.el (https://github.com/Artawower/blamer.el), currently fails to install (2023/05/08)
|
||||
|
||||
;; Not much to say about Magit
|
||||
(use-package magit
|
||||
:ensure t
|
||||
|
||||
:init
|
||||
(use-package magit-todos)
|
||||
|
||||
:config
|
||||
(magit-todos-mode)
|
||||
|
||||
(defun tvd-magit-status ()
|
||||
"Always call `magit-status' with prefix arg."
|
||||
@@ -11,17 +18,25 @@
|
||||
(let ((current-prefix-arg t))
|
||||
(call-interactively 'magit-status)))
|
||||
|
||||
;; (with-eval-after-load 'info
|
||||
;; (info-initialize)
|
||||
;; (add-to-list 'Info-directory-list
|
||||
;; (expand-file-name (concat "~/.emacs.d/lisp/magit-"
|
||||
;; tvd-magit-revision
|
||||
;; "/Documentation/"))))
|
||||
(setq magit-view-git-manual-method 'woman)
|
||||
|
||||
(defalias 'git 'magit-status)
|
||||
(defalias 'gitlog 'magit-log-buffer-file)
|
||||
|
||||
(defun tvd-magit-cycle-down()
|
||||
"hide current section, jump down to the next and show it"
|
||||
(interactive)
|
||||
(magit-section-hide (magit-current-section))
|
||||
(magit-section-forward-sibling)
|
||||
(magit-section-show (magit-current-section)))
|
||||
|
||||
(defun tvd-magit-cycle-up()
|
||||
"hide current section, jump up to the next and show it"
|
||||
(interactive)
|
||||
(magit-section-hide (magit-current-section))
|
||||
(magit-section-backward-sibling)
|
||||
(magit-section-show (magit-current-section)))
|
||||
|
||||
;; configure magit
|
||||
(with-eval-after-load 'magit
|
||||
(dolist (dir (list (expand-file-name "~/dev/D/github")
|
||||
@@ -34,10 +49,10 @@
|
||||
;; use timestamps in log buffers
|
||||
(setq magit-log-margin '(t "%Y-%m-%d " magit-log-margin-width t 18))
|
||||
|
||||
;; navigate magit buffers as I do everywhere else, I do not automatically
|
||||
;; cycle/decycle though, the magit defaults are absolutely sufficient.
|
||||
(define-key magit-mode-map (kbd "<C-down>") 'magit-section-forward-sibling)
|
||||
(define-key magit-mode-map (kbd "<C-up>") 'magit-section-backward-sibling)
|
||||
;; navigate magit buffers as I do in org-mode, that is going down
|
||||
;; hides the current sibling, and vice versa
|
||||
(define-key magit-mode-map (kbd "<C-down>") 'tvd-magit-cycle-down)
|
||||
(define-key magit-mode-map (kbd "<C-up>") 'tvd-magit-cycle-up)
|
||||
(define-key magit-mode-map (kbd "<delete>") 'magit-delete-thing))
|
||||
|
||||
;; one thing though: on startup it bitches about git version, but it
|
||||
|
||||
@@ -185,11 +185,11 @@ _k_: kill (C-k) _s_: split _{_: wrap with { }
|
||||
;; Jump to the beginning of following balanced expression. If
|
||||
;; there is no following expression on the current level, jump
|
||||
;; one level up backward, effectively doing sp-backward-up-sexp.
|
||||
("C-S-<left>" . 'sp-next-sexp)
|
||||
("C-S-<left>" . 'sp-previous-sexp)
|
||||
;; Jump to the end of the previous balanced expression. If there
|
||||
;; is no previous expression on the current level, jupm one level
|
||||
;; up forward, effectively doing sp-up-sexp.
|
||||
("C-S-<right>" . 'sp-previous-sexp)
|
||||
("C-S-<right>" . 'sp-next-sexp)
|
||||
|
||||
;; comment the whole sexp
|
||||
(";" . 'tvd-lisp-comment)
|
||||
|
||||
2
init.el
2
init.el
@@ -164,7 +164,7 @@
|
||||
'(custom-safe-themes
|
||||
'("7f1d414afda803f3244c6fb4c2c64bea44dac040ed3731ec9d75275b9e831fe5" default))
|
||||
'(package-selected-packages
|
||||
'(howm tiny tramp dictcc beacon which-key goto-last-change browse-kill-ring fringe-current-line swiper smex undo-tree fic-mode cmake-mode yaml-mode windresize web-mode use-package tablist solarized-theme smartparens rust-mode projectile persistent-scratch org-bullets markdown-mode magit iedit ibuffer-vc ibuffer-tramp hydra htmlize highlight-indentation go-mode eyebrowse elmacro dumb-jump dired-ranger dired-k dired-filter default-text-scale change-inner buffer-move))
|
||||
'(blamer howm tiny tramp dictcc beacon which-key goto-last-change browse-kill-ring fringe-current-line swiper smex undo-tree fic-mode cmake-mode yaml-mode windresize web-mode use-package tablist solarized-theme smartparens rust-mode projectile persistent-scratch org-bullets markdown-mode magit iedit ibuffer-vc ibuffer-tramp hydra htmlize highlight-indentation go-mode eyebrowse elmacro dumb-jump dired-ranger dired-k dired-filter default-text-scale change-inner buffer-move))
|
||||
'(safe-local-variable-values '((ruby-indent-level 4)))
|
||||
'(warning-suppress-types '((comp))))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user