PracticalVim Tip41 - yszheda/wiki GitHub Wiki

Table of Contents

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

References

  • `:edit %:h`: remove the filename while preserving the rest of the path

References

Easy Expansion of the Active File Directory

map `%%` to `%h:h`

References

⚠️ **GitHub.com Fallback** ⚠️