Skip to content

Commit 61d733d

Browse files
authored
Merge pull request #24 from davidhcefx/js-merge
enh(js): Merge the two JS files
2 parents 8cba4b0 + be2a9e3 commit 61d733d

File tree

3 files changed

+22
-37
lines changed

3 files changed

+22
-37
lines changed

javascript.nanorc

Lines changed: 0 additions & 26 deletions
This file was deleted.

js.nanorc

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

33
## Old version
4-
54
#syntax "JavaScript" "(\.|/|)js$"
65
#color green "//.*$" start="\/\*" end="\*\/"
76
#color blue "'(\\.|[^'])*'"
@@ -12,7 +11,7 @@
1211

1312
## New updated taken from http://wiki.linuxhelp.net/index.php/Nano_Syntax_Highlighting
1413

15-
syntax "JavaScript" "\.(m?js)$"
14+
syntax "JavaScript" "\.(m?js|ts|javascript|typescript)$"
1615
header "^#!.*\/(env +)node"
1716
comment "//"
1817

@@ -28,29 +27,42 @@ color yellow "\<[-+]?([0-9]+[EePp][+-]?[0-9]+)[fFlL]?"
2827

2928
## Keywords
3029
color green "\<(break|case|catch|continue|default|delete|do|else|finally)\>"
31-
color green "\<(for|function|if|in|instanceof|new|null|return|switch)\>"
32-
color green "\<(switch|this|throw|try|typeof|undefined|var|void|while|with)\>"
30+
color green "\<(for|function|if|in|instanceof|new|return|switch)\>"
31+
color green "\<(switch|this|throw|try|typeof|var|void|while|with)\>"
3332
color green "\<(import|as|from|export)\>"
3433
color green "\<(const|let|class|extends|of|get|set|await|async|yield)\>"
3534

3635
## Type specifiers
3736
color red "\<(Array|Boolean|Date|Enumerator|Error|Function|Math)\>"
3837
color red "\<(WeakMap|Map|WeakSet|Set|Symbol|Promise)\>"
3938
color red "\<(Number|Object|RegExp|String)\>"
40-
color red "\<(true|false)\>"
39+
color red "\<(true|false|null|undefined|NaN)\>"
40+
41+
## Function names
42+
color cyan "[A-Za-z_][A-Za-z0-9_]*[[:space:]]*[(]|)"
43+
44+
## Operators
45+
#color red "[-+/*=<>!~%?:&|]"
4146

4247
## String
4348
color brightyellow "L?\"(\\"|[^"])*\""
44-
color brightyellow "L?'(\'|[^'])*'"
45-
color brightcyan "L?`(\`|[^`])*`"
49+
color brightyellow "L?'(\\'|[^'])*'"
50+
color brightyellow "L?`(\\`|[^`])*`"
4651
color brightwhite,blue start="\$\{" end="\}"
4752

48-
## Trailing spaces
49-
color ,green "[[:space:]]+$"
53+
## Regex
54+
color magenta "/[^*]([^/]|(\\/))*[^\\]/[gim]*"
5055

5156
## Escapes
52-
color red "\\[0-7][0-7]?[0-7]?|\\x[0-9a-fA-F]+|\\[bfnrt'"\?\\]"
57+
color yellow "\\[0-7][0-7]?[0-7]?|\\x[0-9a-fA-F]+|\\[bfnrt'"`\?\\]"
5358

5459
## Comments
5560
color brightblue start="^\s*/\*" end="\*/"
5661
color brightblue "^\s*//.*$"
62+
63+
## Trailing spaces and mixed whitespaces
64+
color ,green "[[:space:]]+$"
65+
color ,red "( + +| + +)"
66+
67+
## Reminders
68+
color brightwhite,yellow "\<(FIXME|TODO|XXX)\>"

nanorc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ include "~/.nano/ini.nanorc"
5454
include "~/.nano/inputrc.nanorc"
5555
include "~/.nano/jade.nanorc"
5656
include "~/.nano/java.nanorc"
57-
include "~/.nano/javascript.nanorc"
5857
include "~/.nano/jrnl.nanorc"
5958
include "~/.nano/js.nanorc"
6059
include "~/.nano/json.nanorc"

0 commit comments

Comments
 (0)