 ;; see <http://www.gnu.org/licenses/>.
 
 ;;; Commentary:
-;; The default bindings in motion state override the standard
-;; movement keys.  This package restores them.
+;; The default bindings in motion state override the standard movement keys.
+;; This package uses normal state and redefines everything.
 
 ;;; Code:
 (require 'evil)


(defun evil-collection-info-setup ()
  "Set up `evil' bindings for `info-mode'."
  (evil-define-key 'motion Info-mode-map
    ;; motion: Restore some Evil keys that got overriden.
    "w" 'evil-forward-word-begin
    "e" 'evil-forward-word-end
    "ge" 'evil-backward-word-end
    "gE" 'evil-backward-WORD-end
    "b" 'evil-backward-word-begin
    "gg" 'evil-goto-first-line
    "t" 'evil-find-char-to
    "T" 'evil-find-char-to-backward
    "f" 'evil-find-char

    "?" evil-collection-evil-search-backward
    "/" evil-collection-evil-search-forward
    "n" evil-collection-evil-search-next
    "N" evil-collection-evil-search-previous

    (kbd "<tab>") 'Info-next-reference
    (kbd "S-<tab>") 'Info-prev-reference

    ;; TODO: Should search with "n"/"N" cover the full manual like "C-s"/"C-r" does?

    ;; goto
    "gd" 'Info-goto-node ; TODO: "gd" does not match the rationale of "go to definition". Change?
    "gt" 'Info-top-node
    "gT" 'Info-toc
    "gf" 'Info-follow-reference
    (kbd "C-o") 'Info-history-back
    (kbd "C-i") 'Info-history-forward
    ;; TODO: "[" and "]" are Emacs default for fine-grained browsing.
    ;; We usually use "C-j"/"C-k" for that.
    (kbd "C-j") 'Info-next

    "gk" 'Info-prev

    (kbd "M-w") 'Info-copy-current-node-name ; TODO: Use yn?

    ;; quit
    "q" 'Info-exit
