On 30/08/13 00:50, Jerry Dai wrote:
In insert mode, I will get current file name by:
<C-R>%

Is there anything similiar can give me a full hierarchical path?

-- --
Best Regards
Jerry Dai


In a script, expand('%:p') would give you the result as a String. So, to insert it at the Insert-mode cursor:

        <C-R>=expand('%:p')<CR>
or
        :map! <expr> <F7> expand('%:p')
(the latter would let you insert it by hitting F7 in Insert or Command-line mode).

see
        :help expand()
        :help filename-modifiers
        :help quote=
and for use in a mapping or abbreviation
        :help :map-<expr>


Best regards,
Tony.
--
"The road to hell is paved with melting snowballs."
                -- Larry Wall in  <[email protected]>

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to