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

Re: vim from terminal?

Expand Messages
  • Richard Newman
    Here s how. sudo -s # Enter your password. cd /usr/bin mv vim oldvim # Back up the old one. ln -s /Applications/Vim.app/Contents/MacOS/Vim vim exit
    Message 1 of 10 , May 8, 2007
    • 0 Attachment
      Here's how.

      sudo -s # Enter your password.
      cd /usr/bin
      mv vim oldvim # Back up the old one.
      ln -s /Applications/Vim.app/Contents/MacOS/Vim vim
      exit # Leave sudo.

      Just make sure that you don't remove Vim.app from Applications, or
      your console vim will go away!

      Another way to do this is to put /Applications/Vim.app/Contents/
      MacOS/ at the front of your path, and rely on HFS being case-
      insensitive; I can start Vim as vim on my MBP.

      On 5/8/07, jujul <jujulj@...> wrote:
      >
      > Is there any way to replace /usr/bin/vim by the new version to
      > avoid having
      > both 6.2 and 7 in my computer?
      >
      > thanks for the quick reply!
    • Derrek Leute
      This alias is much better as it won t effect or be effected by OS X upgrades. However, I would suggest putting the binary in a new path like darwinports or
      Message 2 of 10 , May 8, 2007
      • 0 Attachment
        This alias is much better as it won't effect or be effected by OS X
        upgrades. However, I would suggest putting the binary in a new path
        like darwinports or fink do. /opt/bin and add that path as the first
        one in your path environment variable. That way you and apple can
        live happily ever after.

        --Derrek

        On May 8, 2007, at 11:42 AM, Jjgod Jiang wrote:

        > I'll suggest simply
        >
        > echo "alias vim=/Applications/Vim.app/Contents/MacOS/Vim" >>
        > ~/.profile
        > source ~/.profile
        >
        > will be Ok.
      • Richard Newman
        ... Won t work if a script invokes /usr/bin/vim, or if your profile isn t loaded (true for some shells in some circumstances), or if you re logged in as a
        Message 3 of 10 , May 8, 2007
        • 0 Attachment
          > I'll suggest simply
          >
          > echo "alias vim=/Applications/Vim.app/Contents/MacOS/Vim" >>
          > ~/.profile
          > source ~/.profile
          >
          > will be Ok.

          Won't work if a script invokes /usr/bin/vim, or if your profile isn't
          loaded (true for some shells in some circumstances), or if you're
          logged in as a different user. But yes, that's the nicest way if
          those things don't affect you.
        • jujul
          Thank you all! ... -- View this message in context: http://www.nabble.com/vim-from-terminal--tf3709941.html#a10379491 Sent from the Vim - Mac mailing list
          Message 4 of 10 , May 8, 2007
          • 0 Attachment
            Thank you all!



            Derrek Leute wrote:
            >
            >
            > This alias is much better as it won't effect or be effected by OS X
            > upgrades. However, I would suggest putting the binary in a new path
            > like darwinports or fink do. /opt/bin and add that path as the first
            > one in your path environment variable. That way you and apple can
            > live happily ever after.
            >
            > --Derrek
            >
            > On May 8, 2007, at 11:42 AM, Jjgod Jiang wrote:
            >
            >> I'll suggest simply
            >>
            >> echo "alias vim=/Applications/Vim.app/Contents/MacOS/Vim" >>
            >> ~/.profile
            >> source ~/.profile
            >>
            >> will be Ok.
            >
            >
            >

            --
            View this message in context: http://www.nabble.com/vim-from-terminal--tf3709941.html#a10379491
            Sent from the Vim - Mac mailing list archive at Nabble.com.
          • Christian Zagrodnick
            ... Scripts etc. usually use $EDITOR or $VISUAL, don t they? So you can export VISUAL=/Applications..... -- Christian Zagrodnick gocept gmbh & co. kg ·
            Message 5 of 10 , May 8, 2007
            • 0 Attachment
              On 08.05.2007, at 17:50, Richard Newman wrote:

              >> I'll suggest simply
              >>
              >> echo "alias vim=/Applications/Vim.app/Contents/MacOS/Vim" >>
              >> ~/.profile
              >> source ~/.profile
              >>
              >> will be Ok.
              >
              > Won't work if a script invokes /usr/bin/vim, or if your profile
              > isn't loaded (true for some shells in some circumstances), or if
              > you're logged in as a different user. But yes, that's the nicest
              > way if those things don't affect you.

              Scripts etc. usually use $EDITOR or $VISUAL, don't they?

              So you can

              export VISUAL=/Applications.....


              --
              Christian Zagrodnick

              gocept gmbh & co. kg · forsterstrasse 29 · 06112 halle/saale
              www.gocept.com · fon. +49 345 12298894 · fax. +49 345 12298891
            Your message has been successfully submitted and would be delivered to recipients shortly.