0

I'm connected to a aws linux vm via ssh as you can see below. I want rebind key codes in .nanorc e.g. bind ^C copy main. But if I reopen nano I got message that there are mistakes in .nanorc. Those mistakes belongs to the key binding command (definitions for syntax highlighting are working as expected). Whats wrong with my binding commands. Bindings are not working in remote shell?

enter image description here

[ec2-user@ip-xxx-xxx-xxx-xxx ~]$ cat /etc/os-release 
NAME="Amazon Linux"
VERSION="2"
ID="amzn"
ID_LIKE="centos rhel fedora"
VERSION_ID="2"
PRETTY_NAME="Amazon Linux 2"
ANSI_COLOR="0;33"
CPE_NAME="cpe:2.3:o:amazon:amazon_linux:2"
HOME_URL="https://amazonlinux.com/"
[ec2-user@ip-xxx-xxx-xxx-xxx ~]$ echo $0
-bash
2
  • Perhaps the "mistake" is as simple as your capitalization of Copy ? Dec 2, 2022 at 21:55
  • @steeldriver one line below I tried lower case. But same result.
    – Hölderlin
    Dec 3, 2022 at 17:19

1 Answer 1

1

It looks like you are trying to bind a key code to a command in Nano, but the key binding is not working. This is likely because Nano is not able to recognize the key code you are using in the bind command.

To fix this, you can try using a different key code for the bind command. Nano supports several different key codes, which you can find listed in the Nano manual under the "Key Bindings" section. For example, you can use ^C to represent the Ctrl+C key combination, or ^X to represent the Ctrl+X key combination.

Here is an example of how you could use a different key code in your bind command:

 ^X copy main

This will bind the Ctrl+X key combination to the copy main command in Nano.

1
  • Yes I can find explanation in man nanorc. There is written to use keyword "bind" for rebind any keys (bind ^X copy main ). See my commented list above, I tired several keybindings. nothing worked. My syntax highlighting definitions are working as expected only the bind commands are fail.
    – Hölderlin
    Dec 3, 2022 at 17:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .