how to use the filename completion feature with vi editor

how to use the filename completion feature with vi editor

Post by vikas gupt » Sat, 17 Nov 2001 04:53:00



Hi,

I really need to get this..... I am not able to get this to work..
I am a pro vi editor guy....
so i used "set -o vi"  to set my editor to vi (I use ksh)
also in my .profile i have export EDITOR=vi
but.... the filename completion feature is the one I want with vi as my
working editor..
can anyone help??

TIA

vikas

 
 
 

how to use the filename completion feature with vi editor

Post by Urban A. Haa » Sat, 17 Nov 2001 05:50:55


I believe that's a feature of the Born (or is it Bourne) again shell, bash.
Ksh doesn't do this. You can find the bash shell on the Linux toolbox CD --
or the Bull Site.

Urban


Quote:> Hi,

> I really need to get this..... I am not able to get this to work..
> I am a pro vi editor guy....
> so i used "set -o vi"  to set my editor to vi (I use ksh)
> also in my .profile i have export EDITOR=vi
> but.... the filename completion feature is the one I want with vi as my
> working editor..
> can anyone help??

> TIA

> vikas


 
 
 

how to use the filename completion feature with vi editor

Post by Daniel Packm » Sat, 17 Nov 2001 06:17:06




Quote:>Hi,

>I really need to get this..... I am not able to get this to work..
>I am a pro vi editor guy....
>so i used "set -o vi"  to set my editor to vi (I use ksh)
>also in my .profile i have export EDITOR=vi
>but.... the filename completion feature is the one I want with vi as my
>working editor..

For ksh:

If you "set -o vi", then the two characters <ESC> </>  give filename completion

if you "set -o emacs", then the two characters  <ESC> <ESC> do the job.

--
Daniel Packman
NCAR/ACD

 
 
 

how to use the filename completion feature with vi editor

Post by Steve Los » Sat, 17 Nov 2001 06:19:40




Quote:>Hi,

>I really need to get this..... I am not able to get this to work..
>I am a pro vi editor guy....
>so i used "set -o vi"  to set my editor to vi (I use ksh)
>also in my .profile i have export EDITOR=vi
>but.... the filename completion feature is the one I want with vi as my
>working editor..
>can anyone help??

With ksh in "vi" mode, the character sequence for filename
completion is:

ESC \

(escape backslash)

For example, if you only have one file in the current directory
that begins with "B" and you type the three characters

B ESC \

then ksh completes the filename for you.  But if you have the
two files "Butch" and "Butter" and you do the same, then ksh
only completes as far as "But" and you need to type "c" or "t"
to disambiguate and then you can type ESC \ again to have ksh
finish the rest.

In other words, ESC \ does not cycle through the possibilities.
It only completes to the first point where two filenames diverge.

--

University of *ia               ITC Unix Support

 
 
 

how to use the filename completion feature with vi editor

Post by vikas gupt » Sat, 17 Nov 2001 06:51:41


thanks Steve and Daniel!!

it was fun....

vikas




> >Hi,

> >I really need to get this..... I am not able to get this to work..
> >I am a pro vi editor guy....
> >so i used "set -o vi"  to set my editor to vi (I use ksh)
> >also in my .profile i have export EDITOR=vi
> >but.... the filename completion feature is the one I want with vi as my
> >working editor..
> >can anyone help??

> With ksh in "vi" mode, the character sequence for filename
> completion is:

> ESC \

> (escape backslash)

> For example, if you only have one file in the current directory
> that begins with "B" and you type the three characters

> B ESC \

> then ksh completes the filename for you.  But if you have the
> two files "Butch" and "Butter" and you do the same, then ksh
> only completes as far as "But" and you need to type "c" or "t"
> to disambiguate and then you can type ESC \ again to have ksh
> finish the rest.

> In other words, ESC \ does not cycle through the possibilities.
> It only completes to the first point where two filenames diverge.

> --

> University of *ia               ITC Unix Support

 
 
 

how to use the filename completion feature with vi editor

Post by Urban A. Haa » Sat, 17 Nov 2001 08:28:35


I stand corrected and learn something new.

Thanks.



> I believe that's a feature of the Born (or is it Bourne) again shell,
bash.
> Ksh doesn't do this. You can find the bash shell on the Linux toolbox
CD --
> or the Bull Site.

> Urban



> > Hi,

> > I really need to get this..... I am not able to get this to work..
> > I am a pro vi editor guy....
> > so i used "set -o vi"  to set my editor to vi (I use ksh)
> > also in my .profile i have export EDITOR=vi
> > but.... the filename completion feature is the one I want with vi as my
> > working editor..
> > can anyone help??

> > TIA

> > vikas

 
 
 

how to use the filename completion feature with vi editor

Post by Gary R. Hoo » Wed, 21 Nov 2001 00:09:13





> > >Hi,

> > >I really need to get this..... I am not able to get this to work..
> > >I am a pro vi editor guy....
> > >so i used "set -o vi"  to set my editor to vi (I use ksh)
> > >also in my .profile i have export EDITOR=vi
> > >but.... the filename completion feature is the one I want with vi as my
> > >working editor..
> > >can anyone help??

> > With ksh in "vi" mode, the character sequence for filename
> > completion is:

> > ESC \

FWIW, one can also use ESC * to get all files expanded (up to the limit
of the
command line buffer size).

--
Gary R. Hook / AIX PartnerWorld for Developers / These opinions are MINE
________________________________________________________________________