reading a 'tree -o' output file

23 views
Skip to first unread message

Kennedy, Marcus A.

unread,
Oct 2, 2019, 5:07:26 PM10/2/19
to vim...@googlegroups.com

All,

I have made two files using the following two commands:

tree somedir > somedir-black_and_white.txt
tree -o somedir-color_linux_xterm.txt somedir

The first file is just a flat normal text file. The second, it turns out, has color coding
embedded in the file. Is there a way to make vim hide these color codes and change the
color of the text on the fly?

If there is already a syntax file for this, please let me know what filetype I should set to.

If not, and no 5minute process to make it happen, that's okay too. I don't need it, it was
a nice to have.

Thanks,
Andy

Adrian Petrescu

unread,
Oct 11, 2019, 9:32:52 AM10/11/19
to vim...@googlegroups.com
Those color codes are called ANSI escape sequences; there's a plugin
that will interpret them:
https://www.vim.org/scripts/script.php?script_id=302

Hope that helps :)

--
Adrian
Reply all
Reply to author
Forward
0 new messages