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

Re: Mac Questions

Expand Messages
  • Brett Calcott
    Hi Dave, Thanks for that. I have spent about 15 years on Windows and know it well. Now I have the fun of discovering all the hidden bits on Mac. Thanks a lot!
    Message 1 of 9 , Jan 10, 2007
    • 0 Attachment
      Hi Dave,

      Thanks for that. I have spent about 15 years on Windows and know it well.
      Now I have the fun of discovering all the hidden bits on Mac.

      Thanks a lot!
      Brett

      On 1/9/07, Dave Land <land@...> wrote:
      >
      > On Jan 8, 2007, at 3:03 PM, Dave Land wrote:
      >
      > > Happily, Apple provided a utility that handles it for you:
      > >
      > > defaults read "${HOME}/.MacOSX/environment"
      >
      > Actually, making this work in bash (or other shell) requires a little
      > more than just reading the file... Here's the relevant chunk from
      > my .bashrc:
      >
      > # Get environment variables from ~/.MacOSX/environment.plist
      > # (This avoids the sin of duplicating data here and in that file)
      > if [[ `uname` == 'Darwin' ]] ; then
      > defaults read ~/.MacOSX/environment | grep -v '[{}]' | tr '"' "'" |
      > awk '{ print "declare -x",$1"="$3 }' | while read -r OneLine; do eval
      > $OneLine; done;
      > fi
      >
      > To give credit where it's due, this came from a comment on
      > macosxhints.com.
      >
      > The conditional (if [[ `uname` == "Darwin' ]]) is because I use this
      > same .bashrc across several hosts, including Solaris, Linux, and Mac
      > OS X.
      >
      > Dave
      >
      >
    • Niklas Lindström
      Hi! Regarding getting your environment into a gvim session. I use the gvim.app which is used to launch multiple Vim.app:s, but with a modified script. ...
      Message 2 of 9 , Jan 11, 2007
      • 0 Attachment
        Hi!

        Regarding getting your environment into a gvim session.

        I use the gvim.app which is used to launch multiple Vim.app:s, but
        with a modified script.

        I have simply replaced the content of "gvim.app/Contents/Resources/script" with:

        ------------------------------ 8< ------------------------------
        #!/bin/sh

        PROFILE=~/.profile
        if [ -e $PROFILE ]; then source $PROFILE; fi

        VIM_APP_DIR=`echo $0 | sed 's#^\(.*\)gvim.app/Contents/Resources/script$#\1#'`

        ${VIM_APP_DIR}/Vim.app/Contents/MacOS/Vim -go "$@" &
        ------------------------------ >8 ------------------------------

        Which gives me the same env-variables I have in my bash-sessions (and
        also enables gvim.app and related to be put anywhere, not just
        "/Applications").

        Best regards,
        Niklas
      • Benji Fisher
        ... The docs already explain one way to set $PATH. ... As it says there, the system vimrc files in the versions distributed at macvim.org/OSX already use this
        Message 3 of 9 , Feb 1, 2007
        • 0 Attachment
          On Tue, Jan 09, 2007 at 10:23:25AM +0100, Bram Moolenaar wrote:
          >
          > Dave Land wrote:
          >
          > > On Jan 8, 2007, at 3:03 PM, Dave Land wrote:
          > >
          > > > Happily, Apple provided a utility that handles it for you:
          > > >
          > > > defaults read "${HOME}/.MacOSX/environment"
          > >
          > > Actually, making this work in bash (or other shell) requires a little
          > > more than just reading the file... Here's the relevant chunk from
          > > my .bashrc:
          > >
          > > # Get environment variables from ~/.MacOSX/environment.plist
          > > # (This avoids the sin of duplicating data here and in that file)
          > > if [[ `uname` == 'Darwin' ]] ; then
          > > defaults read ~/.MacOSX/environment | grep -v '[{}]' | tr '"' "'" |
          > > awk '{ print "declare -x",$1"="$3 }' | while read -r OneLine; do eval
          > > $OneLine; done;
          > > fi
          > >
          > > To give credit where it's due, this came from a comment on
          > > macosxhints.com.
          > >
          > > The conditional (if [[ `uname` == "Darwin' ]]) is because I use this
          > > same .bashrc across several hosts, including Solaris, Linux, and Mac
          > > OS X.
          >
          > This issue comes up often enough that it deserves a section in the help.
          > Could you perhaps write some text? If you can send me a patch that
          > would be great.

          The docs already explain one way to set $PATH.

          :help mac-faq

          As it says there, the system vimrc files in the versions distributed at
          macvim.org/OSX already use this method. The same method should work for
          other environment variables ... but AFAIK the only one that matters is
          $PATH.

          HTH --Benji Fisher
        Your message has been successfully submitted and would be delivered to recipients shortly.