DAddYE
DAddYE

Reputation: 1729

Clear screen before bang (!)

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 internal 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!

Upvotes: 10

Views: 3948

Answers (3)

Sebastian Dix
Sebastian Dix

Reputation: 25

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!

Upvotes: 1

hammar
hammar

Reputation: 139890

If you don't mind a little extra typing:

:!clear; git status

Upvotes: 12

Zsolt Botykai
Zsolt Botykai

Reputation: 51653

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

Upvotes: 2

Related Questions