So when I want to create a new file by using the :e command I don’t want to specify the whole path, just the new filename. Can it be done?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
As already suggested, you can use autochdir, which will change to the directory of the file you opened, the other option is
which will change the directory. This can be an absolute or relative path, so
:cd ..will move up one level. Or you can use:cd %:hwhich will also change to the directory the current file is in, but without setting autochdir.will change directory to your home directory (or on windows, print the current directory).
will change the directory to the previous directory you visited.