Loading ...
Sorry, an error occurred while loading the content.

Re: which file is being edited?

Expand Messages
  • Jürgen Krämer
    Hi, ... register % contains the name of the current file. You can pass % as an ... or ... This might give you the file name with a path relative to the
    Message 1 of 5 , Feb 18, 2013
    • 0 Attachment
      Hi,

      shawn wilson wrote:
      > How do I get the full path of the file I'm editing?

      register % contains the name of the current file. You can pass '%' as an
      argument to the expand() function:

      :echo expand('%')

      or

      :let filename = expand('%')

      This might give you the file name with a path relative to the current
      directory. If you always want an absolute path you can append ':p' to
      the register name:

      :echo expand('%:p')

      Regards,
      Jürgen

      --
      Sometimes I think the surest sign that intelligent life exists elsewhere
      in the universe is that none of it has tried to contact us. (Calvin)

      --
      --
      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 vim_use+unsubscribe@....
      For more options, visit https://groups.google.com/groups/opt_out.
    • shawn wilson
      I forgot about C-G - thanks ... This is what I m looking for. Now to associate it with an F key or leader.... decisions -- -- You received this message from
      Message 2 of 5 , Feb 20, 2013
      • 0 Attachment
        I forgot about C-G - thanks

        On Mon, Feb 18, 2013 at 4:23 AM, Jürgen Krämer <jottkaerr@...> wrote:
        >
        > :echo expand('%:p')

        This is what I'm looking for. Now to associate it with an F key or
        leader.... decisions

        --
        --
        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 vim_use+unsubscribe@....
        For more options, visit https://groups.google.com/groups/opt_out.
      Your message has been successfully submitted and would be delivered to recipients shortly.