Skip to content
Jean Guyomarc'h edited this page May 23, 2020 · 1 revision

Detect when Eovim is running

It may be interesting to write Eovim-specific configuration in your init.vim file. When Eovim starts, it sets the variable g:eovim_running to a strictly positive integer, before sourcing init.vim. The code snippet below shows how to use it to enable conditional configuration:

if exists("g:eovim_running")
  " write eovim-specific configuration
endif

Setting manually this variable is undefined behavior.

Autocmd Events

Eovim controls the autocmd group named Eovim. It sends User autocommands with the following flags:

  • EovimReady: called when Eovim's GUI is fully attached to neovim
  • EovimCapsLockOn: called when the CapsLock are enabled
  • EovimCapsLockOff: called when the CapsLock are disabled

To call your code, write something like this in your init.vim file:

function! DoSomething()
  " Write your code here
endfunction

augroup Eovim
   autocmd!
   autocmd User EovimReady call DoSomething()
   autocmd User EovimCapsLockOn call DoSomething()
   autocmd User EovimCapsLockOff call DoSomething()
augroup END
Clone this wiki locally