commit d79b9823aea9ce80ec38a6482306351fad227a99
parent 82f1ce8ebff2a4d4af475d961c69bb4644d5336f
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Fri, 5 Apr 2019 09:28:09 +0200
bindings: add easier keystrokes for the linenumber and softwrap toggles
For most people, M-N and M-S are simpler to type than M-# and M-$,
and more mnemonic.
Diffstat:
2 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/doc/nano.texi b/doc/nano.texi
@@ -640,12 +640,18 @@ The following global toggles are available:
@item Mouse Support
@kbd{Meta-M} toggles the @option{-m} (@option{--mouse}) command-line option.
+@item Line Numbers
+@kbd{Meta-N} toggles the @option{-l} (@option{--linenumbers}) command-line option.
+
@item Tabs To Spaces
@kbd{Meta-O} toggles the @option{-E} (@option{--tabstospaces}) command-line option.
@item Whitespace Display
@kbd{Meta-P} toggles the displaying of whitespace (@pxref{Whitespace}).
+@item Soft Wrapping
+@kbd{Meta-S} toggles the @option{-$} (@option{--softwrap}) command-line option.
+
@item Expert/No Help
@kbd{Meta-X} toggles the @option{-x} (@option{--nohelp}) command-line option.
@@ -656,12 +662,6 @@ The following global toggles are available:
@item Suspension
@kbd{Meta-Z} toggles the @option{-z} (@option{--suspend}) command-line option.
-@item Line Numbers
-@kbd{Meta-#} toggles the @option{-l} (@option{--linenumbers}) command-line option.
-
-@item Soft Wrapping
-@kbd{Meta-$} toggles the @option{-$} (@option{--softwrap}) command-line option.
-
@end table
diff --git a/src/global.c b/src/global.c
@@ -1256,8 +1256,10 @@ void shortcut_init(void)
/* Group of "Appearance" toggles. */
add_to_sclist(MMAIN, "M-X", 0, do_toggle_void, NO_HELP);
add_to_sclist(MMAIN, "M-C", 0, do_toggle_void, CONSTANT_SHOW);
+ add_to_sclist(MMAIN, "M-S", 0, do_toggle_void, SOFTWRAP);
add_to_sclist(MMAIN, "M-$", 0, do_toggle_void, SOFTWRAP);
#ifdef ENABLE_LINENUMBERS
+ add_to_sclist(MMAIN, "M-N", 0, do_toggle_void, LINE_NUMBERS);
add_to_sclist(MMAIN, "M-#", 0, do_toggle_void, LINE_NUMBERS);
#endif
add_to_sclist(MMAIN, "M-P", 0, do_toggle_void, WHITESPACE_DISPLAY);