1823066 Members
3070 Online
109645 Solutions
New Discussion юеВ

"Select All" in vi

 
SOLVED
Go to solution
Hunki
Super Advisor

"Select All" in vi


Does anybody know how to do a select all in vi.

thanks,
hunki.
10 REPLIES 10
Paul Sperry
Honored Contributor
Solution

Re: "Select All" in vi

1G
yG
Pete Randall
Outstanding Contributor

Re: "Select All" in vi

yG


Pete

Pete
Hunki
Super Advisor

Re: "Select All" in vi

How to paste it ( the whole text ) and also to delete the whole text..


thanks
hunki
Paul Sperry
Honored Contributor

Re: "Select All" in vi

Paste?? Why not just copy the file?

cp oldfile newfile

If your going from unix to window$ I'd just
ftp the file to window$.
Paul Sperry
Honored Contributor

Re: "Select All" in vi

And to delete all the text just delete the file.

rm filename.

If you wnat to keep the file with no text just cat /dev/null

cat /dev/null > filename
Hunki
Super Advisor

Re: "Select All" in vi

the ftp is not working and I want to select this big file in one of my workspace and then copy it over to a file in the next workspace.
Hein van den Heuvel
Honored Contributor

Re: "Select All" in vi

Ah... pooor man's file transfer!

I find it better to use a lean and mean tool like 'cat' for that vs an editor.

Yuo want to avoid the 'added value' that en editor offer as it may slow down the abilty to gobble up the paste buffer at top speed.
Furthermore you do not want vi to do something 'smart' like line wrap or look for corresponding open parenthesis for a close and so on.

Just do: cat > somefile
Now paste and control-b

hth,
Hein.

Pete Randall
Outstanding Contributor

Re: "Select All" in vi

To paste in vi, use "p".


Pete

Pete
spex
Honored Contributor

Re: "Select All" in vi

Hi Hunki,

Text you yank into vi's paste buffer is not placed in the X-Windows clipboard. In order to read text into the X clipboard without having to manually select it all, use a program like 'xclip' (available for Linux).

For example:
$ xclip -i largetextfile.txt

Now the contents of largetextfile.txt are in the X clipboard, and can be pasted via a middle-click.

PCS
Hunki
Super Advisor

Re: "Select All" in vi

thanks !