 | | From: | jrefactors at hotmail.com | | Subject: | basic questions on vi | | Date: | 14 Jan 2005 19:03:55 -0800 |
|
|
 | 1) how to go to the most bottom of the file in vi? 2) global search and replace?
thanks!
|
|
 | | From: | Bob Harris | | Subject: | Re: basic questions on vi | | Date: | Sat, 15 Jan 2005 03:27:26 GMT |
|
|
 | In article <1105758235.564396.127570@z14g2000cwz.googlegroups.com>, jrefactors@hotmail.com wrote:
> 1) how to go to the most bottom of the file in vi?
G
and to go to the top
1G
> 2) global search and replace?
:%s/regular-expression/replacement-value/g
If you want to approve each change
:%s/regular-expression/replacement-value/gc
If you want more control then
/regular-expression make your change n . n . n .
n finds your next match .. repeats the previous change
If your vi is really Vim as in a Linux box, then try
vim -c ':help usr_02'
If you are on a traditional commercial UNIX (Sun, HP, IBM, ...) and you are running the original vi, then try a Google search for
vi tutor
it will uncover a lot of sites with basic vi beginner information
There is also an O'Reilly book on Learning vi. And there is a very good book Vim book by Steve Oualline called "Vi IMproved (Vim) published by New Riders
Bob Harris
|
|
 | | From: | jrefactors at hotmail.com | | Subject: | Re: basic questions on vi | | Date: | 14 Jan 2005 21:52:17 -0800 |
|
|
 | Thanks Bob!!
so vi in LINUX is Vim, how it differs from traditional vi in commercial UNIX machines? same commands?
|
|
 | | From: | Sven Guckes | | Subject: | Re: basic questions on vi | | Date: | 15 Jan 2005 07:00:54 GMT |
|
|
 | * [2005-01-15]: > so vi in LINUX is Vim, how it differs from traditional > vi in commercial UNIX machines? same commands?
vi in linux can be nvi, elvis, or vim. or... other. and you'll find a list of difference when you enter ":help vi-differences" in vim.. so.. read!
Sven
|
|
 | | From: | jrefactors at hotmail.com | | Subject: | Re: basic questions on vi | | Date: | 14 Jan 2005 21:50:46 -0800 |
|
|
 | thanks a lot, Bob!
so you said vi in linux is actually Vim ?
|
|
 | | From: | Mikolaj Machowski | | Subject: | Re: basic questions on vi | | Date: | 15 Jan 2005 15:20:37 GMT |
|
|
 | jrefactors@hotmail.com scripsit: > thanks a lot, Bob! > > so you said vi in linux is actually Vim ? > Not always.
On Slackware it is elvis and on Debian nvi. On RH and Mdk it is Vim.
With 'childs' like Knoppix for Debian it depends on creator, but it is rather changed to Vim than to something other.
Note also that calling literally 'vi' on some systems when Vim is installed calls often vim-tiny stripped from almost all Vim goodies (and sometimes even in vi-compatibility mode).
m.
ps. Some time ago MOX switched from nvi(?) to Vim. -- LaTeX + Vim = http://vim-latex.sourceforge.net/ Vim Universal Templates: http://vim.sf.net/script.php?script_id=1078 vim.pl - http://skawina.eu.org/mikolaj CLEWN - http://clewn.sf.net
|
|