vim - insert current filename

When writing comments in source code or for some other reason than I can think of right now, I like to include the current filename into current vim session.

  • Enter insert mode
  • use following key sequence: ctrl-r %
POOF! You have the filename (it does include the path).

In vim % is the current filename. It is very useful when writing mappings or running commands from the : prompt.


Post a Comment

Popular posts from this blog

Template Toolkit Debugging inside of Perl Dancer

Changing Dancer::Plugin::Ajax's content type

BootstrapX clickover