Hacker News new | ask | show | jobs
by Jiocus 1038 days ago
Are you sure about those nano commands? Since a few years I've always found nano system defaults to be:

^s: Save

^o: Save as (type out filename, save and return to editing)

In other words, to save and quit:

^s,^x

1 comments

If that’s true, I’ve been literally wasting a really annoying keystroke every time. Why on Earth don’t they include SAVE in the list of commands they advertise in the footer?
not only that, you can type ^x directly; if the file was modified you'll be prompted for a "save y/n" before exit
Sadly, doing that takes you to Save As (the ^O thing) by default for some crazy reason, meaning you'd be doing ^X, y, [Enter].

I'm now a convert of ^S^X!

Let's see what nano says in ^G (help):

    ^S Save file without prompting
I appreciate that and will be forever grateful to you personally from now on when I hit ^S, but I just never thought to search the Help for it, since I figured something so critical would surely not have been omitted from the footer menu if it existed!

Let's just take a moment to appreciate what is apparently more important than the happy-path activity of saving your file:

  ^G Get Help  ^O WriteOut  ^R Read File ^Y Prev Pg   ^K Cut Text  ^C Cur Pos   
  ^X Exit      ^J Justify   ^W Where is  ^V Next Pg   ^U UnCut Text^T To Spell  
Of these, I to this day have no idea what ^J, ^C, and ^T would even do. Who the heck tries to justify text in a plaintext editor? Lol.
* ^J is not very useful, it combines a block of lines into a single line.

* ^T requires a spell checker to be installed. I get: Error invoking "spell", even though I have aspell, gspell, hspell, huspell, hunspell and also nuspell installed. Who knows how to configure this.

* ^C outputs information about the current cursor position, but "Cur Pos" is not a helpful description.

To be fair, I just discovered that many(all?) of the commands listed in ^G (help) are actually in the footer menu, but the menu is truncated to what available space is available on 2 rows × char width. Save is positioned very far to the right as the last item.

According to nano, the rationale of the order is:

> "The bottom two lines show the most commonly used shortcuts in the editor."

I still use ^O a lot due to heuristics of reading a file X, to use as a template for a new file Y (think nginx server block). The intent to use ^O, in those cases, actually precedes firing up nano.