Skip to content

Instantly share code, notes, and snippets.

@leptos-null
Last active December 19, 2018 23:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leptos-null/fa56e6091d1185e412267df646c1aca4 to your computer and use it in GitHub Desktop.
Save leptos-null/fa56e6091d1185e412267df646c1aca4 to your computer and use it in GitHub Desktop.
Protobuf syntax highlighting for nano
## Protobuf syntax highlighting for nano by Leptos
## Based off creekpld's Swift syntax highlighter
syntax "Protobuf" "\.proto$"
# Default
color white ".+"
# Keywords
color yellow "^ *\<(syntax|package|import|option)\>"
color magenta "^ *\<(message|enum)\>"
color cyan "\<(repeated|optional|required)\>"
color magenta "\<(default|packed|deprecated)\>"
# Numbers / Decimal Literal
color brightblue "\<([0-9]+)\>"
# Standard Types
color brightmagenta "\<((u|s)?int(32|64))\>"
color brightmagenta "\<((s)?fixed(32|64))\>"
color brightmagenta "\<(string|float|double|bool|bytes)\>"
color brightmagenta "\<(true|false)\>"
# Text
color red ""[^"]*""
# Comments
color green "//.*"
color green start="/\*" end="\*/"
# Trailing whitespace
color ,green "[[:space:]]+$"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment