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

newbie question: environment variables

Expand Messages
  • antics_chap
    [Using Vim 6.0 patches 1-11 13-17 on Mac OS 8.5] I m new to Macs and new to VIM (but have been using vi for years on UNIX). I ve read the helpfiles and the faq
    Message 1 of 2 , Mar 19, 2002
    • 0 Attachment
      [Using Vim 6.0 patches 1-11 13-17 on Mac OS 8.5]

      I'm new to Macs and new to VIM (but have been using vi for years on UNIX).
      I've read the helpfiles and the faq at vim.org/macs.html without success.

      I'd like a quick way of opening files in Vim from the command prompt.
      Perhaps using an environment variable as a path alias from the command
      prompt e.g.
      :e $myfolder/myfile
      would open "Powerbook:Desktop Folder:myfolder:myfile"

      I read that Mac's don't support environment variables, however $VIM seems to
      work - which is why this question is addressed to this forum. If you can
      think of a better way I'm open to suggestions. If this question is answered
      in a FAQ anywhere please point me in that direction and I'm sorry to have
      wasted your time.

      Much obliged.
      Matthew.
      PS. Great product - couldn't work on this Mac without it. Thanks for all the
      hard work.
    • Benji Fisher
      ... Then I can do ... and I could even use command-line completion, ... This might already be in the macvimrc in Axel Kielhorn s distribution. Have a look. HTH
      Message 2 of 2 , Mar 19, 2002
      • 0 Attachment
        On Tuesday, March 19, 2002, at 10:33 AM, antics_chap wrote:

        > [Using Vim 6.0 patches 1-11 13-17 on Mac OS 8.5]
        >
        > I'm new to Macs and new to VIM (but have been using vi for years on
        > UNIX).
        > I've read the helpfiles and the faq at vim.org/macs.html without
        > success.
        >
        > I'd like a quick way of opening files in Vim from the command prompt.
        > Perhaps using an environment variable as a path alias from the command
        > prompt e.g.
        > :e $myfolder/myfile
        > would open "Powerbook:Desktop Folder:myfolder:myfile"
        >
        > I read that Mac's don't support environment variables, however $VIM
        > seems to
        > work - which is why this question is addressed to this forum. If you can
        > think of a better way I'm open to suggestions. If this question is
        > answered
        > in a FAQ anywhere please point me in that direction and I'm sorry to
        > have
        > wasted your time.
        >
        > Much obliged.
        > Matthew.
        > PS. Great product - couldn't work on this Mac without it. Thanks for
        > all the
        > hard work.

        I think what I did before switching to OS X was something like this:

        :let HOME = "Powerbook:Desktop Folder:myfolder"
        :command! -nargs=1 -complete=var CD execute "cd" <args>

        Then I can do

        :CD HOME

        and I could even use command-line completion,

        :CD H<Tab>

        This might already be in the macvimrc in Axel Kielhorn's distribution.
        Have a look.

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