Now there is a situation:
I am now under the Ubuntu user root directory-~
I have a folder under the root directory blogs, this folder has two files: text1,text2.
I now do the following from the ~ directory
Vim ~/blogs/text1
Then, I want to open the Text1, using the command line opened the same directory of Text2, then the question is, how do you want to open it?
My previous practice was to use the command line and then use the e command. After use: /.. /blogs/text2 this to open. If the directory hierarchy is relatively small (as in this example), then
If we are at a more directory level, what do we do, or do we open it with a relative path?
VIM provides us with a way to feel useful.
Other methods are not changed, we can use the following method when we need to find the path of the file
: E%:h<tab>
%-represents the path of the currently open file relative to the cache working path + file name
The path to the cache work path, which is the path where you use VIM to open a file
: h This operation, is to remove the file name, only the path of the current file is left
How to open another file in the vim-buffer