From 67c27119d954589092bf050ed04fbad933571841 Mon Sep 17 00:00:00 2001 From: crocket <748856+crocket@users.noreply.github.com> Date: Thu, 23 Jan 2020 17:06:43 +0900 Subject: [PATCH] Start ensuring terminal compatibility for Enter and Tab * readme.org now has a new guideline for terminal compatibility. * dired, help, and info modes are modified for terminal compatibility. --- modes/dired/evil-collection-dired.el | 2 +- modes/help/evil-collection-help.el | 3 +++ modes/info/evil-collection-info.el | 3 +++ readme.org | 34 ++++++++++++++++++++-------- 4 files changed, 32 insertions(+), 10 deletions(-) diff --git a/modes/dired/evil-collection-dired.el b/modes/dired/evil-collection-dired.el index 6ade67e..e54dc5a 100644 --- a/modes/dired/evil-collection-dired.el +++ b/modes/dired/evil-collection-dired.el @@ -134,7 +134,7 @@ ;; open (kbd "RET") 'dired-find-file (kbd "S-") 'dired-find-file-other-window - (kbd "M-") 'dired-display-file + (kbd "M-RET") 'dired-display-file "gO" 'dired-find-file-other-window "go" 'dired-view-file ;; sort diff --git a/modes/help/evil-collection-help.el b/modes/help/evil-collection-help.el index b69b03d..b852af8 100644 --- a/modes/help/evil-collection-help.el +++ b/modes/help/evil-collection-help.el @@ -45,6 +45,9 @@ (kbd "C-b") 'scroll-down-command (kbd "") 'forward-button (kbd "") 'backward-button + ;; This exists because is recognized as C-i on terminals. + "g]" 'forward-button + "g[" 'backward-button (kbd "C-o") 'help-go-back (kbd "C-i") 'help-go-forward diff --git a/modes/info/evil-collection-info.el b/modes/info/evil-collection-info.el index 12e8187..23184f0 100644 --- a/modes/info/evil-collection-info.el +++ b/modes/info/evil-collection-info.el @@ -44,6 +44,9 @@ "h" 'evil-backward-char (kbd "") 'Info-next-reference (kbd "S-") 'Info-prev-reference + ;; This exists because is recognized as C-i on terminals. + "g]" 'Info-next-reference + "g[" 'Info-prev-reference ;; From evil-integration.el. "0" 'evil-digit-argument-or-evil-beginning-of-line diff --git a/readme.org b/readme.org index 62db352..6667208 100644 --- a/readme.org +++ b/readme.org @@ -121,9 +121,9 @@ more. The rules are more-or-less sorted by priority. - 0. Don't bind anything to ~:~ nor ~~. + 1. Don't bind anything to ~:~ nor ~~. - 1. Keep the movement keys when possible and sensible. + 2. Keep the movement keys when possible and sensible. - ~h~, ~j~, ~k~, ~l~ - ~w~, ~W~, ~b~, ~B~, ~e~, ~E~, ~ge~, ~gE~ @@ -136,22 +136,22 @@ more. - ~+~, ~-~, ~0~, ~^~, ~$~ - ~C-i~, ~C-o~ - 2. Keep the yanking and register keys when possible and sensible. + 3. Keep the yanking and register keys when possible and sensible. - ~y~, ~Y~ - ="= - 3. Keep the search keys when possible and sensible. + 4. Keep the search keys when possible and sensible. - ~/~, ~?~ - ~#~, ~*~ - 4. Keep the mark keys when possible and sensible. + 5. Keep the mark keys when possible and sensible. - ~m~ - ='=, =~= - 5. Keep the windowing keys when possible and sensible. + 6. Keep the windowing keys when possible and sensible. - ~H~, ~L~, ~M~ - ~C-e~, ~C-y~ @@ -160,7 +160,7 @@ more. - ~C-w~-prefixed bindings. - Some ~z~-prefixed bindings (see below). - 6. The following keys are free when insert state does not make sense in the + 7. The following keys are free when insert state does not make sense in the current mode: - ~a~, ~A~, ~i~, ~I~ @@ -174,16 +174,32 @@ more. Any of those keys can be set to be a prefix key. - 7. Prefix keys: ~g~ and ~z~ are the ubiquitous prefix keys. + 8. Prefix keys: ~g~ and ~z~ are the ubiquitous prefix keys. - ~g~ generally stands for "go" and is best used for movements. - ~z~ is used for scrolling, folding, spell-checking and more. - 8. Macro and action keys + 9. Macro and action keys - ~@~, ~q~ - ~.~ + 10. Ensure terminal compatibility without sacrificing GUI key bindings. + + - Tab key + - Tab key is recognized as ~~ in GUI and ~TAB~ in terminal. + ~TAB~ equals ~C-i~. + - Since ~C-i~ is bound to jumping forward for vim compatibility, + bind ~g[~ and ~g]~ to the functions that Shift+Tab and Tab + are bound to on GUI for terminal compatibility. + - Enter key + - Enter key is recognized as ~~ in GUI and ~RET~ in terminal. + ~RET~ equals ~Ctrl+m~. + - Bind only ~RET~ and ~M-RET~. Or, bind ~RET~ and ~M-RET~ to the same + functions ~~ and ~~ are bound to. + - ~S-RET~ is impossible on terminal. Bind ~~ and a vacant key + to the same function for terminal compatibility. + ** Rationale Many special modes share the same set of similar actions. Those actions should