I have found how to silently execute a command with :silent
, but I actually would like to echo the command being executed, without getting into this "hit-enter" prompt. How to do it?
My example is a function for synctex forward search, put into my vimrc:
function! SyncTexForward()
" use file path relative to current directory
let execstr = "silent !zathura --synctex-forward ".line(".").":".col(".").":".@%." ".fnamemodify(@%, ":r") . ".pdf &"
exec execstr
endfunction
Without silent
, it would display the command + its output, that is one line with the pid, like this:
:!zathura --synctex-forward 612:1:myfile.tex myfile.pdf &
[1] 4648
Press ENTER or type command to continue
I tried temporarily changing &cmdheight
to 2, but it has the same effect as silent
(no echo at all)