liuchengxu / vista.vim

:cactus: Viewer & Finder for LSP symbols and tags
https://liuchengxu.github.io/vista.vim
MIT License
1.88k stars 89 forks source link

Auto open vista and keep the focus with autocmd #441

Open Wombozo opened 1 year ago

Wombozo commented 1 year ago

Is it possible to open vista with autocmd, but without losing the focus ? The two commands :Vista followed by :Vista focus work great but not inside autocmd...

augroup VistaAutoOpen
      autocmd!
      autocmd BufRead *.c,*.h  Vista | Vista focus
augroup end

Expected behavior Vista automatically opens when opening .c and .h files, and then focus back to the source file.

Actual behavior The focus remains on the side window.