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

Format of filenames in tabs?

Expand Messages
  • Bob
    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
    Message 1 of 6 , May 2, 2008
      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.

      If there were an option or a 'set' value, that would be great.

      Most times, I think I'll want to look at just the filename as I know
      where it's coming from, but it might be nice to switch it up every now
      and then.

      Thanks for giving me any pointers you might have.
      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_mac" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    • Tiago Taveira
      You can try the guitablabel setting. To set just the filename on the title you can do set guitablabel=%t . A list of other modifiers can be found with help
      Message 2 of 6 , May 2, 2008
        You can try the 'guitablabel' setting. To set just the filename on
        the title you can do 'set guitablabel=%t'.
        A list of other modifiers can be found with 'help filename-modifiers'.

        Tiago

        On May 2, 2008, at 9:46 PM, Bob wrote:
        > 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.
        >
        > If there were an option or a 'set' value, that would be great.
        >
        > Most times, I think I'll want to look at just the filename as I know
        > where it's coming from, but it might be nice to switch it up every now
        > and then.
        >
        > Thanks for giving me any pointers you might have.


        --~--~---------~--~----~------------~-------~--~----~
        You received this message from the "vim_mac" maillist.
        For more information, visit http://www.vim.org/maillist.php
        -~----------~----~----~----~------~----~------~--~---
      • björn
        ... 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
        Message 3 of 6 , May 3, 2008
          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.

          /Björn

          --~--~---------~--~----~------------~-------~--~----~
          You received this message from the "vim_mac" maillist.
          For more information, visit http://www.vim.org/maillist.php
          -~----------~----~----~----~------~----~------~--~---
        • 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 4 of 6 , May 4, 2008
            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 5 of 6 , May 4, 2008
              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 6 of 6 , May 5, 2008
                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.