2

The other day I was doing some web development work in Netbeans 7 like I had been doing for months. I was working on, at most, two or three files...real light-weight work. It gets late, I go to bed with the computer running. In the morning I wake up to a lot of the memory on my computer being used up by something. I look at NetBeans, and it's hogging up an insane amount of memory.

It had to go. After hearing the countless 'nerdgasms' about Vim I had to try it out. Although I've only just gotten started with it, and I have a ways to go before I get the kind of customization I am looking for, I am extremely impressed with it. I love how easy it is to move around and edit code. I can only imagine what it will be like when I really feel comfortable with it.

One of the things that I would like to do is upgrade to Vim 7.3. I don't want to use MacVim (I've already tried it), and I don't want to install via MacPorts/HomeBrew/Whatever. I want Vim 7.3 from source.

I've only just entered the world of Unix and having already bricked my computer once I have no desire to do it again. So, I want to make sure I know what I'm doing before I do anything stupid.

I currently have the default version of Vim 7.2. I know what directory this is located in. I can access this by typing vim into a terminal.

I currently have a working version of Vim 7.3 installed in ~/Source Code/vim/ that I can gain access to by typing out the complete path to the Vim binary file.

My question is:

How do I safely change the command vim in a terminal or xterm to point to my new version in ~/Source Code/vim/?

I have a feeling symbolic links are involved, but I know this is getting outside my area of comfort. So far the only thing I've been able to find on Google is the normal "Just do this through MacPorts."

Well, I don't actually learn anything through MacPorts. I don't want to just get a better editor, I want to learn something in the process.

Peter Mortensen
  • 12,090
  • 23
  • 70
  • 90
  • 1
    Just a quick note, you will save yourself a lot of pain by *not* using spaces in directory names. – Greg Hewgill Jul 12 '11 at 05:01
  • @Greg Duly noted. – Charles Sprayberry Jul 12 '11 at 05:01
  • I'm surprised you actually liked it first off! I recall hating it and raging on irc about how the escape key was too far from my fingers to toggle between insert/command mode quickly. Then someone pointed out that I could use ctrl-c and my rage abated fractionally. – sashang Jul 12 '11 at 05:40
  • @sashang I was actually surprised too. This is the first time I've ever went non-gui. But, it's a learning curve and there's virtually nothing I was getting from Netbeans/Eclipse that I can't get from vim. And there's a lot I can get from vim that I can't get from Netbeans/Eclipse. I equate it to making the switch from Windows to Mac. – Charles Sprayberry Jul 12 '11 at 05:45
  • @tjameson Please explain how changing the PATH variable on a Unix system is not on topic on this site. – Daniel Beck Jul 12 '11 at 12:19
  • 1
    [Everything you need to know about $PATH](http://superuser.com/questions/284342/how-do-i-set-path-and-other-environment-variables/284351#284351). – Daniel Beck Jul 12 '11 at 12:20
  • @Charles: Also I'm curious as to why you don't want to use macvim? One thing that won't work with the console vim is copy and paste between GUI applications and the file you're editing. For example if I command-c some text from a web browser and the hit "+p in macvim it pastes the text from register + into the buffer. This won't work in the console vim. – sashang Jul 12 '11 at 12:43
  • @shashang I don't want to use MacVim because if I have the option to use a graphical interface my workflow will continue to go from keyboard to mouse. I want to break myself of this. Also, in my normal terminal, in insert mode, `Cmd+V` will insert text I've copied from another application, I copied your comment in for example. :) – Charles Sprayberry Jul 12 '11 at 13:41

1 Answers1

6

Type this into your terminal:

echo "export PATH=\"~/Source Code/vim:\$PATH\" " >> ~/.profile

This makes bash search ~/Source Code/vim/ for executables before any other directory, so it will find the vim there instead of the vim in /usr/bin/.

user7541
  • 208
  • 1
  • 3