Search code examples
vimfilepathrelative-path

How make the 'str +x' 'str+f' command relative


How can I change the start location of the 'str +x' 'str+f' command.

I mean my buffer is located in home/website/index.htm. But when I use the command he starts at home but I want him to start at my file location.


Solution

  • Actually, ctrl-x ctrl-f looks for filenames that are in the folder where the vim session is located.

    Use :pwd to check, where you are.

    To change to the folder where the current file is located, type :cd %:p:h in normal mode.