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.
master
Benno Schulenberg 2019-04-05 09:28:09 +02:00
parent 82f1ce8ebf
commit d79b9823ae
2 changed files with 8 additions and 6 deletions

View File

@ -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

View File

@ -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);