MacVim command window text coloring help (Rspec output)

I am trying to upgrade to MacVim for ruby ​​dev. One of the hangs that I have quickly runs the specs and easily gets the results (passes / failures).

When I run :Rake (or :!rspec % ), it runs the specifications in the current file. The result is displayed in the command window.

If I run this in a regular terminal, I get color output. That is, the dots are green, and the errors are red.

In MacVim, I get these weird [32m and [0m tokens. Here is an example: enter image description here

Any ideas on how to fix this?

+8
ruby vim macvim rspec
source share
2 answers

Use vim-rspec . This will give you a clean, beautifully designed rspec output that you after:

rspec output in MacVim

By the way, these are ANSI escape sequences that ruined the output. See here for the question I asked a few weeks ago about getting rid of them when viewing ri's documentation in (Mac | g) vim. Bottom line: it’s easier to try to get simple text output than to try and support Shoehorn support for ANSI escape sequences in Vim.

+2
source share

Gvim (and I assume that Macvim is just a brand :)) does not have a real terminal behind it, so why do you get these β€œstrange” tokens - these are the evacuation codes of the real terminal that will be interpreted as colors.

As Michael Michael notes, getting vim like ANSI escape codes is boring. Also, I like his vim-rspec suggestion. I exhausted this ( https://github.com/dahu/VimTestRunner ) together as an rspec lightweight tester. It shows a red / green bar in your Vim status bar when you run the tests. You can only run rspec associated with the current file using <leader>y or all rspecs in the current directory with <leader>a . Feedback and suggestions for improvement are welcome. Oh, and that's pretty alpha at this point. Be gentle .:-)

+3
source share

All Articles