Skip to content

VS Code extension enabling ANSI color styling for text documents

License

Notifications You must be signed in to change notification settings

iliazeus/vscode-ansi

Repository files navigation

Visual Studio Marketplace GitHub MIT License Open Issues Closed Issues

ANSI Colors

ANSI Color styling for your text editor.

Basic usage

Select the ANSI Text language mode to highlight text marked up with ANSI escapes. Files with the .ans and .ansi extensions will be highlighted by default.

ANSI Text language mode; Dark Plus theme

Run the ANSI Text: Open Preview command for the prettified read-only preview.

ANSI Text preview; Dark Plus theme

Clicking the preview icon in the editor title will open the preview in a new tab. Alt-click to open in the current tab.

Preview icon

The extension fetches the colors from the current theme and aims to look as good as the built-in terminal.

ANSI Text preview; various themes

Supported ANSI escape codes

Basic colors and formatting:

Basic formatting

8-bit colors:

8-bit colors

24-bit colors:

24-bit colors

Custom file icon

You can add an icon to the ANSI text files by using the vscode-icons extension:

{
  // add this to your settings file
  "vsicons.associations.files": [
    {
      "icon": "text", // or any other icon from vscode-icons
      "extensions": ["ans", "ansi"],
      "format": "svg"
    }
  ]
}