Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

magit: Separate mode for magit-repos #819

Merged
merged 1 commit into from
Jun 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions evil-collection.el
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ See `evil-collection-init' and `evil-collection--modes-with-delayed-setup'."
macrostep
man
(magit magit-submodule) ;; See https://github.com/emacs-evil/evil-collection/issues/637
magit-repos
magit-section
magit-todos
markdown-mode
Expand Down
49 changes: 49 additions & 0 deletions modes/magit-repos/evil-collection-magit-repos.el
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
;;; evil-collection-magit-repos.el --- Bindings for magit-repos -*- lexical-binding: t -*-

;; Copyright (C) 2015-2016, 2021 Justin Burkett

;; Author: Justin Burkett <justin@burkett.cc>
;; Maintainer: Justin Burkett <justin@burkett.cc>
;; James Nguyen <james@jojojames.com>
;; Pierre Neidhardt <mail@ambrevar.xyz>
;; Package-Requires: ((emacs "26.3") (evil "1.2.3") (magit "2.6.0"))
;; Homepage: https://github.com/emacs-evil/evil-collection
;; Version: 0.0.1

;; This file is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published
;; by the Free Software Foundation; either version 3, or (at your
;; option) any later version.
;;
;; This file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;;
;; For a full copy of the GNU General Public License
;; see <http://www.gnu.org/licenses/>.

;;; Commentary:
;;; Bindings for magit-repos.

;;; Code:
(require 'evil-collection)
(require 'magit-repos nil t)

(defvar magit-repolist-mode-map)
(defconst evil-collection-magit-repos-maps '(magit-repolist-mode-map))

;;;###autoload
(defun evil-collection-magit-repos-setup ()
"Set up `evil' bindings for `magit-repos'."
(evil-set-initial-state 'magit-repolist-mode 'normal)
(evil-collection-define-key 'normal 'magit-repolist-mode-map
"m" 'magit-repolist-mark
"u" 'magit-repolist-unmark
"f" 'magit-repolist-fetch
(kbd "RET") 'magit-repolist-status
(kbd "gr") 'magit-list-repositories)
(add-hook 'magit-repolist-mode-hook 'evil-normalize-keymaps))

(provide 'evil-collection-magit-repos)
;;; evil-collection-magit-repos.el ends here
11 changes: 0 additions & 11 deletions modes/magit/evil-collection-magit.el
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
(defvar magit-process-mode-map)
(defvar magit-reflog-mode-map)
(defvar magit-refs-mode-map)
(defvar magit-repolist-mode-map)
(defvar magit-status-mode-map)
(defvar magit-submodule-list-mode-map)

Expand All @@ -62,7 +61,6 @@
magit-blame-read-only-mode-map
magit-blob-mode-map
magit-submodule-list-mode-map ; -> parent: `magit-repolist-mode-map'
magit-repolist-mode-map
magit-mode-map))

(defcustom evil-collection-magit-use-y-for-yank t
Expand Down Expand Up @@ -476,15 +474,6 @@ denotes the original magit key for this command.")
;; Need to refresh evil keymaps when blame mode is entered.
(add-hook 'magit-blame-mode-hook 'evil-normalize-keymaps)

(evil-set-initial-state 'magit-repolist-mode 'normal)
(evil-collection-define-key 'normal 'magit-repolist-mode-map
"m" 'magit-repolist-mark
"u" 'magit-repolist-unmark
"f" 'magit-repolist-fetch
(kbd "RET") 'magit-repolist-status
(kbd "gr") 'magit-list-repositories)
(add-hook 'magit-repolist-mode-hook 'evil-normalize-keymaps)

(evil-set-initial-state 'magit-submodule-list-mode 'normal)
(evil-collection-define-key 'normal 'magit-submodule-list-mode-map
(kbd "RET") 'magit-repolist-status
Expand Down
Loading