Add or fix documentation to appease checkdoc

This commit is contained in:
James Nguyen 2017-11-16 18:53:35 -08:00
parent 1771414cca
commit f27f413685
51 changed files with 70 additions and 8 deletions

View File

@ -31,6 +31,7 @@
(require 'evil) (require 'evil)
(defun evil-ag-setup () (defun evil-ag-setup ()
"Set up `evil' bindings for `ag'."
(evil-add-hjkl-bindings ag-mode-map 'normal (evil-add-hjkl-bindings ag-mode-map 'normal
"gg" #'evil-goto-first-line "gg" #'evil-goto-first-line
"gr" #'recompile "gr" #'recompile

View File

@ -30,6 +30,7 @@
(require 'evil) (require 'evil)
(defun evil-anaconda-mode-setup () (defun evil-anaconda-mode-setup ()
"Set up `evil' bindings for `anaconda-mode'."
;; Bindings don't seem to be set the first time. ;; Bindings don't seem to be set the first time.
(add-hook 'anaconda-mode-hook #'evil-normalize-keymaps) (add-hook 'anaconda-mode-hook #'evil-normalize-keymaps)

View File

@ -31,6 +31,7 @@
(require 'evil) (require 'evil)
(defun evil-arc-mode-setup () (defun evil-arc-mode-setup ()
"Set up `evil' bindings for `arc-mode'."
(evil-set-initial-state 'arc-mode 'motion) (evil-set-initial-state 'arc-mode 'motion)
(evil-set-initial-state 'archive-mode 'motion) (evil-set-initial-state 'archive-mode 'motion)
(evil-define-key 'motion archive-mode-map (evil-define-key 'motion archive-mode-map

View File

@ -31,6 +31,7 @@
(require 'evil-collection-util) (require 'evil-collection-util)
(defun evil-bookmark-setup () (defun evil-bookmark-setup ()
"Set up `evil' bindings for `bookmark'."
(evil-collection-util-evilify-map (evil-collection-util-evilify-map
bookmark-bmenu-mode-map bookmark-bmenu-mode-map
:mode bookmark-bmenu-mode)) :mode bookmark-bmenu-mode))

View File

@ -31,6 +31,7 @@
(require 'evil) (require 'evil)
(defun evil-calendar-setup () (defun evil-calendar-setup ()
"Set up `evil' bindings for `calendar'."
(evil-define-key 'motion calendar-mode-map (evil-define-key 'motion calendar-mode-map
;; motion ;; motion
"h" 'calendar-backward-day "h" 'calendar-backward-day

View File

@ -31,6 +31,7 @@
(require 'evil-collection-util) (require 'evil-collection-util)
(defun evil-cider-setup () (defun evil-cider-setup ()
"Set up `evil' bindings for `cider'."
(evil-define-key '(normal visual) cider-mode-map (evil-define-key '(normal visual) cider-mode-map
(kbd "gz") 'cider-switch-to-repl-buffer (kbd "gz") 'cider-switch-to-repl-buffer
(kbd "gf") 'cider-find-resource (kbd "gf") 'cider-find-resource

View File

@ -31,6 +31,7 @@
(require 'evil) (require 'evil)
(defun evil-comint-setup () (defun evil-comint-setup ()
"Set up `evil' bindings for `comint'."
(when evil-want-C-d-scroll (when evil-want-C-d-scroll
(evil-define-key 'normal comint-mode-map (evil-define-key 'normal comint-mode-map
(kbd "C-d") #'evil-scroll-down)) (kbd "C-d") #'evil-scroll-down))

View File

@ -34,6 +34,7 @@
(defvar company-search-map) (defvar company-search-map)
(defun evil-company-setup () (defun evil-company-setup ()
"Set up `evil' bindings for `company'."
(define-key company-active-map (kbd "C-n") 'company-select-next-or-abort) (define-key company-active-map (kbd "C-n") 'company-select-next-or-abort)
(define-key company-active-map (kbd "C-p") 'company-select-previous-or-abort) (define-key company-active-map (kbd "C-p") 'company-select-previous-or-abort)
(define-key company-active-map (kbd "C-j") 'company-select-next-or-abort) (define-key company-active-map (kbd "C-j") 'company-select-next-or-abort)

View File

@ -31,6 +31,7 @@
(require 'compile) (require 'compile)
(defun evil-compile-setup () (defun evil-compile-setup ()
"Set up `evil' bindings for `compile'."
(evil-collection-util-evilify-map (evil-collection-util-evilify-map
compilation-mode-map compilation-mode-map
:mode compilation-mode :mode compilation-mode

View File

@ -31,6 +31,7 @@
(require 'evil) (require 'evil)
(defun evil-cus-theme-setup () (defun evil-cus-theme-setup ()
"Set up `evil' bindings for `cus-theme'."
(evil-set-initial-state 'custom-new-theme-mode 'normal) (evil-set-initial-state 'custom-new-theme-mode 'normal)
(evil-set-initial-state 'custom-theme-choose-mode 'normal) (evil-set-initial-state 'custom-theme-choose-mode 'normal)

View File

@ -31,6 +31,7 @@
(require 'evil) (require 'evil)
(defun evil-custom-setup () (defun evil-custom-setup ()
"Set up `evil' bindings for `Custom-mode'."
(evil-set-initial-state 'Custom-mode 'normal) (evil-set-initial-state 'Custom-mode 'normal)
(evil-define-key 'normal custom-mode-map (evil-define-key 'normal custom-mode-map

View File

@ -31,6 +31,7 @@
(require 'evil) (require 'evil)
(defun evil-debbugs-mode-setup () (defun evil-debbugs-mode-setup ()
"Set up `evil' bindings for `debbugs-gnu-mode'."
(evil-set-initial-state 'debbugs-gnu-mode 'motion) (evil-set-initial-state 'debbugs-gnu-mode 'motion)
(evil-define-key 'motion debbugs-gnu-mode-map (evil-define-key 'motion debbugs-gnu-mode-map

View File

@ -32,6 +32,7 @@
(require 'debug) (require 'debug)
(defun evil-debug-setup () (defun evil-debug-setup ()
"Set up `evil' bindings for `debug'."
(evil-set-initial-state 'debugger-mode 'motion) (evil-set-initial-state 'debugger-mode 'motion)
(evil-define-key 'motion debugger-mode-map (evil-define-key 'motion debugger-mode-map

View File

@ -83,6 +83,7 @@ current file instead."
(diff-restrict-view arg))) (diff-restrict-view arg)))
(defun evil-diff-mode-setup () (defun evil-diff-mode-setup ()
"Set up `evil' bindings for `diff-mode'."
(evil-define-key 'normal diff-mode-map (evil-define-key 'normal diff-mode-map
;; motion ;; motion
(kbd "SPC") 'scroll-up-command (kbd "SPC") 'scroll-up-command

View File

@ -31,6 +31,7 @@
(require 'evil-collection-util) (require 'evil-collection-util)
(defun evil-dired-setup () (defun evil-dired-setup ()
"Set up `evil' bindings for `dired'."
(evil-define-key 'normal dired-mode-map (evil-define-key 'normal dired-mode-map
"j" 'evil-next-line "j" 'evil-next-line
"k" 'evil-previous-line "k" 'evil-previous-line

View File

@ -31,6 +31,7 @@
(require 'doc-view) (require 'doc-view)
(defun evil-doc-view-setup () (defun evil-doc-view-setup ()
"Set up `evil' bindings for `doc-view'."
(evil-set-initial-state 'doc-view-mode 'motion) (evil-set-initial-state 'doc-view-mode 'motion)
(evil-define-key 'motion doc-view-mode-map (evil-define-key 'motion doc-view-mode-map
(kbd "C-j") 'doc-view-next-page (kbd "C-j") 'doc-view-next-page

View File

@ -33,7 +33,7 @@
(evil-collection-util-set-initial-state edebug-mode motion) (evil-collection-util-set-initial-state edebug-mode motion)
(defun evil-edebug-setup () (defun evil-edebug-setup ()
"Set up `evil' bindings for `edebug'."
(evil-define-key 'motion 'edebug-mode-map (evil-define-key 'motion 'edebug-mode-map
;; control ;; control
" " nil " " nil

View File

@ -31,6 +31,7 @@
(require 'evil) (require 'evil)
(defun evil-elfeed-setup () (defun evil-elfeed-setup ()
"Set up `evil' bindings for `elfeed'."
(evil-set-initial-state 'elfeed-search-mode 'motion) (evil-set-initial-state 'elfeed-search-mode 'motion)
(evil-define-key 'motion elfeed-search-mode-map (evil-define-key 'motion elfeed-search-mode-map

View File

@ -50,6 +50,7 @@ alternative printed representations that can be displayed."
rear-nonsticky (mouse-face keymap help-echo rear-nonsticky (mouse-face keymap help-echo
printed-value))))) printed-value)))))
(defun evil-elisp-mode-setup () (defun evil-elisp-mode-setup ()
"Set up `evil' bindings for `elisp-mode'."
(advice-add 'last-sexp-setup-props (advice-add 'last-sexp-setup-props
:override #'evil-elisp-mode-last-sexp-setup-props)) :override #'evil-elisp-mode-last-sexp-setup-props))

View File

@ -32,6 +32,7 @@
(require 'elisp-refs nil t) (require 'elisp-refs nil t)
(defun evil-elisp-refs-setup () (defun evil-elisp-refs-setup ()
"Set up `evil' bindings for `elisp-refs'."
(evil-define-key 'normal elisp-refs-mode-map (evil-define-key 'normal elisp-refs-mode-map
(kbd "<tab>") #'elisp-refs-next-match (kbd "<tab>") #'elisp-refs-next-match
(kbd "<backtab>") #'elisp-refs-prev-match (kbd "<backtab>") #'elisp-refs-prev-match

View File

@ -45,6 +45,7 @@
;;; emms-browser does not run any mode hook. As such the default state is 'normal. ;;; emms-browser does not run any mode hook. As such the default state is 'normal.
;;; TODO: Report upstream. ;;; TODO: Report upstream.
(defun evil-emms-browser () (defun evil-emms-browser ()
"Default `emms-browser' to motion state."
(evil-motion-state)) (evil-motion-state))
(with-no-warnings (with-no-warnings
@ -79,6 +80,7 @@
(evil-emms-playlist-mode-paste-before))) (evil-emms-playlist-mode-paste-before)))
(defun evil-emms-setup () (defun evil-emms-setup ()
"Set up `evil' bindings for `emms'."
(advice-add 'emms-browser :after 'evil-emms-browser) (advice-add 'emms-browser :after 'evil-emms-browser)
(evil-set-initial-state 'emms-playlist-mode 'motion) (evil-set-initial-state 'emms-playlist-mode 'motion)

View File

@ -32,16 +32,19 @@
(require 'evil) (require 'evil)
(defun evil-eshell-next-prompt () (defun evil-eshell-next-prompt ()
"`evil' wrapper around `eshell-next-prompt'."
(when (get-text-property (point) 'read-only) (when (get-text-property (point) 'read-only)
;; If at end of prompt, `eshell-next-prompt' will not move, so go backward. ;; If at end of prompt, `eshell-next-prompt' will not move, so go backward.
(beginning-of-line) (beginning-of-line)
(eshell-next-prompt 1))) (eshell-next-prompt 1)))
(defun evil-eshell-next-prompt-on-insert () (defun evil-eshell-next-prompt-on-insert ()
"Go to next prompt on `evil' replace/insert enter."
(dolist (hook '(evil-replace-state-entry-hook evil-insert-state-entry-hook)) (dolist (hook '(evil-replace-state-entry-hook evil-insert-state-entry-hook))
(add-hook hook 'evil-eshell-next-prompt nil t))) (add-hook hook 'evil-eshell-next-prompt nil t)))
(defun evil-eshell-interrupt-process () (defun evil-eshell-interrupt-process ()
"Interupt `eshell' process and enter insert state."
(interactive) (interactive)
(eshell-interrupt-process) (eshell-interrupt-process)
(evil-insert 1)) (evil-insert 1))
@ -49,6 +52,7 @@
;;; `eshell-mode-map' is reset when Eshell is initialized in `eshell-mode'. We ;;; `eshell-mode-map' is reset when Eshell is initialized in `eshell-mode'. We
;;; need to add bindings to `eshell-first-time-mode-hook'. ;;; need to add bindings to `eshell-first-time-mode-hook'.
(defun evil-eshell-setup-keys () (defun evil-eshell-setup-keys ()
"Set up `evil' bindings for `eshell'."
(evil-define-key 'normal eshell-mode-map (evil-define-key 'normal eshell-mode-map
;; motion ;; motion
"[" 'eshell-previous-prompt "[" 'eshell-previous-prompt
@ -78,6 +82,7 @@
;; TODO: Compare this setup procedure with evil-ediff. ;; TODO: Compare this setup procedure with evil-ediff.
(defun evil-eshell-setup () (defun evil-eshell-setup ()
"Set up `evil' bindings for `eshell'."
(add-hook 'eshell-mode-hook 'evil-eshell-next-prompt-on-insert) (add-hook 'eshell-mode-hook 'evil-eshell-next-prompt-on-insert)
(add-hook 'eshell-first-time-mode-hook 'evil-eshell-setup-keys)) (add-hook 'eshell-first-time-mode-hook 'evil-eshell-setup-keys))

View File

@ -133,7 +133,7 @@ Needed to bypass keymaps set as text properties."
(evil-evilified-state--clear-normal-state-keymap))) (evil-evilified-state--clear-normal-state-keymap)))
(defun evil-evilified-state--visual-state-on-exit () (defun evil-evilified-state--visual-state-on-exit ()
"Clean visual state" "Clean visual state."
(evil-evilified-state--restore-normal-state-keymap)) (evil-evilified-state--restore-normal-state-keymap))
(add-hook 'evil-evilified-state-entry-hook (add-hook 'evil-evilified-state-entry-hook
@ -186,7 +186,7 @@ BODY is a list of additional key bindings to apply for the given MAP in
Avaiblabe PROPS: Avaiblabe PROPS:
`:mode SYMBOL' `:mode SYMBOL'
A mode SYMBOL associated with MAP. Used to add SYMBOL to the list of modes A mode SYMBOL associated with MAP. Used to add SYMBOL to the list of modes
defaulting to `evilified-state'. defaulting to `evilified-state'.
`:evilified-map SYMBOL' `:evilified-map SYMBOL'
@ -195,7 +195,7 @@ A map SYMBOL of an alternate evilified map, if nil then
`:eval-after-load SYMBOL' `:eval-after-load SYMBOL'
If specified the evilification of MAP is deferred to the loading of the feature If specified the evilification of MAP is deferred to the loading of the feature
bound to SYMBOL. May be required for some lazy-loaded maps. bound to SYMBOL. May be required for some lazy-loaded maps.
`:pre-bindings EXPRESSIONS' `:pre-bindings EXPRESSIONS'
One or several EXPRESSIONS with the form `KEY FUNCTION': One or several EXPRESSIONS with the form `KEY FUNCTION':
@ -207,7 +207,7 @@ These bindings are set in MAP before the evilification happens.
One or several EXPRESSIONS with the form `KEY FUNCTION': One or several EXPRESSIONS with the form `KEY FUNCTION':
KEY1 FUNCTION1 KEY1 FUNCTION1
KEY2 FUNCTION2 KEY2 FUNCTION2
These bindings are set directly in evil-evilified-state-map submap. These bindings are set directly in evil-evilified-state-map submap.
... ...
Each pair KEYn FUNCTIONn is defined in MAP after the evilification of it." Each pair KEYn FUNCTIONn is defined in MAP after the evilification of it."
(declare (indent 1)) (declare (indent 1))
@ -251,12 +251,14 @@ Each pair KEYn FUNCTIONn is defined in MAP after the evilification of it."
(eval `(define-key ,map key ,func))))) (eval `(define-key ,map key ,func)))))
(defun evil-evilified-state--configure-default-state (mode) (defun evil-evilified-state--configure-default-state (mode)
"Configure default state for the passed mode." "Configure default state for the passed MODE."
(evil-set-initial-state mode 'evilified)) (evil-set-initial-state mode 'evilified))
(defun evil-evilified-state--evilify-event (map map-symbol evil-map event evil-value (defun evil-evilified-state--evilify-event (map map-symbol evil-map event evil-value
&optional processed pending-funcs) &optional processed pending-funcs)
"Evilify EVENT in MAP and return a list of PROCESSED events." "Evilify EVENT in MAP and return a list of PROCESSED events.
Argument MAP-SYMBOL Symbol of MAP.
Argument EVIL-MAP `evil' map."
(if (and event (or evil-value pending-funcs)) (if (and event (or evil-value pending-funcs))
(let* ((kbd-event (kbd (single-key-description event))) (let* ((kbd-event (kbd (single-key-description event)))
(map-value (lookup-key map kbd-event)) (map-value (lookup-key map kbd-event))
@ -297,7 +299,7 @@ Each pair KEYn FUNCTIONn is defined in MAP after the evilification of it."
((and (numberp event) (<= 1 event) (<= event 26)) (+ (expt 2 25) event))))) ((and (numberp event) (<= 1 event) (<= event 26)) (+ (expt 2 25) event)))))
(defun evil-evilified-state--sort-keymap (map) (defun evil-evilified-state--sort-keymap (map)
"Sort MAP following the order: `s' > `S' > `C-s' > `C-S-s'" "Sort MAP following the order: `s' > `S' > `C-s' > `C-S-s'."
(let (list) (let (list)
(map-keymap (lambda (a b) (push (cons a b) list)) map) (map-keymap (lambda (a b) (push (cons a b) list)) map)
(sort list (sort list

View File

@ -33,6 +33,7 @@
(defvar flycheck-error-list-mode-map) (defvar flycheck-error-list-mode-map)
(defun evil-flycheck-setup () (defun evil-flycheck-setup ()
"Set up `evil' bindings for `flycheck'."
(evil-collection-util-evilify-map (evil-collection-util-evilify-map
flycheck-error-list-mode-map flycheck-error-list-mode-map
:mode flycheck-error-list-mode :mode flycheck-error-list-mode

View File

@ -36,6 +36,7 @@
(defvar ggtags-navigation-map) (defvar ggtags-navigation-map)
(defun evil-ggtags-setup () (defun evil-ggtags-setup ()
"Set up `evil' bindings for `ggtags'."
(evil-collection-util-evilify-map (evil-collection-util-evilify-map
ggtags-global-mode-map ggtags-global-mode-map
:mode ggtags-global-mode) :mode ggtags-global-mode)

View File

@ -43,6 +43,7 @@
(defvar helm-read-file-map) (defvar helm-read-file-map)
(defun evil-helm-setup () (defun evil-helm-setup ()
"Set up `evil' bindings for `helm'."
;; TODO: We should not modify helm-map in Emacs state but somehow it does not ;; TODO: We should not modify helm-map in Emacs state but somehow it does not
;; work otherwise. ;; work otherwise.
(define-key helm-map (kbd "M-[") 'helm-previous-source) (define-key helm-map (kbd "M-[") 'helm-previous-source)

View File

@ -31,6 +31,7 @@
(require 'help-mode) (require 'help-mode)
(defun evil-help-setup () (defun evil-help-setup ()
"Set up `evil' bindings for `help'."
(evil-define-key 'motion help-mode-map (evil-define-key 'motion help-mode-map
;; motion ;; motion
(kbd "SPC") 'scroll-up-command (kbd "SPC") 'scroll-up-command

View File

@ -31,6 +31,7 @@
(require 'ibuffer) (require 'ibuffer)
(defun evil-ibuffer-setup () (defun evil-ibuffer-setup ()
"Set up `evil' bindings for `ibuffer'."
(evil-collection-util-evilify-map (evil-collection-util-evilify-map
ibuffer-mode-map ibuffer-mode-map
:mode ibuffer-mode :mode ibuffer-mode

View File

@ -31,6 +31,7 @@
(require 'image+ nil t) (require 'image+ nil t)
(defun evil-image+-setup () (defun evil-image+-setup ()
"Set up `evil' bindings for `image+'."
(evil-define-key 'motion image-mode-map (evil-define-key 'motion image-mode-map
"+" 'imagex-sticky-zoom-in "+" 'imagex-sticky-zoom-in
"-" 'imagex-sticky-zoom-out "-" 'imagex-sticky-zoom-out

View File

@ -31,6 +31,7 @@
(require 'image-mode) (require 'image-mode)
(defun evil-image-setup () (defun evil-image-setup ()
"Set up `evil' bindings for `image-mode'."
(evil-set-initial-state 'image-mode 'motion) (evil-set-initial-state 'image-mode 'motion)
(evil-define-key 'motion image-mode-map (evil-define-key 'motion image-mode-map

View File

@ -32,6 +32,7 @@
(require 'info) (require 'info)
(defun evil-info-setup () (defun evil-info-setup ()
"Set up `evil' bindings for `info-mode'."
(evil-define-key 'motion Info-mode-map (evil-define-key 'motion Info-mode-map
;; motion: Restore some Evil keys that got overriden. ;; motion: Restore some Evil keys that got overriden.
"w" 'evil-forward-word-begin "w" 'evil-forward-word-begin

View File

@ -31,6 +31,7 @@
(require 'ivy nil t) (require 'ivy nil t)
(defun evil-ivy-setup () (defun evil-ivy-setup ()
"Set up `evil' bindings for `ivy-mode'."
(evil-define-key 'normal ivy-occur-mode-map (evil-define-key 'normal ivy-occur-mode-map
[mouse-1] 'ivy-occur-click [mouse-1] 'ivy-occur-click
(kbd "RET") 'ivy-occur-press-and-switch (kbd "RET") 'ivy-occur-press-and-switch

View File

@ -31,6 +31,7 @@
(require 'macrostep nil t) (require 'macrostep nil t)
(defun evil-macrostep-setup () (defun evil-macrostep-setup ()
"Set up `evil' bindings for `macrostep'."
;; Keymaps don't seem to be populated on first try. ;; Keymaps don't seem to be populated on first try.
;; Force `evil' to normalize keymaps. ;; Force `evil' to normalize keymaps.
(add-hook 'macrostep-mode-hook #'evil-normalize-keymaps) (add-hook 'macrostep-mode-hook #'evil-normalize-keymaps)

View File

@ -31,6 +31,7 @@
(require 'man) (require 'man)
(defun evil-man-setup () (defun evil-man-setup ()
"Set up `evil' bindings for `man'."
(evil-define-key 'motion Man-mode-map (evil-define-key 'motion Man-mode-map
;; motion ;; motion
(kbd "SPC") 'scroll-up-command (kbd "SPC") 'scroll-up-command

View File

@ -46,6 +46,7 @@ it does not have a mode."
(evil-insert 1)) (evil-insert 1))
(defun evil-minibuffer-init () (defun evil-minibuffer-init ()
"Initialize minibuffer for `evil'."
;; https://www.gnu.org/software/emacs/manual/html_node/elisp/Text-from-Minibuffer.html ;; https://www.gnu.org/software/emacs/manual/html_node/elisp/Text-from-Minibuffer.html
;; WARNING: With lexical binding, lambdas from `mapc' and `dolist' become ;; WARNING: With lexical binding, lambdas from `mapc' and `dolist' become
;; closures in which we must use `evil-define-key*' instead of ;; closures in which we must use `evil-define-key*' instead of

View File

@ -33,6 +33,7 @@
(require 'replace)) (require 'replace))
(defun evil-occur-setup () (defun evil-occur-setup ()
"Set up `evil' bindings for `occur'."
(evil-set-initial-state 'occur-mode 'normal) (evil-set-initial-state 'occur-mode 'normal)
(evil-define-key 'normal occur-mode-map (evil-define-key 'normal occur-mode-map

View File

@ -31,6 +31,7 @@
(require 'outline) (require 'outline)
(defun evil-outline-setup () (defun evil-outline-setup ()
"Set up `evil' bindings for `outline'."
(evil-define-key 'normal outline-mode-map (evil-define-key 'normal outline-mode-map
;; folding ;; folding
;; Evil default keys: ;; Evil default keys:

View File

@ -33,6 +33,7 @@
(defvar p4-basic-mode-map) (defvar p4-basic-mode-map)
(defun evil-p4-setup () (defun evil-p4-setup ()
"Set up `evil' bindings for `p4'."
(evil-collection-util-evilify-map (evil-collection-util-evilify-map
p4-basic-mode-map p4-basic-mode-map
:mode p4-basic-mode :mode p4-basic-mode

View File

@ -31,6 +31,7 @@
(require 'package) (require 'package)
(defun evil-package-menu-setup () (defun evil-package-menu-setup ()
"Set up `evil' bindings for `package-menu'."
(evil-set-initial-state 'package-menu-mode 'motion) (evil-set-initial-state 'package-menu-mode 'motion)
(evil-define-key 'motion package-menu-mode-map (evil-define-key 'motion package-menu-mode-map

View File

@ -33,6 +33,7 @@
(defvar pass-mode-map) (defvar pass-mode-map)
(defun evil-pass-setup () (defun evil-pass-setup ()
"Set up `evil' bindings for `pass-mode'."
(evil-collection-util-evilify-map (evil-collection-util-evilify-map
pass-mode-map pass-mode-map
:mode pass-mode :mode pass-mode

View File

@ -38,18 +38,21 @@
(with-no-warnings (with-no-warnings
(defun evil-pdf-view-goto-page (&optional page) (defun evil-pdf-view-goto-page (&optional page)
"`evil' wrapper around `pdf-view-last-page'."
(interactive "P") (interactive "P")
(if page (if page
(pdf-view-goto-page page) (pdf-view-goto-page page)
(pdf-view-last-page))) (pdf-view-last-page)))
(defun evil-pdf-view-goto-first-page (&optional page) (defun evil-pdf-view-goto-first-page (&optional page)
"`evil' wrapper around `pdf-view-first-page'."
(interactive "P") (interactive "P")
(if page (if page
(pdf-view-goto-page page) (pdf-view-goto-page page)
(pdf-view-first-page)))) (pdf-view-first-page))))
(defun evil-pdf-setup () (defun evil-pdf-setup ()
"Set up `evil' bindings for `pdf-view'."
(evil-set-initial-state 'pdf-view-mode 'motion) (evil-set-initial-state 'pdf-view-mode 'motion)
(evil-define-key 'motion pdf-view-mode-map (evil-define-key 'motion pdf-view-mode-map
;; motion ;; motion

View File

@ -31,6 +31,7 @@
(require 'prodigy nil t) (require 'prodigy nil t)
(defun evil-prodigy-setup () (defun evil-prodigy-setup ()
"Set up `evil' bindings for `prodigy'."
(evil-define-key 'normal prodigy-mode-map (evil-define-key 'normal prodigy-mode-map
"q" 'quit-window "q" 'quit-window
"j" 'prodigy-next "j" 'prodigy-next

View File

@ -31,6 +31,7 @@
(require 'profiler) (require 'profiler)
(defun evil-profiler-setup () (defun evil-profiler-setup ()
"Set up `evil' bindings for `profiler'."
(evil-set-initial-state 'profiler-report-mode 'motion) (evil-set-initial-state 'profiler-report-mode 'motion)
(evil-define-key 'motion profiler-report-mode-map (evil-define-key 'motion profiler-report-mode-map

View File

@ -34,6 +34,7 @@
(defvar slime-inspector-mode-map) (defvar slime-inspector-mode-map)
(defun evil-slime-setup () (defun evil-slime-setup ()
"Set up `evil' bindings for `slime'."
(evil-collection-util-evilify-map (evil-collection-util-evilify-map
sldb-mode-map sldb-mode-map
:mode sldb-mode :mode sldb-mode

View File

@ -46,11 +46,13 @@ it is not appropriate in some cases like terminals."
(setq-local evil-move-cursor-back nil)) (setq-local evil-move-cursor-back nil))
(defun evil-term-char-mode-insert () (defun evil-term-char-mode-insert ()
"Switch to `term-char-mode' and enter insert state."
(interactive) (interactive)
(term-char-mode) (term-char-mode)
(evil-insert-state)) (evil-insert-state))
(defun evil-term-char-mode-entry-function () (defun evil-term-char-mode-entry-function ()
"Maybe switch to `term-char-mode' on insert state."
(when (get-buffer-process (current-buffer)) (when (get-buffer-process (current-buffer))
(let (last-prompt) (let (last-prompt)
(save-excursion (save-excursion
@ -62,6 +64,7 @@ it is not appropriate in some cases like terminals."
(term-char-mode))))) (term-char-mode)))))
(defun evil-term-sync-state-and-mode () (defun evil-term-sync-state-and-mode ()
"Sync `term-char-mode' and `term-line-mode' with insert and normal state."
(add-hook 'evil-insert-state-entry-hook 'evil-term-char-mode-entry-function) (add-hook 'evil-insert-state-entry-hook 'evil-term-char-mode-entry-function)
(add-hook 'evil-insert-state-exit-hook 'term-line-mode)) (add-hook 'evil-insert-state-exit-hook 'term-line-mode))
@ -71,6 +74,7 @@ it is not appropriate in some cases like terminals."
(term-send-raw-string "\t")) (term-send-raw-string "\t"))
(defun evil-term-setup () (defun evil-term-setup ()
"Set up `evil' bindings for `term'."
(evil-set-initial-state 'term-mode 'insert) (evil-set-initial-state 'term-mode 'insert)
(add-hook 'term-mode-hook 'evil-term-sync-state-and-mode) (add-hook 'term-mode-hook 'evil-term-sync-state-and-mode)
(add-hook 'term-mode-hook 'evil-term-escape-stay) (add-hook 'term-mode-hook 'evil-term-escape-stay)

View File

@ -31,6 +31,7 @@
(require 'evil) (require 'evil)
(defun evil-tide-setup () (defun evil-tide-setup ()
"Set up `evil' bindings for `tide'."
(evil-define-key 'normal tide-mode-map (evil-define-key 'normal tide-mode-map
(kbd "gd") #'tide-jump-to-definition (kbd "gd") #'tide-jump-to-definition
(kbd "C-t") #'tide-jump-back (kbd "C-t") #'tide-jump-back

View File

@ -23,6 +23,7 @@
;; For a full copy of the GNU General Public License ;; For a full copy of the GNU General Public License
;; see <http://www.gnu.org/licenses/>. ;; see <http://www.gnu.org/licenses/>.
;;; Commentary: ;;; Commentary:
;; Evil bindings for `transmission'. ;; Evil bindings for `transmission'.
@ -31,6 +32,7 @@
(require 'transmission nil t) (require 'transmission nil t)
(defun evil-transmission-setup () (defun evil-transmission-setup ()
"Set up `evil' bindings for `transmission'."
(evil-set-initial-state 'transmission-mode 'motion) (evil-set-initial-state 'transmission-mode 'motion)
(evil-define-key 'motion transmission-mode-map (evil-define-key 'motion transmission-mode-map
;; motion ;; motion

View File

@ -34,6 +34,7 @@
;;; Code: ;;; Code:
(defun evil-vlf-setup () (defun evil-vlf-setup ()
"Set up `evil' bindings for `vlf'."
(evil-collection-util-evilify-map (evil-collection-util-evilify-map
vlf-mode-map vlf-mode-map
:mode vlf-mode :mode vlf-mode

View File

@ -32,6 +32,7 @@
(require 'woman) (require 'woman)
(defun evil-woman-setup () (defun evil-woman-setup ()
"Set up `evil' bindings for `woman'."
(evil-define-key 'motion woman-mode-map (evil-define-key 'motion woman-mode-map
(kbd "]") 'WoMan-next-manpage (kbd "]") 'WoMan-next-manpage
(kbd "[") 'WoMan-previous-manpage (kbd "[") 'WoMan-previous-manpage

View File

@ -31,6 +31,7 @@
(require 'xref) (require 'xref)
(defun evil-xref-setup () (defun evil-xref-setup ()
"Set up `evil' bindings for `xref'."
(evil-define-key 'normal xref--xref-buffer-mode-map (evil-define-key 'normal xref--xref-buffer-mode-map
"j" #'xref-next-line "j" #'xref-next-line
"k" #'xref-prev-line "k" #'xref-prev-line

View File

@ -30,6 +30,7 @@
(require 'ztree nil t) (require 'ztree nil t)
(defun evil-ztree-setup () (defun evil-ztree-setup ()
"Set up `evil' bindings for `ztree'."
(evil-set-initial-state 'ztree-mode 'motion) (evil-set-initial-state 'ztree-mode 'motion)
(evil-define-key 'motion ztree-mode-map (evil-define-key 'motion ztree-mode-map