VIM Unix命令以彩色打印 [英] VIM Unix commands printed in color
问题描述
我正在使用MacVim,我想用彩色打印!
命令.例如:
I'm using MacVim and I would like to have !
commands printed in color. For example:
在bash中,以下echo语句将绿色打印出"Hello World"(按预期):
In bash, the following echo statement prints Hello World in green (as expected):
$ echo -e "\033[32m Hello World"
Hello World
但是,在VIM中,输出不是彩色的,并且会打印转义码:
However, in VIM the output is not color, and the escape codes are printed:
:!echo -e "\033[32m Hello World"
[32m Hello World
如何让VIM(尤其是MacVim build 57)打印!
命令的输出并遵守ANSI颜色转义.
How can one have VIM (and MacVim build 57 in particular) print the output of !
commands and honour ANSI color escapes.
推荐答案
您不能.但是您可以暂停编辑器并相对快速地放入外壳;
You can't. But you can suspend the editor and drop to a shell relatively quickly;
或者您可以使用 Ansi Filter
删除转义序列,这样您至少不会看到一团糟.
Or you can use Ansi Filter
to remove the escape sequences so you will at least not see a mess.
这篇关于VIM Unix命令以彩色打印的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!