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?
You can try:
.nanorc
fileset tempfile
Now, after you finish editting your file, just press Ctrl + X
, nano
then quit and automatically save your file.
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.