Vi and Vim Stack Exchange is a question and answer site for people using the vi and Vim families of text editors. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Does neovim set any environment variables that would let me detect from bash that the terminal is neovim? I want to change the behavior of my .bashrc if neovim is the terminal.

share|improve this question
up vote 10 down vote accepted

I compared the output of running env in a standard terminal to the output when running it within Neovim, and it looks like these variables are new:


(The vim I have also has $VIM and $VIMRUNTIME so their mere presence doesn't indicate Neovim vs Vim...)

share|improve this answer

Aside from alxndr's example, you can set one yourself with:

:let $IN_NEOVIM = "yes"
$ env | grep NEOVIM

This is especially useful as a simple way to pass information to the shell; for example:

:let $NEOVIM_FILETYPE = &filetype
$ env | grep NEOVIM
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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