In my vimrc I have a key mapping for switching buffers that also automatically resizes the splits by calling a function:
nnoremap <silent> <M-h> <c-w>h:call Splitresize()<CR>
I also would like to automatically switch to insert mode when entering a terminal buffer, so I wrote:
autocmd BufEnter term:* startinsert
The problem is that when use
<M-h> to change to a terminal buffer, the autocmd is executed before the function call, so that
:call Splitresize() is printed in my terminal.
Is there a way to ensure that the function is called before the autocmd is executed?