Copy the Command Output of Vim

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.