select in vi
Hi,
I would like to select a block of line in vi editor, from line 24510 to 36542. Any ideas? |
Try shift+v then use the arrow keys to highlight lines.
|
jstephens84:
Thank you but in fact I got over 10k of lines. So what I need is a command to do it from once. |
You can prepend commands with the line range.
:24510,36542s/^/\t/ will insert a tab on the range 24510-36542. :24510,36542y will yank this range of lines. You could also use cut instead and then 'p' paste them somewhere. |
jschiwal:
How to use cut? That is what I need. |
You can use :delete followed by :paste
:10,20d 50G ]p The :10,20d command will delete the lines from 10-20 inclusive. Entering 50G will go to line 50. ] goes to the end of line 50 p pastes what you deleted. |
All times are GMT -5. The time now is 11:04 PM. |