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

Yanking a file name into a buffer

Expand Messages
  • Scott Cegielski
    Is there a normal command to yank a filename into a buffer based on the isfname option. Something kind of like yiw? Scott Cegielski scegielski@yahoo.com
    Message 1 of 2 , May 2, 2005
      Is there a normal command to yank a filename into a buffer based on the isfname
      option. Something kind of like yiw?


      Scott Cegielski
      scegielski@...



      __________________________________________________
      Do You Yahoo!?
      Tired of spam? Yahoo! Mail has the best spam protection around
      http://mail.yahoo.com
    • Tim Chase
      ... Based on your example, I suspect you mean yank a filename into a *register* , rather than a buffer. If this is the case, you can do something like ...
      Message 2 of 2 , May 2, 2005
        > Is there a normal command to yank a filename into a buffer
        > based on the isfname option. Something kind of like yiw?

        Based on your example, I suspect you mean "yank a filename into a
        *register*", rather than a buffer. If this is the case, you can
        do something like

        :let @"=expand("<cfile>")

        which will put the filename under the cursor into the scrap
        register. Adjust the @" for your favorite register.

        This can easily be mapped like

        :nnoremap <f3> :let @"=expand("<cfile>")<cr>

        which will make <f3> behave like you describe. HTH,

        -tim
      Your message has been successfully submitted and would be delivered to recipients shortly.