2

Is there a keyboard shortcut for toggling line number display in the nano editor on a Mac? The keyboard shortcutOption-# that works in Linux work doesn't work on a Mac. I read where someone suggested Control-# or Control-C but they don't work either.

I realize it can be set in the nanorc configuration file, but I only want to see line numbers when I need them, like when I need to see which line an error is occurring on, hence the desire to toggle the display.

1 Answers1

1

escn and escshift# work on macOS.

Meta-key sequences are notated with 'M-' and can be entered using either the Alt, Cmd, or Esc key, depending on your keyboard setup.

George Valkov
  • 251
  • 2
  • 4
  • esc-n works. Thanks! – 3rdrockdata Aug 16 '22 at 15:45
  • I have on #macos "GNU nano version 2.0.6 (compiled 02:20:53, Aug 29 2022)" and not work even with command line arg `nano: unrecognized option '--linenumbers'` – Bruno Nov 09 '22 at 01:51
  • Make sure you have the brew version of nano first in your path. The current version of GNU nano is 6.4. The one in /usr/bin/nano is a symlink to pico. Apple silicon macs have a slightly different install path for brew. `which -a nano` `/usr/local/bin/nano` `/usr/bin/nano` `/usr/local/bin/nano --version` `GNU nano, version 6.4` `/usr/bin/nano@ -> pico` – George Valkov Nov 10 '22 at 05:03