That’s not as easy as you might think with nano. Mainly because of the stage keystroke-philosophy of nano. Here is the way I cut out multiple lines, whole paragraphs or also huge text blocks with nano (Xubuntu 14.04, MacOS X 10.9.5).
- Open file in nano:
$> nano -c textFileToEdit.txt
-c shows line-numbers. Alternatively you can press CTRL+C when you already have opened the file.
- Mark starting line with ALT+Shift+A (CTRL+^ on Mac)
- Now you can use the arrow-keys (up / down / left / right) to mark the text you want to delete.
- If you need to mark very huge textblock, such as to the beginning of the file, you can use one of these keystrokes:
- ALT+Shift+/Â (ctrl+V on Mac)Â => Jump to the end of file
- ALT+ALT-GR+\ (ctrl+Y on Mac)Â => Jump to the beginning of the file
- ALT+G => Go to line X (enter line number on prompt) (ctrl+shift+_ on Mac)
- After you marked the block you want to delete, you simply hit CTRL+K (same on Mac) to delete the lines.
- If you want to paste the textblock elsewhere, you can hit CTRL-U (same on Mac) to paste it on the cursor position.