Question

Gvim will search the executable files in $PATH, $VIMRUNTIME(the folder where gvim.exe locate) and the current folder. The folder of $PATH have the highest priority. Suppose i place a cygwin version “find.exe" in the folder where gvim.exe locate. and i want gvim to call this cygwin version of "find.exe" instead of the windows version of "find.exe" for ":!find", how could i do?

Was it helpful?

Solution

You can modify $PATH in your ~/.vimrc; this will avoid messing with any other Windows program (well, except for those that are launched from inside Vim - do check their compatibility).

:let $PATH = 'C:\cygwin\bin;' . $PATH

If other Cygwin binaries still interfere, copy Cygwin's find.exe to another folder (be it $VIMRUNTIME or a fresh directory somewhere else), and prepend that to $PATH.

:let $PATH = $VIMRUNTIME . ';' . $PATH

OTHER TIPS

If you put C:\cygwin\bin (or your equivalent) at the start of your $PATH it will find the cygwin binary first and use that one rather than the windows binary.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top