Off-Topic > Off-Topic - Tiny Core Lounge
VI editor and yank-yank-put !
(1/1)
PDP-8:
This is nothing new to old-timers, but thought I'd bring it up for newcomers to vi editing....
In Tc / Pi / dCore, we do a lot of configuration file editing. This usually involves copying a line, editing in some changes, and remark-ing out the original line with a hash # at the beginning.
Most vi tutorials cover the "yank" and "put" features quite well, but I'm amazed at the amount that don't mention the three-fingered salute - and that's not ctrl-alt-delete!
What I'm talking about is Y-Y-P, or yank-yank-put for instant copying of the line you are on.
I only mention it since I see this quickie combo often left out of many tutorials. :)
andyj:
Why do you have to yank twice? Y-P should work.
PDP-8:
Awesome andyj! You made me research something I've been just blindly pounding out for years with muscle memory.
Capitalization matters, I should have been more explicit.
To yank in one line, lowercase yy is the same as a single uppercase Y
and of course p or P will put the yanked line above or below depending on what you want.
I think the speed-demon in my muscle memory will have me doing the y-y-p without having to reach for a shift key for a Y-p.
Ah, details! :)
Navigation
[0] Message Index
Go to full version