Solved

KORN SHELL filename completion in vi mode

Posted on 2001-08-16
3
1,052 Views
Last Modified: 2008-02-01
I am using vi mode in KSH (set -o vi)

I need to know the "vi" equivalent of emacs mode automatic completion ("escape escape")

THANKS
0
Comment
Question by:happyloman
  • 2
3 Comments
 
LVL 14

Expert Comment

by:chris_calabrese
Comment Utility
It's the same.  Except in Solaris, where it's broken.
0
 
LVL 6

Accepted Solution

by:
bira earned 200 total points
Comment Utility
Hi

 Filename completion is only available if the the environment variables EDITOR and/or VISUAL are set to either emacs, gmacs or vi. For example:

   EDITOR=emacs

The value of the VISUAL variable takes precedence over the value of the EDITOR variable.

emacs- or gmacs-style file completion
To complete a file or directory name with emacs or gmacs set press the ESC key twice.

   ls -l on<ESC><ESC>line_help

If the filename is not completed enter more characters until the filename can be uniquely identified.

Directories are shown by the trailing / character.

vi-style file completion
To complete a file or directory name with vi set press the \ (backward slash) key.

   ls -l on\line_help

If the filename is not completed enter more characters until the filename can be uniquely identified.

Directories are shown by the trailing / character.

List possible names
To list all the possible names of files press the ESC key followed by the = key.

   ls -l S<ESC>=
   1) SIRS
   2) Solaris

Directories are shown by the trailing / character.

0
 
LVL 14

Expert Comment

by:chris_calabrese
Comment Utility
What you describe as vi-style completion is not completion at all, but merely a listing.  Actual completion works both in emacs mode and vi mode, but not in vi mode on Solaris (because they're using an old/buggy version of ksh).
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Introduction Regular patching is part of a system administrator's tasks. However, many patches require that the system be in single-user mode before they can be installed. A cluster patch in particular can take quite a while to apply if the machine…
I promised to write further about my project, and here I am.  First, I needed to setup the Primary Server.  You can read how in this article: Setup FreeBSD Server with full HDD encryption (http://www.experts-exchange.com/OS/Unix/BSD/FreeBSD/A_3660-S…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now