12

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?

1 Answer 1

16

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.

1
  • Note that has('vim)` is 0, even in plain vim.
    – Tom Hale
    Aug 25 at 5:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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