Today I Learned

A Hashrocket project

Ready to join Hashrocket? Find Openings here and apply today.

Get the path to the current buffer in VIM

In VIM, you can get the path to the current buffer with the keybinding Ctrl+g. This will print that path to your statusline.

You can also get the path by using the % register:

:echo @%

Super helpful if you need to quickly copy/pasta that path for a coworker

https://www.tutorialspoint.com/vim/vim_registers.htm

Every developer at Hashrocket is a Vim expert. Check out our development environment, Dotmatrix, and if you are in Chicago, come to the Vim Chicago Meetup hosted at our Chicago office.