1. 20
  1. 2

    ViM is now easier to quit than Nano, if Nano is launched with --zero or --nohelp:

    • ctrl-q starts a backwards search
    • ctrl-c shows a status message at the bottom
    • ctrl-h shows no help but starts deleting text
    • ctrl-? just inserts question marks
    • ctrl-x then actually quits nano, but only after saving the file with the deleted characters and question marks.

    I wonder what the rationale behind the default keybindings is.

    1. 7

      For ctrl-h, that isn’t nano-specific: that’s just the key combination that generates ASCII code 8, the backspace character (H being the 8th letter of the alphabet).

      ctrl-q and ctrl-w are backward- and forward-search, respectively, and they are right next to each other on the QWERTY keyboard. So that one at least makes geometric sense, although I don’t know why those two keys in particular.

      nano has an interesting history. It’s a clone of pico, which was originally written to be the built-in editor for the pine email client (which was a fork of the elm email client…), which used a forked version of MicroEMACS before they replaced it with pico. I wouldn’t be surprised if many of the keybindings were decided back then: “We can’t assign the spellchecker to ctrl-BLAH because that’s the keybinding for shuffling the user’s inbox!”

      1. 2

        I use micro because it has same default keybindings, and then ssh into boxes with just nano and end up typing ctrl-s and ctrl-q out of habit, alas.

      2. 1

        I rarely use nano these days but back in 2020 I requested a ‘set notitlebar’ option on savannah which didnt really get much support. Now they’ve implemented ‘–zero’ option which is sweet for some basic editing on small screens without the all the cruft. Now we just need Doom-nano, nano with vim-like keybindings ( ._.) edit: spelling