Peng Yu wrote:
Hi,

Can somebody let me know how to show the current value of "path"?

Thanks,
Peng


Which "path"? There are two of them, and they have nothing in common beside the name.

There is a PATH environment variable, used by the shell to search for executables, which can be shown as follows:

- in Vim:
        :echo $PATH

- in a Dos shell, such as COMMAND.COM, NDOS.COM, 4DOS.COM, CMD.EXE, 4NT.EXE, 
etc.:
        echo %PATH%

- in a Unix shell (sh, bash, csh, tcsh, ksh, zsh, etc.):
        echo $PATH

Then there is a 'path' option, used by Vim to search for files when using such commands as gf and :find (see ":help 'path'"). It exists only inside Vim and can be displayed using:
        :set path?

If you want to know the current working directory, its name is not "path". It can be displayed as follows:

- in Vim:
        :pwd

- in a Dos shell:
        cd
(Caution: the same command in a Unix shell *changes* to the $HOME directory.)

- in a Unix shell:
        pwd

The following command will repeat the current working directory at every shell prompt:

- in a Dos shell:
        PROMPT $P$G

- in a Unix shell:
        export PS1='\w \$'


Best regards,
Tony.
--
I often quote myself; it adds spice to my conversation.
                -- G. B. Shaw

Reply via email to