13

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

18

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.

2
  • Note that has('vim)` is 0, even in plain vim.
    – Tom Hale
    Commented Aug 25, 2023 at 5:24
  • :echo has('nvim')
    – joharr
    Commented Apr 13 at 10:03

Your Answer

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

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