Change the relative order with which gvim search for executable files

StackOverflow https://stackoverflow.com/questions/23431118

  •  14-07-2023
  •  | 
  •  

Вопрос

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?

Это было полезно?

Решение

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

Другие советы

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.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top