6

I was trying to migrate to neovim from vim. But in the end, there's some plugins which require python3 support and neovim package doesn't build with python3 by default( I'm on ubuntu, install neovim package according to the official documentation on the website ), finally I give up, it just seems complicated.

but now the problem I'm facing that I need to switch back to vim. the major difference is the path to vim directory. in neovim, the path is ~/.config/nvim/, in vim, the path is ~/.vim.

I want to keep the most part of my vimrc unchanged. So I would like to use some conditional statement to judge if the current vim is neovim or regular vim.

Is there anyway to achieve this?

10

Use if has('nvim') to detect if you're running Neovim.

Note that, unlike Vim, Neovim doesn't have the language bindings built in. They're provided by external plugins. You would need to install the Python3 version of the neovim module, as described in :help provider-python.

  • There is a relevant documentation here. Also it says to use if has('nvim') I can't test it right know so I don't know if there is a difference? – statox Aug 3 '16 at 14:33
  • You're right, it should be nvim. Fixed. – jamessan Aug 3 '16 at 14:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.