Newbie Upgrading on Mac

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Newbie Upgrading on Mac

Jason Van Anden
Hi,

New to Mac so please forgive my ignorance but ... I would like to
update Vim 6.2 to 6.3 - and have it run from terminal by simply typing
 >vim readme.txt.  I downloaded 6.3 and can call it with its full path -
how do I change the path statement to call it instead of 6.2?

Thank You,
J

Reply | Threaded
Open this post in threaded view
|

Re: Newbie Upgrading on Mac

Stephen Riehm
Hi Jason,

On 3 Jun 2005, at 20:15, Jason Van Anden wrote:

> I would like to update Vim 6.2 to 6.3 - and have it run from  
> terminal by simply typing >vim readme.txt.  I downloaded 6.3 and  
> can call it with its full path - how do I change the path statement  
> to call it instead of 6.2?

you could add /Applications/Vim.app/Contents/MacOS/ to your path, but  
then you would also have to type Vim (instead of vim - see the shift  
key?) on the command line for it to work.

For that reason I've simply set up an alias. You've got to do this  
differently depending on the shell you're using.
If you're using tcsh, add this line to your .tcshrc file (in your  
home directory):

     alias vim /Applications/Vim.app/Contents/MacOS/Vim
     alias gvim /Applications/Vim.app/Contents/MacOS/Vim -g

For the bash users, add this to your .bashrc file:

     alias vim=/Applications/Vim.app/Contents/MacOS/Vim
     alias gvim="/Applications/Vim.app/Contents/MacOS/Vim -g"

enjoy,

Steve

Reply | Threaded
Open this post in threaded view
|

Re: Newbie Upgrading on Mac

Chris Devers
In reply to this post by Jason Van Anden
On Fri, 3 Jun 2005, Jason Van Anden wrote:

> - how do I change the path statement to call [new Vim] instead of 6.2?

Edit the $PATH variable in your login scripts.

If you're using the Bash shell, you should have a ~/.bashrc file; if
not, create one. There needs to be a PATH declaration something like:

    export PATH=~/bin:/usr/local/bin:$PATH

In this example, I'm prepending my personal ~/bin directory at the front
of my $PATH, then /usr/local/bin (which is where a custom-installed Vim
would probably end up for me), then the rest of the $PATH variable as it
already existed before this line was executed. You'll usually already
have at least something for $PATH -- use

    $ echo $PATH

on the command line to examine it -- so this just adds what I want to
what was already there.

So. Edit ~/.bashrc, then start a new shell. You should have the new
value for $PATH, but if you don't, ~/.bashrc may not be getting run at
shell launch time. If a

    $ source ~/.bashrc

gets the result you want, then this is the case, and you need to turn on
running ~/.bashrc at shell start time by adding

    source ~/.bashrc

to your ~/.bash_profile (or just ~/.profile) as well. (Yes, there are
too many weird quirks about this, but nevermind.)



If you're using the tcsh shell, the outline is the same as above, but
you'll need to add something like

    setenv path = ( ~/bin /usr/local/bin $path )

to your ~/.tcshrc or ~/.cshrc file.


Make sense?



--
Chris Devers