After some searching, I got to know :echo @% displays the current filename in the bottom line of vim-screen.I would like to dump the filename (with and without full path) into the contents of the file without leaving vim. Is there any way to do this?
How do I insert the current filename into the contents in Vim?
vim
I'm sure there are other ways to do this... but the main command you want is :r[ead] which inserts the output of a command into the buffer.So, to insert just the file name::r! echo %And, to include the full path::r! echo %:pFor more info::help read:help filename-modifiers 