我有一个更新缓冲区的vimscript
function! NextTodos()
:let tempfile = "~/AppData/Local/Temp/Journal-VIC777C.tmp"
:exe 'e ' . tempfile
" delete all existing lines, see
" https://alvinalexander.com/linux-unix/vi-vim-delete-all-lines-how
:1,$d
:r ~\workspace\logs\Journal.log
:silent v/-next\|-wait\|-periodic/d
" reverse list, does not work correctly
:g/^/m0
:sort
:execute "normal gg"
" https://stackoverflow.com/a/21277670/1933185
:put =readfile(expand('~\workspace\logs\Journal.log'))[1:19]
" http://learnvimscriptthehardway.stevelosh.com/chapters/29.html
:execute "normal ggdd"
:w
:syn match String "-next"
:syn match Comment "-periodic"
:syn match Special "-wait"
endfunction
(德语翻译:按回车键或输入命令)
首先,当我点击enter时,信息消息将消失,缓冲区将被更新。
我如何才能让它工作,使缓冲区将立即更新,而我不必按回车键?
How do I disable the âPress ENTER or type command to continueâ prompt in Vim?
.
公认的答案是:加上另一个回车,这并不能解决我的问题。我不得不用:沉默。