I am trying to open a different file at some different location while i am working on a file in vim using split screen feature using

vsp:cd.. / folder/filename

after I hit enter it just shows me blank screen with split window.

So I need to know how to open a file in different location from current vim screenenter image description here

  • You can't combine vsp and cd like that. First cd to the directory you want, then vsp with the filename you want. By combining them, I think you've created a new file named 'cd' in '../http/http_protocol'. – ash Apr 16 '19 at 14:48

So you should actually use:

:vsp ../folder/filename

No need to use cd because :vsp only expects a path not a shell command.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.