Search code examples
intellij-ideaideavimautocmd

Autocmd to trigger on Window Select in Ideavim


I am trying to reproduce the tips outlined in this article in IdeaVim. Relative or hybrid line numbers work like a charm, no trouble there.

However, when using with split windows in IntelliJ Idea (opened for example by ) I would like to have the split window that currently does not have focus to display absolute numbers while the focused one uses relative numbers.

To see what I mean scroll to the bottom of the linked article.

The article recommends using the following auto command to achieve this result:

augroup numbertoggle
  autocmd!
  autocmd BufEnter,FocusGained,InsertLeave * set relativenumber
  autocmd BufLeave,FocusLost,InsertEnter   * set norelativenumber
augroup END

However, this does not produce the desired result when switching between split windows in IdeaVim. I assume that this is because the events, such as BufEnter, BufLeave are not triggered.

Is this even possible in IdeaVim? If so, how must the above command be changed Is there a list of event supported in IdeaVim?


Solution

  • autocmd commands are not supported in IdeaVim at the moment and there is no feature request about it. Feel free to create a new feature request for it in the issue tracker: https://youtrack.jetbrains.com/issues/VIM. I would consider splitting it into two issues: the one about autocmd and another one about augroup.