Those who use Vi (or Vim) always boast that if I saw it is much more powerful than dwarf, true but !, to a certain extent. Although nano is not as complete or powerful as vi / vim, it is not that poor man is maimed hehe.
Something that can be done in nano but not many know, is to select text, copy that text and paste it in another part of the file, here I will show you how to do this.
Table of Contents
How to select text in Nano
To select with Nano we must press Other + A , then we will notice how with the direction arrows (left, right, up and down) we can point out what we want to select.
To cancel the selection, press again Other + A . I show you a screenshot:
How to copy with Nano:
To copy we use the combination Other + 6 through which, if we have NOT selected anything, we will copy the line where we are located.
How to paste something copied into Nano:
To paste we will use Ctrl + U and where the cursor is, something that we previously copied will be pasted.
Select + Copy + Paste in Nano?
Suppose we want to select a text, copy it and then paste it, it would be like this:
- We push Other + A and using the arrow keys, we mark the desired text.
- We do not press again Other + A , but right there with that selected, we press Other + 6 to copy that marked.
- As you can see, pressing the copy keys lost the selection.
- We already copy it, now we go to the part of the file where we want to paste the previously copied thing, and with the cursor there we do: Ctrl + U
Well clearer nor the water hehe, I hope it is as useful as it is to me