[EMAIL PROTECTED] wrote:
What is the easiest way to edit a file that is in the same directory as
the current file? E.g. I open a file like this: vim /x/y/z/w/file1.c and
want to now open /x/y/z/w/file2.c? Occasionally want to open files in
the parent directory of current file's directory. It would be nice if
there is a special character like "," which starts from the current
buffer's directory. So ":e ,/file2.c" would work. Or maybe "~~" double
tilda character if "," doesn't work...
Method 1: One particular file
Method 2: Change directory for the current window only (assuming other
files, possibly in other directories, are in split windows which are not
to be affected)
" do some edits
Method 3: Change the "current directory" for the whole of Vim
" do something
In all the above examples, you can use ":new" ":tabnew" etc. instead of
":e". In Method 2 the "child" window will (IIUC) inherit the ":lcd"
setting of its "parent", i.e. of the one which was current when you
issued the "new" (etc.) command.