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

RE: Copy current filename to the clipboard

Expand Messages
  • HALIM,SALMAN (HP-NewJersey,ex2)
    Name Args Range Complete Definition Copyfile 0 let @*=substitute(expand( %:p ), / , , g ) This is the command I use. I
    Message 1 of 12 , Jul 31, 2003
    • 0 Attachment
      Name Args Range Complete Definition
      Copyfile 0 let @*=substitute(expand("%:p"), '/',
      '\\', 'g')

      This is the command I use. I type :Copyfile and it stuffs the current
      filename onto the clipboard.

      Salman.

      -----Original Message-----
      From: Antoine J. Mechelynck [mailto:antoine.mechelynck@...]
      Sent: Thursday, July 31, 2003 9:59 AM
      To: Biju Chacko; David Fishburn
      Cc: vim@...
      Subject: Re: Copy current filename to the clipboard


      Biju Chacko <biju_chacko@...> wrote:
      > On Wed, 30 Jul 2003 08:20:08 -0400, David Fishburn wrote:
      >
      > > > IIRC, Windows understands both kinds of slashes, but only displays
      > > > '\'
      > > by default. Somebody correct me if I'm wrong ...
      > >
      > > Nope, windows doesn't understand / slashes.
      > >
      > > dir c:/windows/temp
      > > Parameter format not correct - "windows".
      > >
      > > dir c:\windows\temp
      > > Works fine.
      > >
      > > This is always an issue with Vim and its cross platform abilities.
      >
      > My mistake, then. I rechecked, and I realise that I have a faint
      > memory of some api on windows that accepts both kinds of slashes.
      >
      > Not very helpful, really.
      >
      > -- b
      >
      > --
      > -----------------------------------------------------------------------
      > Biju 'botsie' Chacko biju_chacko at vsnl dot
      > net http://www.symonds.net/~botsie Public Key available on
      > request
      > -----------------------------------------------------------------------

      There used to be a hack in Dos which allowed you to switch between / as
      parameter introducer and \ as directory separator to - and / respectively.
      The problem was that (a) you couldn't set it from the command-line (you had
      to either use Basic POKE or write your own utility, preferably in
      Assembler), and (b) many programs always used / and \ regardless.

      Regards,
      Tony.
    Your message has been successfully submitted and would be delivered to recipients shortly.