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

What is %:h anyway? (was: Request for enhancement ...)

Expand Messages
  • Ricky Buchanan
    ... Okay. I m baffled (again). What s %:h do anyway? I can t find any help for it that s obvious, does it mean the current directory or something? Regards,
    Message 1 of 7 , Dec 1, 2003
    • 0 Attachment
      Jonathan D Johnston wrote:
      > Tony, your explanation, as always, was very thorough, but I think Keith
      > may have been referring to the *combination* of a file command, such as
      > ":edit", *and* the use of "%:h". Unless I've missed an option or it was
      > implemented by a recent patch, something like
      > :e %:h/partialPath<Tab>
      > just generates a beep for me. "Normal" usage, such as,
      > :e partialPath<Tab>
      > works fine.

      Okay. I'm baffled (again). What's %:h do anyway? I can't find any
      help for it that's obvious, does it mean the current directory or
      something?


      Regards,
      Ricky

      --
      : Usual state: (e) None of the above.
      : rb@... http://tertius.net.au/~rb/
      : There is always a better way. -- Thomas Edison
    • David Risner
      ... % of course is used to mean the complete pathname of the current buffer (:help ... (:help filename-modifiers). So, %:h is the directory of the file in the
      Message 2 of 7 , Dec 1, 2003
      • 0 Attachment
        --- Ricky Buchanan <rb@...> wrote:
        > Jonathan D Johnston wrote:
        > > Tony, your explanation, as always, was very thorough, but I think Keith
        > > may have been referring to the *combination* of a file command, such as
        > > ":edit", *and* the use of "%:h". Unless I've missed an option or it was
        > > implemented by a recent patch, something like
        > > :e %:h/partialPath<Tab>
        > > just generates a beep for me. "Normal" usage, such as,
        > > :e partialPath<Tab>
        > > works fine.
        >
        > Okay. I'm baffled (again). What's %:h do anyway? I can't find any
        > help for it that's obvious, does it mean the current directory or
        > something?

        % of course is used to mean the complete pathname of the current buffer (:help
        :_%). :h means just the head (everything but the filename) of the previous path
        (:help filename-modifiers). So, %:h is the directory of the file in the current
        buffer.



        =====
        David Risner
        Software Engineer
        California State University, Los Angeles
        http://www.risner.org/david/
        Yahoo: drisner; ICQ: 121265980; MSN: drisner@...; AIM: dgrisner
      • Bram Moolenaar
        ... This is in the todo list somewhere. It s not really easy to implement, but certainly possible. I have situations myself where I need completion of an
        Message 3 of 7 , Dec 22, 2003
        • 0 Attachment
          Keith Roberts wrote:

          > I don't know if this has been discussed before ... and I don't think it's in
          > the ToDo list (unless 'cmdline completion', item#7 refers to this) ...
          >
          > But I would like to have filename completion work for commands like
          > :e %:h/string<Tab>
          >
          > Also :new, etc. In fact, any command which expects a filename.
          >
          > I'm sure the completion logic is subroutined somewhere, and I can't
          > for the life of me imagine why it isn't already being employed here.

          This is in the todo list somewhere. It's not really easy to implement,
          but certainly possible. I have situations myself where I need
          completion of an item with % or #.

          --
          From "know your smileys":
          *<|:-) Santa Claus (Ho Ho Ho)

          /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
          /// Creator of Vim - Vi IMproved -- http://www.Vim.org \\\
          \\\ Project leader for A-A-P -- http://www.A-A-P.org ///
          \\\ Help AIDS victims, buy here: http://ICCF-Holland.org/click1.html ///
        Your message has been successfully submitted and would be delivered to recipients shortly.