2

I'm currently attempting to create a basic screen layout for gvim that shows up every time it opens. I'm also attempting to open buffers in a certain window. Because of the GUI init timing I'm forced to open the buffers with autocmd.

So my _gvimrc looks like this:

winpos 4 2
set co = 200
set lines = 50
autocmd GUIEnter * vsplit
autocmd GUIEnter * wincmd b
autocmd GUIEnter * split
autocmd GUIEnter * edit /users/user/_gvimrc

The problem is when I do this the gvimrc loses it's highlighting. So I tried VimEnter but that doesn't work either. Perhaps it's loading before the syntax files are sourced but I've no clue how to fix that.

Amaron
  • 163

1 Answers1

2

The problem is that syntax highlighting is executed as an autocommand and autocommands do not nest by default. The solution is to change that last autocommand to

autocmd GUIEnter * nested edit /users/user/_gvimrc

See

:help autocmd-nested
garyjohn
  • 36,494