I'm trying to use an autocmd to check for the existence of a certain file when a file is opened. If the file exists, I want to do a vsplit
, and move the vsplit buffer to the right. Something like:
function! CheckForFile()
let file=expand("%:p:h")."/.".expand("%:t").".x"
if filereadable(file)
execute "vs " . file
<C-w>L
endif
endfunction
autocmd BufReadPost * call CheckForFile()
I can't figure out how to do the <C-w>L
part. All I get is syntax errors.
How do I move the buffer in the CheckForFile function?