如何在 wall 命令显示消息后重新绘制终端窗口

如何在 wall 命令显示消息后重新绘制终端窗口

我有一个脚本,wall当电池电量低于一定百分比时,它会向所有打开的终端会话发送通知,并且会每分钟持续发送一次,直到电源插入。

有时我工作时vim无法看到我当前处于什么模式或我是否已经写入文件,这有点烦人。那么有没有比:wq重新打开文件更好的方法呢?

答案1

Ctrl+L:redraw!将清除并重新绘制屏幕:

                                                        CTRL-L
CTRL-L                  Clear and redraw the screen.  The redraw may happen
                        later, after processing typeahead.

                                                        :redr :redraw
:redr[aw][!]            Redraw the screen right now.  When ! is included it is
                        cleared first.
                        Useful to update the screen halfway executing a script
                        or function.  Also when halfway a mapping and
                        'lazyredraw' is set.

相关内容