Running gvim from the working directory

Trying to run gvim 7.3 from the working directory (project location) seems impossible - the default is to use the home directory, which interrupts my code browsing and pythoncomplete setup.

I tried three approaches. First call gvim from the working directory:

cd /some/dir && gvim 

Second, specifying the 'cd' command to execute gvim

 gvim -c 'cd /some/dir' 

Third, telling him to open a specific file in this directory

 gvim /some/dir/file.txt 

In all cases, when I am in gvim and type ': cd' to see the current directory that I get, this is my $ HOME directory. Vim, on air, runs in the working directory.

Does anyone know if there is a way around the problem or the reasons for this?

+4
source share
3 answers

cd behaves differently on Windows and Unix systems

  • On non-Unix : specify the name of the current directory.
  • On Unix systems: change the current directory to the home directory.
  • Use :pwd to print the current directory on all systems.
+5
source

Is it possible to set the working directory to the current file to solve your problem?

0
source

$ cd /path/to/working/directory; gvim $ cd /path/to/working/directory; gvim works for me.

0
source

Source: https://habr.com/ru/post/1399829/


All Articles