彩色打印的 VIM Unix 命令 [英] VIM Unix commands printed in color

查看:25
本文介绍了彩色打印的 VIM Unix 命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 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 "33[32m Hello World" 
 Hello World

然而,在 VIM 中,输出不是彩色的,而是打印转义码:

However, in VIM the output is not color, and the escape codes are printed:

:!echo -e "33[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.

推荐答案

你不能.但是你可以暂停编辑器并相对较快地降到shell;

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

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆