Al Hoang

March 12, 2009

Insert the current filename into current edited file in vim

Filed under: fixes, geek, programming, tech — hoanga @ 2:32 am

I had a need for inserting the name of the current file into a bunch of files I was editing. I was pretty sure there was a function to do this in vim and after some searching I was right.

To insert the current filename. In Insert Mode, type CTRL-r % and it will insert the current filename.

Thanks to blog post for the tip!

Share and Enjoy:
  • Digg
  • del.icio.us
  • Netvouz
  • DZone
  • ThisNext
  • Reddit
  • StumbleUpon
  • LinkedIn

Leave a Comment

You must be logged in to post a comment.

Powered by WordPress

Protected by AkismetBlog with WordPress