:: Re: [DNG] nano for beginners
Αρχική Σελίδα
Delete this message
Reply to this message
Συντάκτης: Riccardo Boninsegna
Ημερομηνία:  
Προς: dng
Αντικείμενο: Re: [DNG] nano for beginners
On Thu, Jul 16, 2015 at 9:40 PM, Anto <aryanto@???> wrote:
> In vi I use 10yy and then p to copy and paste 10 lines. And I use 10dd to
> delete 10 lines and press u to undo that if I mistakenly deleted the wrong lines.
> What are the equivalent commands for that in nano?
>


ctrl+k cuts a line.
If you immediately cut another one (not even cursor movement is
allowed) it will be added to the "clipboard",
else it will replace the buffer.
ctrl+u pastes.
alt+6 copies the current line (only), but with a little muscle memory
I prefer just pressing ctrl+ku.

alt+u = undo, alt+e = redo (may be off by default in some distros)
ctrl+z = backgrounding (may be off by default in some distros, toggle
for current session with alt+z)

ctrl+o resembles more "save as" rather than "save", as ctrl+x asks for
confirmation if the file was modified.
When asked for a filename, alt+d switches windows/unix line endings.

ctrl+r cats a file to current cursor position.
ctrl+rx pipes a command to cursor position (ideal with `blkid` when
writing a fstab!)

ctrl+c shows the in-file progress you see when opening a file
(normally, status messages last 20 keystrokes: the more you know!)
ctrl+g moves cursor to arbitrary line.