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

Re: MacVim working directory problem

Expand Messages
  • Brian McKee
    ... Hmmm? I didn t follow that part of your comment... -- Hey, it s your computer.... isn t it? -- You received this message from the vim_mac maillist. Do
    Message 1 of 22 , Oct 4, 2010
    • 0 Attachment
      On Sun, Oct 3, 2010 at 8:38 PM, Kyle Lippincott <spectral@...> wrote:
      if the file has siblings, I'll just automatically use %:h/ to get to them

      Hmmm?  I didn't follow that part of your comment...

      --
      Hey, it's your computer.... isn't it?

      --
      You received this message from the "vim_mac" 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
    • björn
      ... I d like to try and avoid introducing more options. What different types of behavior do you want? Currently (after the latest patch) it goes like this
      Message 2 of 22 , Oct 4, 2010
      • 0 Attachment
        On 3 October 2010 16:17, David <ddavis1@...> wrote:
        >
        > I don't think I understand the full scope of this problem. I just know
        > the symptoms. I was wondering if this behavior could be turned into a
        > variable of some kind? Then we could allow different types of behavior
        > in terms of when to set the pwd.

        I'd like to try and avoid introducing more options. What different
        types of behavior do you want?

        Currently (after the latest patch) it goes like this when you open one
        or more files (not using the "mvim" script):

        1. If this causes a new window to appear on screen then the working
        directory is set to the first file that is being opened (they are
        sorted alphabetically because Finder does not "remember" the order in
        which you select them).

        2. Otherwise (i.e. you have gone into the prefs and set MacVim to open
        new files in the "current" window, or you're dragging to a window) the
        current directory is not touched.

        The old behavior was broken because the pwd would change even if you
        had manually gone in and changed it (e.g. via a ":cd .." command).

        If you open files using the "mvim" script the working directory is the
        same as Terminal's working directory.

        If you open a new empty window (e.g. via Cmd+N, or when starting
        MacVim) the working directory will be set to your home directory.


        Björn

        --
        You received this message from the "vim_mac" 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
      • Kyle Lippincott
        Ah, sorry. Normally when coding (the only time I care about the current directory of vim), I ll be working with a tree of files, something like:
        Message 3 of 22 , Oct 4, 2010
        • 0 Attachment
          Ah, sorry.  Normally when coding (the only time I care about the current directory of vim), I'll be working with a tree of files, something like:

          library1/src/foo.cpp
          library1/src/foo.h
          library2/client/rpc_interface.py

          I want to be able to type:
          :e library1/src/foo.cpp     or
          :e library2/client/rpc_interface.py

          However, if I'm already in foo.cpp, I automatically type:
          :e %:h/foo.h 

          So by siblings I meant "files in the same directory as the file I'm currently editing".  I actually do this for subdirectories as well (say there's a 'library1/src/testing' directory, then it's %:h/testing/blah.cpp).  To explain what this is doing, I believe the help topic in vim for the description of these is 'filename-modifiers', and % is the filename of the current buffer.

          On Mon, Oct 4, 2010 at 5:50 AM, Brian McKee <brian.mckee@...> wrote:


          On Sun, Oct 3, 2010 at 8:38 PM, Kyle Lippincott <spectral@...> wrote:
          if the file has siblings, I'll just automatically use %:h/ to get to them

          Hmmm?  I didn't follow that part of your comment...

          --
          Hey, it's your computer.... isn't it?

          --
          You received this message from the "vim_mac" 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

          --
          You received this message from the "vim_mac" 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
        • Brian McKee
          ... Thank you. That s something I wasn t familiar with. Brian -- You received this message from the vim_mac maillist. Do not top-post! Type your reply below
          Message 4 of 22 , Oct 5, 2010
          • 0 Attachment
            On Mon, Oct 4, 2010 at 4:01 PM, Kyle Lippincott <spectral@...> wrote:

            :e %:h/foo.h 
             
             To explain what this is doing, I believe the help topic in vim for the description of these is 'filename-modifiers', and % is the filename of the current buffer.


            Thank you.  That's something I wasn't familiar with.

            Brian

            --
            You received this message from the "vim_mac" 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.