I have this sort of command in my vim settings which read the output of some external command (here is date
) and then run another external app. My problem is I want to run it without leaving current UI (i.e. not opening another shell and press Enter to continue). I've tried to add <silent>
but it didn't work as expected i.e. it leaves the current UI and I have to press Enter to get back to current document. Here is the map in my vimrc
:
nnoremap <silent> sp :r! date "+\%T"<CR> :!echo $PWD/'%' > /dev/null<CR>
apparently, I also can not do something like nnoremap sp :silent exec "..."
as well or I miss something in the syntax.
nnoremap <silent> sp :silent r! date "+\%T"<CR>:silent !echo $PWD/'%' > /dev/null<CR>
vim -u barevimrc test.txt
in which bare vimrc only has the nnoremap command and pretty default vim, it act differently in the seinse that doesn't throw new UI but kind of freeze without put the time as expected. I think it kinds of waits for second command or something. Have no clue what might be needed.:redraw!<CR>
at the end of your command. It's not as sleek but much better flow than previous. You may write your solution as a post for me to approve if there is no better solution.