We continue. Previous topic (text navigation): here
Today's topic is working with selecting, copying, and deleting chunks of text.
To understand the principles of text commands, you must first understand the principle of text selection. It is carried out either by mouse or from the keyboard. From the keyboard, selection is as follows: first, the beginning of the selection is marked: Alt-A
or Ctrl- ^
. This is followed by navigation — and until the action is performed on the text in the buffer, the selection remains (note that the selection remains even when you enter text, in this it is very different from the selection in windows gui applications and closer to the persistent blocks in TurboC, DN and the corresponding options Far Manager'a).
Please note that all navigation features are applicable, including skipping by line number or searching (in future releases).
Further, the selected text can be deleted or copied to the buffer. This makes the combination
The selected text can be copied to the clipboard - a combination of
(yes, we LOVE nano).
Next, we can paste the text from the clipboard -
. Please note - in the hint from the bottom it is written wrong, this is not cancel deletion, this is an insert.
In addition, for ease of editing,
deletes the line if there is no selection. Either entirely, or from the cursor to the end of the line. The behavior is switched by the
combination (by default, the mode is to delete the entire line, and
switches it back and forth).
Note that the deleted line is in the buffer, so it can be inserted using
Another lazy combination is
, which erases everything from the cursor to the end of the file (the trunkate command).
To insert text from another file, the
button is used (I think all vim users are well aware of the behavior of this button in nano).To be continued