Whenever I press :pwd in vim, the command always returns the path C:\Windows\system32 , even if I am in the Python file from the desktop. So whenever I run :!python % , the command returns
python: can't open file '\Users\myname': [Errno 2] No such file or directory.
But if I set the path using the command :cd %:p:h and then run the same python command, the Python file will execute correctly. So basically I'm wondering how do I get vim to set the path for each file that I open correctly.
(i.e. if I in the file located on the desktop :pwd returns ~\Desktop\ , or if I in the file in the home directory :pwd returns C:\Users\MyName\ ).
bab
source share