Tip 41: Open a File by Its Filepath Using :edit
Return to the top: <>
%toc
Open a File Relative to the Current Working Directory
Open a File Relative to the Active File Directory
- `:edit %`: reveal the absolute path of the active buffer
* `%`: shorthand for the filepath of the active buffer
- `:edit %:h`: remove the filename while preserving the rest of the path
Easy Expansion of the Active File Directory
map `%%` to `%h:h`
References