Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add syntax highlight file for GNU nano #4560

Merged
merged 3 commits into from
Jun 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions grammars/nano/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Syntax highlighting for GNU nano

This is a syntax highlighting file the [GNU nano](https://nano-editor.org/) text
editor.

## Installation

To install place the `prql.nanorc` file in the `~/.nano/` directory and and
include the following line in your `.nanorc` file.

include "~/.nano/prql.nanorc"

You can append it with this command:

echo 'include "~/.nano/prql.nanorc"' >> ~/.nanorc
39 changes: 39 additions & 0 deletions grammars/nano/prql.nanorc
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
## Syntax highlighting for PRQL.

syntax python "\.prql$"
magic "PRQL script"
comment "#"

# Types.
color green "\<(int(8|16|32|64|128)?|float(32|64)|bool|text|date|time|timestamp)\>"

# Keywords.
color yellow "\<let|module|prql\>"

# Transforms.
color brightcyan "\<(aggregate|derive|filter|from|group|join|select|sort|take|window)\>"

# Special values.
color brightmagenta "\<(false|null|true|this|that)\>"

# Decorators.
color cyan start="@\{" end="\}"

# Mono-quoted strings.
color brightgreen "[frs]?'([^'\]|\\.)*'|[frs]?"([^"\]|\\.)*"|'''|""""
color normal "'''|""""
# Comments.
color gray "(^|[[:blank:]])#.*"
# Triple-quoted strings.
color brightgreen start="[frs]?'''([^'),]|$)" end="(^|[^(\])'''"
color brightgreen start="[frs]?"""([^"),]|$)" end="(^|[^(\])""""

# Backslash escapes.
color lime "\\($|[\'"bfnrt]|[0-3]?[0-7]?[0-7]|x[[:xdigit:]]{2})"
color lime "\\(N\{[[:alpha:]]+\}|u\{[[:xdigit:]]{1,6}\})"

# Reminders.
color brightwhite,yellow "\<(FIXME|TODO)\>"

# Trailing whitespace.
color ,green "[[:space:]]+$"
Loading