@keheliya's answer is correct...but how to install said package?
How to install Package Control, and other packages and plugins, into Sublime Text 3 and 4+
1. Install the Package Control package
To install any other package, you need the Package Control package. Follow the installation instructions here: https://packagecontrol.io/installation
In short:
Open the command palette
Win/Linux: ctrl+shift+p, Mac: cmd+shift+p
Type Install Package Control
, press enter
Or, using the Menu:
- Open the
Tools
menu
- Select
Install Package Control…
2. Use Package Control to install the ANSIescape package:
- Ctrl + Shift + P --> type "install", select "Package Control: Install Package" --> wait a few seconds, and a new search bar will pop up.
- In the new search bar --> search for "ANSIescape" and select it.
- Watch the status bar in the very bottom to see when it's done installing. It should just take a few seconds. Done!
Now, to use it, click the current syntax highlighting text in the very bottom right of your Sublime Text 3 window. Choose "ANSI", as shown below.
You may also choose this from the menus: View --> Syntax --> ANSI.

Alternative, command-line option
Instead of Sublime Text 3, you can also try less -r filename
and less -R filename
, but if your file has mixed color codes it may be easier to look at in Sublime Text 3 anyway. My favorite less
command options are -RFX
, which produce the effect seen in git diff
(and also seen in my thin wrapper program I wrote to show line numbers in git diff
: git diffn
). For example:
less -RFX filename
Description:
-R
to interpret ANSI color codes
-F
to quit immediately if the output takes up less than one-screen, and:
-X
to not clear the screen when less exits!
See:
- How do I prevent 'git diff' from using a pager?
- https://unix.stackexchange.com/questions/38634/is-there-any-way-to-exit-less-without-clearing-the-screen/38638#38638
Other, useful Sublime Text plugins I like:
- "Emmet" plugin to find matching HTML tags: Find closing HTML tag in Sublime Text