Probably everyone that uses a Linux OS is familiar with what
nano is. But if you aren't aware, don't worry. Nano is a Unix and Linux operating system command line text editor. What this means is that this is essentially a text editor built into your terminal. How awesome is that!
Of course, it can not be compared to other text editors like VSCode or Sublime Text or vim. Nonetheless, it's still handy and efficient. But unfortunately, most people don't use nano to it's fullest potential. And the reason is being that nano keyboard shortcuts are different than what we are used to.
In this post, we are going to explore the 11 nano shortcuts that you must know. We are going to group the shortcuts in different groups. Let's start with:
One of the most challenging thing in nano is moving around. One of the most painful things is when you have to go to the end of a line, and you have to press the right arrow key a million times. Now I know that this sounds super lazy, but imagine when you have to do this to 20 different lines. It's gonna take an annoying amount of time. That's why the movement shortcuts are one of the most important to use in nano. Here are the top ones that you should definitely remember.
- Moves you to the start of the line:
- Moves you to the end of the line:
- Moves you one page up:
- Moves you to the end of the file:
Another painful thing is when you make an error and have no idea how to undo it. Well in most cases you close the file without saving the changes and start all over. That's why learning the main editing shortcuts is gonna save you quite a lot of time.
- Cut current line into cutbuffer:
- Paste contents of cutbuffer:
- Undo last action:
- Redo last undone action:
And the final group is deleting. Imagine you add a ton of text that you want to be removed immediately. Well, it sure is going to take you a long time to remove if you don't know these shortcuts.
- Delete the word to the left:
- Delete the word to the right:
- Delete current line:
Not everybody uses Nano, and some prefer vim or emacs. But it is good to know some handy shortcuts which could help you if you ever need to use Nano.
Speaking of text editors, be sure to check out this post on VScode shortcuts for Mac and Windows:
I hope that this helps!