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

mvim from the command line

Expand Messages
  • Lewis@Gmail
    I ve been using MacVim for about a week now and am starting to get used to it, but there s a couple of things that are frustrating me. One, is when I ssh into
    Message 1 of 3 , Feb 23, 2010
    • 0 Attachment
      I've been using MacVim for about a week now and am starting to get
      used to it, but there's a couple of things that are frustrating me.

      One, is when I ssh into my machine, I am expecting that mvim will
      behave basically like vim, and let me edit a file from my ssh session.
      Instead, it's opening the file in the GUI.

      Also, and this may be off topic, I have the following function in
      my .bashrc (adapted from this month's MacTech)

      function vi() { ${HOME}/Applications/MacVim/mvim ${@}: }

      However, when I try to edit a file with spaces in the path I get:

      $ vi Documents/Sing\ that\ iTune\!/Aqua/Barbie\ Girl.txt
      4 files to edit

      and instead of getting the actual file, I get "Documents/Sing" "that"
      "iTune\!/Aqua/Barbie" and "Girl.txt"

      And I get them in the GUI only, not in the ssh session I have open to
      that machine.

      Even in quotes, and escaped:

      $ vi "Documents/Sing\ that\ iTune\!/Aqua/Barbie\ Girl.txt"
      4 files to edit


      --
      You received this message from the "vim_mac" maillist.
      For more information, visit http://www.vim.org/maillist.php
    • Edward Marczak
      ... Darn it....I m the author of that article, and as soon as I saw it in print *here*, I immediately said, that should be quoted! So, in short, it should be
      Message 2 of 3 , Feb 23, 2010
      • 0 Attachment
        On Tue, Feb 23, 2010 at 5:32 AM, Lewis@Gmail <gkreme@...> wrote:

        > Also, and this may be off topic, I have the following function in
        > my .bashrc (adapted from this month's MacTech)
        >
        > function vi() { ${HOME}/Applications/MacVim/mvim ${@}: }

        Darn it....I'm the author of that article, and as soon as I saw it in
        print *here*, I immediately said, 'that should be quoted!' So, in
        short, it should be this:

        vi() { ${HOME}/Applications/MacVim/mvim "${@}"; }

        Sorry for the confusion.

        <mumble>
        Mac users and their spaces....who puts spaces in a file name
        anyway...stay off my lawn!
        </mumble>


        As far as mvim behavior, I'm going to guess you're running 10.6, which
        unifies the login sessions. Normally, it's really desirable, but can
        mess you up when remotely ssh-ing in. You can detect this in your
        .bash_profile and act accordingly:

        if [[ $DISPLAY != "" ]]; then
        # We are local
        else
        # We are in via ssh
        fi

        Hope that helps.
        --
        Ed Marczak
        e: marczak@...
        w: http://www.radiotope.com/writing

        --
        You received this message from the "vim_mac" maillist.
        For more information, visit http://www.vim.org/maillist.php
      • björn
        ... and ... The gist of it is this: the mvim script calls the Vim binary with the -g flag. If you want to start without a GUI you must not pass this flag.
        Message 3 of 3 , Feb 24, 2010
        • 0 Attachment
          On 23 February 2010 11:32, Lewis@Gmail wrote:
          > I've been using MacVim for about a week now and am starting to get
          > used to it, but there's a couple of things that are frustrating me.
          >
          > One, is when I ssh into my machine, I am expecting that mvim will
          > behave basically like vim, and let me edit a file from my ssh session.
          > Instead, it's opening the file in the GUI.

          You can read all about starting MacVim in the help files:

          :h macvim-start

          and

          :h mvim

          The gist of it is this: the "mvim" script calls the Vim binary with
          the "-g" flag. If you want to start without a GUI you must not pass
          this flag. The help file will tell you how this can be accomplished.

          (The "mvim" script itself isn't clever enough to detect if you call it
          from an ssh session...all it does is locate the MacVim.app bundle.)

          Björn

          --
          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.