feat(functions): Add ivy-browse-repositories function

Quick helper to switch between all relevant projects.
This commit is contained in:
Vincent Ambo 2018-06-18 16:39:28 +02:00
parent e743ea28c5
commit f0dfc8b06d
4 changed files with 16 additions and 2 deletions

View file

@ -35,6 +35,7 @@
;; Magit! ;; Magit!
(global-set-key (kbd "C-c g") 'magit-status) (global-set-key (kbd "C-c g") 'magit-status)
(global-set-key (kbd "C-x p") 'ivy-browse-repositories)
;; Replace standard goto-line with ace-jump-line-mode ;; Replace standard goto-line with ace-jump-line-mode
(global-set-key (kbd "M-g g") 'avy-goto-line) (global-set-key (kbd "M-g g") 'avy-goto-line)

View file

@ -195,6 +195,16 @@ Including indent-buffer, which should not be called automatically on save."
(run-at-time (password-store-timeout) (run-at-time (password-store-timeout)
nil 'password-store-clear)))))) nil 'password-store-clear))))))
(defun ivy-browse-repositories ()
"Select a git repository and open its associated magit buffer."
(interactive)
(ivy-read "Repository: "
(magit-list-repos)
:require-match t
:sort t
:action #'magit-status))
(defun warmup-gpg-agent (arg &optional exit) (defun warmup-gpg-agent (arg &optional exit)
"Function used to warm up the GPG agent before use. This is "Function used to warm up the GPG agent before use. This is
useful in cases where there is no easy way to make pinentry run useful in cases where there is no easy way to make pinentry run

View file

@ -32,6 +32,9 @@
(setq mail-host-address (system-name)) (setq mail-host-address (system-name))
(setq notmuch-mua-cite-function #'message-cite-original-without-signature) (setq notmuch-mua-cite-function #'message-cite-original-without-signature)
;; Close mail buffers after sending mail
(setq message-kill-buffer-on-exit t)
;; Ensure sender is correctly passed to msmtp ;; Ensure sender is correctly passed to msmtp
(setq mail-specify-envelope-from t (setq mail-specify-envelope-from t
message-sendmail-envelope-from 'header message-sendmail-envelope-from 'header

View file

@ -76,7 +76,7 @@
(require 'auth-source-pass) (require 'auth-source-pass)
(auth-source-pass-enable) (auth-source-pass-enable)
;; Close mail buffers after sending mail ;; Configure magit-repository-list
(setq message-kill-buffer-on-exit t) (setq magit-repository-directories '(("/home/vincent/projects" . 2)))
(provide 'settings) (provide 'settings)