Skip to content

Commit d440c05

Browse files
authored
Merge branch 'master' into dot-typescript-javascript
2 parents a672087 + 5ad6a10 commit d440c05

File tree

8 files changed

+118
-9
lines changed

8 files changed

+118
-9
lines changed

Brewfile.nanorc

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Brewfile.nanorc
2+
## Syntax highlighting for Homebrew Brewfiles
3+
## Author: tomkyle (https://github.com/tomkyle)
4+
5+
syntax "Brewfile" "Brewfile$"
6+
7+
## Keywords
8+
icolor red "^(tap)[[:space:]]"
9+
icolor green "^(brew)[[:space:]]"
10+
icolor blue "^(cask)[[:space:]]"
11+
icolor brightblue "^(cask_args)[[:space:]]"
12+
icolor magenta "^(mas)[[:space:]]"
13+
14+
15+
## Brackets & parenthesis
16+
color brightblack "(\(|\)|\[|\]|\{|\})"
17+
18+
19+
## Strings and quotes
20+
color brightyellow ""(\\.|[^"])*"" "'(\\.|[^'])*'"
21+
color yellow "('|\")"
22+
23+
24+
## comments
25+
color brightblack "^#.*"
26+
color white "^##.*"
27+
color cyan "^###.*"
28+

godot.nanorc

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
## Syntax highlighting for Godot.
2+
3+
syntax gdscript "\.gd$"
4+
header ""
5+
magic "Godot script"
6+
comment "#"
7+
8+
# Function definitions.
9+
color brightblue "func [0-9A-Za-z_]+"
10+
# Keywords.
11+
color brightred "\<(and|as|assert|async|await|break|class|continue)\>"
12+
color brightred "\<(func|del|elif|else|except|finally|for|from)\>"
13+
color brightred "\<(global|if|import|in|is|lambda|nonlocal|not|or)\>"
14+
color brightred "\<(pass|raise|return|try|while|with|yield|extends)\>"
15+
16+
color brightcyan "\<(inline|Input|Array|inline)\>"
17+
color brightcyan "\<(exec|print|call)\>"
18+
19+
# Special values.
20+
color brightmagenta "\<(False|None|True)\>"
21+
22+
# Mono-quoted strings.
23+
color brightyellow "'([^'\]|\\.)*'|"([^"\]|\\.)*"|'''|""""
24+
color normal "'''|""""
25+
# Comments.
26+
color brightred "(^|[[:blank:]])#.*"
27+
# variable
28+
color brightgreen "\<(var|export|export_category)\>"
29+
30+
31+
# Backslash escapes.
32+
color lime "\\($|[\'"abfnrtv]|[0-3]?[0-7]?[0-7]|x[[:xdigit:]]{2})"
33+
color lime "\\(N\{[[:alpha:]]+\}|u[[:xdigit:]]{4}|U[[:xdigit:]]{8})"
34+
35+
# Reminders.
36+
color brightwhite,yellow "\<(FIXME|TODO|XXX)\>"
37+
38+
# Trailing whitespace.
39+
color ,green "[[:space:]]+$"

ini.nanorc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
syntax "INI" "\.(ini|desktop|lfl|override|cfg)$" "(mimeapps\.list|pinforc|setup\.cfg)$" "weechat/.+\.conf$"
1+
syntax "INI" "\.(ini|desktop|lfl|override|cfg|npmrc)$" "(mimeapps\.list|pinforc|setup\.cfg)$" "weechat/.+\.conf$"
22
header "^\[[A-Za-z]+\]$"
33

44
color brightcyan "\<(true|false)\>"

install.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ _fetch_sources(){
1818
}
1919

2020
_update_nanorc(){
21-
touch ~/.nanorc
22-
21+
touch $NANORC_FILE
22+
2323
# add all includes from ~/.nano/nanorc if they're not already there
2424
while read -r inc; do
2525
if ! grep -q "$inc" "${NANORC_FILE}"; then
@@ -45,7 +45,7 @@ case "$1" in
4545
esac
4646

4747
_fetch_sources;
48-
if [ $UPDATE_LITE ];
48+
if [ "$UPDATE_LITE" ];
4949
then
5050
_update_nanorc_lite
5151
else

javascript.nanorc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
syntax "JavaScript" "\.(js|ts|javascript|typescript)$"
1+
syntax "JavaScript" "\.(m?js|ts|javascript|typescript)$"
2+
23
comment "//"
34
color blue "\<[-+]?([1-9][0-9]*|0[0-7]*|0x[0-9a-fA-F]+)([uU][lL]?|[lL][uU]?)?\>"
45
color blue "\<[-+]?([0-9]+\.[0-9]*|[0-9]*\.[0-9]+)([EePp][+-]?[0-9]+)?[fFlL]?"

js.nanorc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
### all *js files ( e.g. Firefox user.js, prefs.js )
1+
### all *js and *mjs files ( e.g. Firefox user.js, prefs.js )
22

33
## Old version
44

@@ -12,7 +12,7 @@
1212

1313
## New updated taken from http://wiki.linuxhelp.net/index.php/Nano_Syntax_Highlighting
1414

15-
syntax "JavaScript" "\.(js)$"
15+
syntax "JavaScript" "\.(m?js)$"
1616
header "^#!.*\/(env +)node"
1717
comment "//"
1818

powershell.nanorc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,9 @@ icolor brightcyan "\<(class|enum|function|using|assembly|command|module|namespac
2424
## Types
2525
icolor green "\<(string|char|byte|int|long|bool|decimal|single|double|DateTime|xml|array|hashtable|void)\>"
2626

27-
# TODO: This logic seems a bit off... look into this
2827
## Comments
2928
color cyan start="<#" end="#>"
30-
color cyan "(^|[[:space:]])#[^>].*$"
29+
color cyan "(^|[[:space:]])#[^>]([^#]|#[^>])*$"
3130

3231
## Quoted text
3332
color brightyellow "\"[^\"]*\""

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)