Problems with Vim and lua?

9.7k Views Asked by At

I installed yadr onto my terminal, but I keep getting the following error when I open Vim:

neocomplete does not work this version of Vim.
It requires "if_lua" enabled Vim(7.3.885 or above).

EDIT:

  • Upgraded Vim to version 7.4.493 but still get the error.
  • Running OS X Yosemite
6

There are 6 best solutions below

5
Kevin Lin On BEST ANSWER

This fixed it:

brew install macvim --with-cscope --with-lua --HEAD
brew uninstall vim
brew install vim --with-lua


If it still doesn't work after running the previous commands:

When you install vim with brew, it probably didn't install it to the "correct" location. Looking at the terminal output during the installation (brew install vim) should tell you this location. For me, brew installed vim here:

/usr/local/Cellar/vim/7.4.712

Whereas when I ran which vim, I got the following result:

$ which vim
/usr/bin/vim

So all you have to do is:

sudo cp /path/to/newly/installed/vim /path/to/old/vim

In my case, I did:

sudo cp /usr/local/Cellar/vim/7.4.712 /usr/bin/vim
1
Paulo Pires On

Actually, in Mac OS X, installing vim with lua support is enough. You just have to be sure that you're running the version you installed.

Run the following command and look for +lua

vim --version

Also check it's the version you compiled.

0
Tushar On

Below steps works fine for me:

  1. brew uninstall macvim
  2. brew uninstall vim
  3. brew install macvim --with-cscope --with-lua --HEAD
  4. brew install luajit
  5. brew install vim --with-luajit ( I have tried brew install vim --with-lua but that did not work out for me)
0
Jerry Liu On
brew update && brew install vim --with-lua 

Create an alias vim pointing to /usr/local/bin/vim (as system vim is still there at /usr/bin/vim). On zsh you can add the following snippet to your .zshrc to create an alias if a brew installed vim is present on the system.

  1. Add /usr/local/bin/vim into $PATH before /usr/bin

  2. Use brew vim if present

    /usr/local/bin/vim --version > /dev/null 2>&1 BREW_VIM_INSTALLED=$? if [ $BREW_VIM_INSTALLED -eq 0 ]; then alias vi="/usr/local/bin/vim" fi
    
0
dan-klasson On

Kevin Lin's answer did not work for me. Using Homebrew and Zsh, this did:

  1. homebrew install vim --with-lua
  2. Putting this in /.zshrc:

    # use brew vim if present /usr/local/bin/vim --version > /dev/null 2>&1 BREW_VIM_INSTALLED=$?
    if [ $BREW_VIM_INSTALLED -eq 0 ]; then
    alias vi="/usr/local/bin/vim" fi

While you are at it, you might want to add --with-clipboard as well.

0
ZeroDeth On

Working Steps:

brew update
brew unlink macvim
brew install macvim --with-cscope --with-lua --HEAD
brew unlink vim
brew uninstall vim
brew install vim --with-lua

Check all version installed location by brew info vim