4

I use nano as my favorite text editor.

I was able to save my documents by pressing F3 + Enter.

But is there a way to save the document directly by pressing some key, if I'm sure I would like to save the document to the same name as before?

polym
  • 10,852
novice
  • 55

2 Answers2

3

You can try:

  • Edit your .nanorc file
  • Add line: set tempfile

Now, after you finish editting your file, just press Ctrl + X, nano then quit and automatically save your file.

cuonglm
  • 153,898
2

Referenced from : Wiki Saving and exiting

If you want to save the changes you've made, press Ctrl + O. To exit nano, type Ctrl + X. If you ask nano to exit from a modified file, it will ask you if you want to save it. Just press n in case you don't, or y in case you do. It will then ask you for a filename. Just type it in and press Enter.

If you accidentally confirmed that you want to save the file, but you actually don't, you can always cancel by pressing Ctrl + C when you're prompted for a filename.

polym
  • 10,852
DNS1
  • 99
  • 1
    Ctrl-O is equivalent to F3 and they both prompt to confirm the filename. My understanding of the question is that novice wishes to avoid this prompt for confirming the filename. – damien Jul 07 '14 at 08:07