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

Different working directories in different tabs

Expand Messages
  • Martin Lundberg
    Hi, I ve read multiple times that you could have different working directories in different tabs and when testing it does work. I can t however find anything
    Message 1 of 6 , May 31, 2011
      Hi,

      I've read multiple times that you could have different working directories in different tabs and when testing it does work. I can't however find anything about this in the help docs. Is there nothing about it in the docs or is it a bug?

      -Martin

      --
      You received this message from the "vim_use" maillist.
      Do not top-post! Type your reply below the text you are replying to.
      For more information, visit http://www.vim.org/maillist.php
    • Christian Brabandt
      ... regards, Christian -- You received this message from the vim_use maillist. Do not top-post! Type your reply below the text you are replying to. For more
      Message 2 of 6 , May 31, 2011
        On Tue, May 31, 2011 2:28 pm, Martin Lundberg wrote:
        > I've read multiple times that you could have different working directories
        > in different tabs and when testing it does work. I can't however find
        > anything about this in the help docs. Is there nothing about it in the
        > docs
        > or is it a bug?

        :h :lcd

        regards,
        Christian

        --
        You received this message from the "vim_use" maillist.
        Do not top-post! Type your reply below the text you are replying to.
        For more information, visit http://www.vim.org/maillist.php
      • Martin Lundberg
        ... Hi Christian. To my understanding that is not what I m talking about. The ... new tab and changing the working directory using :cd. It changes the cwd for
        Message 3 of 6 , May 31, 2011
          On Tuesday, May 31, 2011 2:55:40 PM UTC+2, Christian Brabandt wrote:

          :h :lcd

          regards,
          Christian

          Hi Christian. To my understanding that is not what I'm talking about. The :lcd command changes it for the current window. I'm talking about creating a new tab and changing the working directory using :cd. It changes the cwd for that tab only (you can even see the filenames of the other tabs changing on the tabs). If you then change back to another tab it's cwd has not changed.

          --
          You received this message from the "vim_use" maillist.
          Do not top-post! Type your reply below the text you are replying to.
          For more information, visit http://www.vim.org/maillist.php
        • Dennis Benzinger
          Hello! ... If you create the new tab and lcd to another directory the current directory is set for the initial window on that tab. New windows opened on this
          Message 4 of 6 , May 31, 2011
            Hello!

            Am 01.06.2011 08:23, schrieb Martin Lundberg:
            > On Tuesday, May 31, 2011 2:55:40 PM UTC+2, Christian Brabandt wrote:
            >>
            >> :h :lcd
            >>
            >> regards,
            >> Christian
            >>
            > Hi Christian. To my understanding that is not what I'm talking about. The
            > :lcd command changes it for the current window. I'm talking about creating a
            > new tab and changing the working directory using :cd. It changes the cwd for
            > that tab only (you can even see the filenames of the other tabs changing on
            > the tabs). If you then change back to another tab it's cwd has not changed.

            If you create the new tab and lcd to another directory the current
            directory is set for the initial window on that tab. New windows opened
            on this tab (e.g. via split or enew) then inherit the current directory
            from the initial window.


            Regards,
            Dennis Benzinger

            --
            You received this message from the "vim_use" maillist.
            Do not top-post! Type your reply below the text you are replying to.
            For more information, visit http://www.vim.org/maillist.php
          • Gary Johnson
            ... There are two commands that change the working directory: :cd, which is global, and :lcd, which is window-local. There is no change-directory command
            Message 5 of 6 , Jun 1, 2011
              On 2011-05-31, Martin Lundberg wrote:
              > On Tuesday, May 31, 2011 2:55:40 PM UTC+2, Christian Brabandt wrote:
              >
              >
              > :h :lcd
              >
              > regards,
              > Christian
              >
              > Hi Christian. To my understanding that is not what I'm talking about. The :lcd
              > command changes it for the current window. I'm talking about creating a new tab
              > and changing the working directory using :cd. It changes the cwd for that tab
              > only (you can even see the filenames of the other tabs changing on the tabs).
              > If you then change back to another tab it's cwd has not changed.

              There are two commands that change the working directory: :cd,
              which is global, and :lcd, which is window-local. There is no
              change-directory command whose scope is a tab.

              That said, you could use the TabEnter autocommand event and a
              tab-local variable to :cd to the working directory you define for
              each tab. That is, in each tab you could execute

              :let t:wd = "some/directory"

              and in your ~/.vimrc you could have an autocommand something like
              this:

              au TabEnter * if exists("t:wd") | exe "cd" t:wd | endif

              See

              :help TabEnter
              :help t:var

              Regards,
              Gary

              --
              You received this message from the "vim_use" maillist.
              Do not top-post! Type your reply below the text you are replying to.
              For more information, visit http://www.vim.org/maillist.php
            • Martin Lundberg
              Weird. I was 100% it did work yesteday when I was discussing this in the #vim irc channel. However now it works just as all of you ve said. :) -- You received
              Message 6 of 6 , Jun 1, 2011
                Weird. I was 100% it did work yesteday when I was discussing this in the #vim irc channel. However now it works just as all of you've said. :) 

                --
                You received this message from the "vim_use" maillist.
                Do not top-post! Type your reply below the text you are replying to.
                For more information, visit http://www.vim.org/maillist.php
              Your message has been successfully submitted and would be delivered to recipients shortly.