bat/assets/syntaxes/show-nonprintable.sublime-syntax
sharkdp ecd862d9ff Feature: Highlight non-printable characters
Adds a new `-A`/`--show-all` option (in analogy to GNU Linux `cat`s option) that
highlights non-printable characters like space, tab or newline.

This works in two steps:
- **Preprocessing**: replace space by `•`, replace tab by `├──┤`, replace
newline by `␤`, etc.
- **Highlighting**: Use a newly written Sublime syntax to highlight
these special symbols.

Note: This feature is not technically a drop-in replacement for GNU `cat`s
`--show-all` but it has the same purpose.
2018-11-01 22:00:47 +01:00

26 lines
817 B
YAML

%YAML 1.2
---
# http://www.sublimetext.com/docs/3/syntax.html
name: Highlight non-printables
file_extensions:
- show-nonprintable
scope: whitespace
contexts:
main:
- match: "•"
scope: support.function.show-nonprintable.space
- match: "├─*┤"
scope: constant.character.escape.show-nonprintable.tab
- match: "␤"
scope: keyword.operator.show-nonprintable.newline
- match: "␍"
scope: string.show-nonprintable.carriage-return
- match: "␀"
scope: entity.other.attribute-name.show-nonprintable.null
- match: "␇"
scope: entity.other.attribute-name.show-nonprintable.bell
- match: "␛"
scope: entity.other.attribute-name.show-nonprintable.escape
- match: "␈"
scope: entity.other.attribute-name.show-nonprintable.backspace