how to "select all" in "vi"?

Status
Not open for further replies.

cqmyg5

Advanced Member level 4
Joined
Oct 21, 2003
Messages
118
Helped
3
Reputation
6
Reaction score
2
Trophy points
1,298
Activity points
963
if vi a text file longer than a screen as:

#vi aa.log

how to select "all" content of aa.log in current vi window?
 

type ggyG
 

Thank miholee!

It show "nnn lines yanked", but how to paste these lines to another vi windows?
 

Hi,

another way to apply commands to a part or all of a file is to
specify the region by its line numbers.

:1,10w newfile
... writes the first 10 lines to file 'newfile'

:1,$s/foo/bar/g

replace all occurances of 'foo' with 'bar'

HTH, RoZ
 

Useful link/ebook on vi is at:

**broken link removed**

cheers.
cqmyg5 said:
Thank miholee!

It show "nnn lines yanked", but how to paste these lines to another vi windows?
 

>ESC(command mode)
>1,%w:tmp
>:r filename #(another file )
#go to the line where you want to past
>:r tmp
 

you can use :%s for replace
and CTRL - v ,then use cursor select all
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…