Friday, April 17, 2020

How to get directory of current file.

I am using gVim on Windows. I open a file in C:\tmp called file1.cpp. After looking around in file1.cpp I now want to open file2.cpp which is also in C:\tmp. So I run the command

:e .\file2.cpp

But this doesn't work because the "." is C:\Windows\system32. Is there a different character or function or variable I can use in command mode to designate "the directory that the current file is in"?

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/3d20816b-22ec-4437-9a29-de72d9484674%40googlegroups.com.

No comments:

Post a Comment