开发者

Clear screen before bang (!)

开发者 https://www.devze.com 2023-03-23 20:42 出处:网络
I would appreciate if some one can figure how to clean screen when I do i.e.: :!git status It always show me the previous output, so if I repeat this task many times can confuse me because I see the

I would appreciate if some one can figure how to clean screen when I do i.e.:

:!git status

It always show me the previous output, so if I repeat this task many times can confuse me because I see the history.

With an external keyboard usually I do :!git status + ctrl+K+enter but for unknown reason on my i开发者_StackOverflow中文版nternal keyboard (macbook pro) didn't do the trick.

There is a best way to do that? Maybe in vimrc.

Thanks guys!


Finally I figure how we can do that with built-in terminal.app. Write :!your command then press CMD + K + ENTER and you see a clean screen!


If you don't mind a little extra typing:

:!clear; git status


What about using an external plugin for git? fugitive is a great one! Some more details and screencasts. It can show git status with :Gstatus (which you can map to some shortcut key...)

HTH


If you don't want to type

:!clear; git status

every time (I didn't) so maybe just a slightly better option is to go to your ~/.vimrc and add

command! -nargs=1 R :!clear && <args>

I chose "R" because I thought of the word "Run". It could be any uppercase letter you want or it could even be "Run". You would use it like"

:R git status

And then when you run it again, it will not show the previous Foo! in the terminal. I would say it is almost as easy to type "!". Just a thought!

0

精彩评论

暂无评论...
验证码 换一张
取 消