Skip to content

Commit f718695

Browse files
feat: Add syntax highlight file for GNU nano (#4560)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent ff492a5 commit f718695

File tree

2 files changed

+54
-0
lines changed

2 files changed

+54
-0
lines changed

grammars/nano/README.md

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Syntax highlighting for GNU nano
2+
3+
This is a syntax highlighting file the [GNU nano](https://nano-editor.org/) text
4+
editor.
5+
6+
## Installation
7+
8+
To install place the `prql.nanorc` file in the `~/.nano/` directory and and
9+
include the following line in your `.nanorc` file.
10+
11+
include "~/.nano/prql.nanorc"
12+
13+
You can append it with this command:
14+
15+
echo 'include "~/.nano/prql.nanorc"' >> ~/.nanorc

grammars/nano/prql.nanorc

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
## Syntax highlighting for PRQL.
2+
3+
syntax python "\.prql$"
4+
magic "PRQL script"
5+
comment "#"
6+
7+
# Types.
8+
color green "\<(int(8|16|32|64|128)?|float(32|64)|bool|text|date|time|timestamp)\>"
9+
10+
# Keywords.
11+
color yellow "\<let|module|prql\>"
12+
13+
# Transforms.
14+
color brightcyan "\<(aggregate|derive|filter|from|group|join|select|sort|take|window)\>"
15+
16+
# Special values.
17+
color brightmagenta "\<(false|null|true|this|that)\>"
18+
19+
# Decorators.
20+
color cyan start="@\{" end="\}"
21+
22+
# Mono-quoted strings.
23+
color brightgreen "[frs]?'([^'\]|\\.)*'|[frs]?"([^"\]|\\.)*"|'''|""""
24+
color normal "'''|""""
25+
# Comments.
26+
color gray "(^|[[:blank:]])#.*"
27+
# Triple-quoted strings.
28+
color brightgreen start="[frs]?'''([^'),]|$)" end="(^|[^(\])'''"
29+
color brightgreen start="[frs]?"""([^"),]|$)" end="(^|[^(\])""""
30+
31+
# Backslash escapes.
32+
color lime "\\($|[\'"bfnrt]|[0-3]?[0-7]?[0-7]|x[[:xdigit:]]{2})"
33+
color lime "\\(N\{[[:alpha:]]+\}|u\{[[:xdigit:]]{1,6}\})"
34+
35+
# Reminders.
36+
color brightwhite,yellow "\<(FIXME|TODO)\>"
37+
38+
# Trailing whitespace.
39+
color ,green "[[:space:]]+$"

0 commit comments

Comments
 (0)