I’m still using neocomplecache.vim, so I wanted to migrate to neocomplete.vim soon. After some research, I found that it requires vim with lua support. This example also includes python support.
I could have used a package manager, but since I had never compiled vim from source before, I decided to give it a try.
$ brew install mercurial
$ mkdir /usr/local/vim-7.4
$ cd /usr/local/src
$ hg clone https://vim.googlecode.com/hg/ vim
$ cd vim/src
$ ./configure --enable-luainterp=yes \
--with-lua-prefix=/usr/local/Cellar/lua/5.1.5 \
--enable-pythoninterp=yes \
--with-python-config-dir=/usr/lib/python2.7/config \
--prefix=/usr/local/vim-7.4
$ make
$ make install
- –with-lua-prefix
- –with-python-config-dir
These options depend on your environment, so be careful. (You can verify correct settings through configure messages and vim –version after make.)
This will install vim to /usr/local/vim-7.4/bin/vim. Just add it to your PATH and you’re done. ( export PATH="/usr/local/vim-7.4/bin:$PATH" )
:lua print("hello")
This command confirms that the lua interpreter is working properly. You can coexist neocomplete and neocomplecache in .vimrc as follows:
if has('lua') && ( (v:version == 703 && has('patch885')) || v:version >= 704)
" neocomplete settings
else
" neocomplcache settings
end