Skip to content

Commit 4ccdbd2

Browse files
authored
Merge pull request #16 from davidhcefx/vlang
feat(vlang): Add vlang highlighting
2 parents c212af9 + a701102 commit 4ccdbd2

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

v.nanorc

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# The syntax highlight for V
2+
3+
# Author : HARXI
4+
# Version: 1.0.0
5+
# License: MIT
6+
7+
syntax v "\.(v|c.v|.vsh|.vv)$"
8+
9+
# Operators
10+
color brightred "(\+|-|\*|/|%|~|&|(\|)|^|!|<|>|:=|=|\?|\.)"
11+
12+
# Keywords
13+
color bold,pink "\<(as|asm|assert|atomic|break|const|continue|defer|else|enum|false|fn|for|go|goto|if|import|in|interface|is|isreftype|lock|match|module|mut|none|or|pub|return|rlock|select|shared|sizeof|spawn|static|struct|true|type|typeof|union|unsafe|volatile|__global|__offsetof)\>"
14+
15+
# Literals
16+
color rosy "\<([0-9]+|0[oO][0-7]+|0[xX][[:xdigit:]]+)\>"
17+
color rosy "\<[0-9]+\.[0-9]*([eE][+-]?[0-9]+)?\>"
18+
color rosy "\<[0-9]+[eE][+-]?[0-9]+\>"
19+
color rosy "\<[0-9]+\>"
20+
21+
# Types
22+
color bold,pink "\<(bool|string|int|i(8|16|32|64|128)|u(8|16|32|64|128)|rune|f(32|64)|isize|usize|voidptr|any)\>"
23+
24+
# Compile time
25+
color brightblue "\$([a-zA-Z._0-9])+"
26+
27+
# Flags
28+
color brightblue "\#([a-zA-Z._0-9])+"
29+
30+
# Upper case words
31+
color rosy "[A-Z][A-Za-z0-9_]+"
32+
33+
# Compile time constants
34+
color pink "\@([a-zA-Z._0-9])+"
35+
36+
# String and char
37+
color brightyellow ""([^"\]|\\.)*"|'([^'\]|\\.)*'"
38+
color brightgreen "`([^`\]|\\.)*`"
39+
40+
# Comments
41+
color brightblue start="/\*" end="\*/"
42+
color brightblue "(^|[[:blank:]])//.*"

0 commit comments

Comments
 (0)