If you want to run commands as if you had typed keys automatically when you start vim, you'll need to use the normal
command (to run a normal mode command).
:norm[al][!] {commands} *:norm* *:normal*
Execute Normal mode commands {commands}. This makes
it possible to execute Normal mode commands typed on
the command-line. {commands} are executed like they
are typed. For undo all commands are undone together.
Execution stops when an error is encountered.
So you'd need autocmd VimEnter * normal <C-w>l
. However, vim is really dumb about the <C-w>
family of commands. For example this answer of mine. I still don't know why this happens, I just know it's a quirk of vimscript.
Thankfully, there's an easy way around this:
:[count]winc[md] {arg}
Like executing CTRL-W [count] {arg}. Example: >
:wincmd j
< Moves to the window below the current one.
This command is useful when a Normal mode cannot be used (for
the |CursorHold| autocommand event). Or when a Normal mode
command is inconvenient.
The count can also be a window number. Example: >
:exe nr . "wincmd w"
< This goes to window "nr".
So you should be able to do what you want with autocmd VimEnter * wincmd l
. Although this might not do very much, since typically there would only be one split open when you open up vim for the first time.
<C-w>
, you can do it viawincmd
. If you still think it's a good idea to edit the title, feel free and I will accept.