闻心阁

一蓑烟雨看苍生,半壶浊酒笑红尘

Copy the Command Output of Vim

2016-08-06 约 1 分钟读完 搬砖秘籍

When we excute the system command in the Vim(via :!command), sometimes we want to copy the output content, but it’s difficult.

Copy it!

In the Vim, you can copy it by this function redir, just like this:

:redir @* | (Vim Command) | redir END

And then the output is in the clipboard, just use it as you want.