Any body knows how to get the current file name in command mode?!


The common way is either to use

        expand('%')

in an expression (there are modifiers if you need pieces such as the path, extension, etc, as detailed in

        :help expand()

) or control+R followed by a percent-sign to insert the current file-name as if you typed it:

        :help i_CTRL-R
        :help quote_%

(which works in command-line mode)

-tim




Reply via email to