To indent a whole block of code in nano, after selecting it with alt+a, I have to press alt+{, which doesn't work on my german layout macintosh keyboard (and would be pretty annoying even if it did).
How do I change and customize nano's keyboard shortcuts?
The file
/etc/nanorc
contains some options that should allow you to customize the shortcuts used on the editor. Please note that this is a global config file and will modify the options for all users on your system.Further details on the available options are given on the
man nanorc
page (the list is just too big to reproduce here):It should be possible to keep the options localized only to your user by copying the system configuration file in to your user's home directory with
and doing the modifications necessary there.
The configuration file on your home directory will prevail over the global settings one.
The following has been tested using nano from a terminal in MS-Windows.
It will get your nano one step closer supporting the "universal" shortcuts for copy/cut/paste etc. (at least in the Windows world).
Add these lines to the file
/etc/nanorc
Be aware they work per whole-line if you don't select text first :-/
If you have issues selecting text in nano with
shift+arrow-keys
then be aware this doesn't seem to be related to nano but your terminal program! It doesn't work in PuTTY, but it does e.g. work in Kitty (a fork of PuTTY, Windows-version / Linux-version) or Google's SSH client for Chrome.(I'm using Debian buster)