Sunday, May 5, 2024
238
rated 0 times [  238] [ 0]  / answers: 1 / hits: 296673  / 3 Years ago, sat, may 8, 2021, 3:20:32

I use the commmand line text editor nano. How do I undo an action while editing text?



For example:
I typed some text and then changed my mind. Now I want to return to previous state. How?


More From » command-line

 Answers
2

Starting with nano version 2.3.5 in July 2014, undo/redo became standard:




  • Alt-U or Option-U or EscU - undo

  • Alt-E or Option-E or EscE - redo



It's in the help:



enter image description here



And if you stretch the screen wider than about 1400 pixels, there's a hint at bottom right:



enter image description here



If these keys don't work, check nano --version.




  • nano versions 2.1.10 - 2.3.4 should use the command line option -u (thanks @sil). Tip: add alias nano="nano -u" to your .bashrc (thanks @Benia). The implementation of undo during this period appears to have been buggy or incomplete.


  • nano versions 2.1.3 - 2.1.9 had some kind of undo feature. The -u option was not necessary.




M stands for meta.


[#29935] Monday, May 10, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
igeonlothe

Total Points: 370
Total Questions: 121
Total Answers: 114

Location: United States Minor Outlying Island
Member since Fri, Feb 5, 2021
3 Years ago
igeonlothe questions
Wed, May 31, 23, 02:34, 1 Year ago
Sat, Mar 12, 22, 17:13, 2 Years ago
Tue, Aug 31, 21, 09:46, 3 Years ago
;