I have function to perform a git diff, after calling git diff I wish to emulate the following keypresses in the terminal window:
Gmove to the end of the file
q<cr>type q to quit the "terminal scrolling mode" then enter
ggreturn to the top of the file
function GitDiff() terminal git diff --word-diff % normal Gaq<Esc>gg endfunction :nmap <leader>t :call GitDiff()<cr>
However the keypresses dont seem to be executed as expected. I wonder if it needs a delay to wait for the terminal command to finish executing?