2

I want to use nano on the terminal, however the built-in system keyboard shortcuts constantly conflict with the usability of the program.

Is there a way in which I can set a system option to disable all system shortcuts whilst I am running nano? I am aware that this would be the case regardless of whether I switched to a different application, but I am hoping it would set a habit that I would not do this until I had finished editing and closed nano again.

There are multiple shortcuts which conflict, and as such I am confident that there are more that I haven't yet found, thus I would like a blanket solution such that I can start to learn and be more efficient with nano's shortcuts without any confusion as to whether I can trust the nano help screen

I am aware that bettertouchtool exists, but I don't know if it would be able to set configuration in an event-driven way like I would like

4
  • idk nano, so don't know the specifics, but it surprises me greatly that any app dev would design in-app key commands that are known to conflict with the OS it's running on. That just makes no sense to me. It also makes me wonder what everybody else who uses the app does to avoid this conflict...
    – Tetsujin
    Jul 27, 2020 at 11:17
  • Nano is generally used on a lot of UNIX-based systems, so other than MacOS Linux. It runs embedded in the terminal and thus is complicit to inbuilt terminal keyboard shortcuts like cmd + T, which makes a new tab. It's not really an 'app' so much as a program (it is not .app, nor does it have any GUI functionality that I know of) Jul 27, 2020 at 11:30
  • 1
    This makes no sense. Cmd-T is a macOS shortcut that opens a new tab in windows that support tabs. There is an overall keybinding scheme and it’s based on Emacs. Nano isn’t “complicit” to macOS GUI shortcuts - that would be how the app (Terminal) handles the shortcut. Nano’s shortcuts don’t conflict with the systemwide Emacs keybindings at all nor the macOS shortcuts. What conflicts are you experiencing?
    – Allan
    Jul 28, 2020 at 4:12
  • Specifically with cmd-t I was trying to cut from somewhere to the end of the file. Also jumping back a word with cmd-space. James Brickley's answer more or less solves pretty much all of my problems by switching nano's named meta key to be option instead via the terminal profile. You're right in that complicit carries the wrong meaning, I should have said that 'nano is victim to being overriden by inbuilt shortcuts'. However I would definitely dispute that without changing the meta key to option there are deefinitely conflicts Jul 28, 2020 at 16:16

1 Answer 1

3

Seems the conflict would most of the time be a Meta keybinding where Meta = CMD key on a Mac. The Nano website has a keybinding section of documentation here. You may need to configure a .nanorc and redefine those keybindings that conflict with macOS.

https://www.nano-editor.org/dist/latest/nano.html#Rebinding-Keys

The macOS Terminal under the Profile -> Keyboard has a checkbox for Use Option as Meta key. Seems to work for the nano meta keys. This is per Profile in Terminal.

3
  • The note about the keyboard under profile is really useful, thankyou, maybe in the future I could even do some profile trickery when entering a bash process Jul 28, 2020 at 0:02
  • Iterm2 has shell integration and a whole lot more. iterm2.com/features.html Jul 28, 2020 at 2:22
  • Sounds cool. I have just found one thing that I can't seem to get around, now I can't write a # in the terminal, how would I get around this? Jul 30, 2020 at 15:04

You must log in to answer this question.

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