vim Vim Registers Paste the filename while in insert mode using the filename register


In Insert mode, press <C-r> and then % to insert the filename.

This technique is applicable to all registers.

For e.g. if in insert mode, you want to paste the current search pattern, you can type <C-r> and then /.