Is there any way how to use :sh to open shell in needed directory? So I don’t have to use cd to get directory I need. Running something like :sh /your/directory does not work.
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.
If you’re just wanting to run your shell in the directory of the file you’re editing you could
set autochdir– it automatically changes directory to whatever file you are editing.Maybe not exactly what you’re looking for, but I don’t know of any built in way to do that. Though you could write a function to do it. Something like this does the trick for me:
Of course the directory will remain changed after you’ve ran your shell, but it may be possible to change the function to not do that.