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

Re: Format of filenames in tabs?

Expand Messages
  • Ben Schmidt
    ... can be done via ... which, of course, you could map to something, or put in an autocommand or something to have it happen automatically if desired. Not
    Message 1 of 6 , May 4 5:33 AM
    • 0 Attachment
      björn wrote:
      > 2008/5/2 Bob <drbobbeaty@...>:
      >> I have been using MacVim for a few weeks, and I have something that
      >> seems just a little odd. If I start MacVim from the command line with
      >> four files on the command-line then open up three additional tabs,
      >> assigning one file to each tab, the filename (no directory components)
      >> is what's displayed in the tab.
      >>
      >> But if I open a new file from the 'Open Tab...' menu selection, the
      >> file name is pre-pended by the shortcut name of the path to the file
      >> starting at '~'. Now, while I like that idea, I'd like to know if it's
      >> possible to set the format of the tab titles to one way or the other.
      >> It's a little confusing to have some files with the name only, and
      >> others with the path as well.
      >
      > The reason why the path is displayed in the tab when you open from the
      > menu is because the current directory doesn't automatically get set to
      > the directory the files you open reside in. Try typing ":cd
      > path-to-files" after opening the files and you'll see that only the
      > filenames are displayed in the tabs.

      :cd path-to-files

      can be done via

      :cd %:p:h

      which, of course, you could map to something, or put in an autocommand or
      something to have it happen automatically if desired. Not sure if you'd really
      want that, though. Still.

      :help mapping
      :help autocommand
      :help cmdline-special
      :help filename-modifiers

      Ben.





      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_mac" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    • Mark Wilden
      ... I ve used several editors on Windows (including TextPad) that offer the option to have the current directory follow the open file. It s quite useful on GUI
      Message 2 of 6 , May 4 8:01 AM
      • 0 Attachment
        On May 4, 2008, at 5:33 AM, Ben Schmidt wrote:

        > :cd path-to-files
        >
        > can be done via
        >
        > :cd %:p:h
        >
        > which, of course, you could map to something, or put in an
        > autocommand or
        > something to have it happen automatically if desired. Not sure if
        > you'd really
        > want that, though.

        I've used several editors on Windows (including TextPad) that offer
        the option to have the current directory follow the open file. It's
        quite useful on GUI systems, where the "current directory" is not
        necessarily obvious. At any rate, I've found it useful, and I think I
        may add that autocmd myself. The Project plugin (works on a list of
        files in a project) includes this concept, too, and I often stumble
        when editing a non-project file, then interact with the OS.

        ///ark

        --~--~---------~--~----~------------~-------~--~----~
        You received this message from the "vim_mac" maillist.
        For more information, visit http://www.vim.org/maillist.php
        -~----------~----~----~----~------~----~------~--~---
      • Mark Wilden
        I ve been using the autocommand Ben suggested to have the current working directory follow the buffer and I m loving it!! Thanks, Ben! autocmd BufEnter * :cd
        Message 3 of 6 , May 5 9:00 AM
        • 0 Attachment
          I've been using the autocommand Ben suggested to have the current
          working directory follow the buffer and I'm loving it!! Thanks, Ben!

          autocmd BufEnter * :cd %:p:h

          ///ark

          --~--~---------~--~----~------------~-------~--~----~
          You received this message from the "vim_mac" maillist.
          For more information, visit http://www.vim.org/maillist.php
          -~----------~----~----~----~------~----~------~--~---
        Your message has been successfully submitted and would be delivered to recipients shortly.