Tuesday, September 30, 2014

R + VIM + Mac OS (10.10)

So I've decided to move my R work from R studio to the terminal. Apparently the popular choice is Emacs + R and some plugin. However, I am not familiar with Emacs, and decided to find a way to make R work with Vim. Luckily things work out. Here are the steps:

1. We need Vim 7.4. Mac OS comes with Vim 7.3. Download Vim 7.4 source. 
Idea from http://stackoverflow.com/questions/7211820/update-built-in-vim-on-mac-os-x
./configure --prefix=/opt/localmake
make
Now if you are on a Beta version of Mac, there will be an error because compiler doesn't recognize Mac version. Head over to Patch and download Vim-sigalsstack.patch

Copy this file to the vim installation folder. Do patch -p1 < vim-sigalstack.patch
according to this Patch.  

Now do:
make
sudo make install

And add to bash_profile by typing:
echo 'PATH=/opt/local/bin:$PATH' >> ~/.bash_profile
Now the system vim is still there, but we are using our new vim.

2. Follow this guide Vim - R.

Should be good now.


No comments:

Post a Comment