My nanorc settings.
Save js.nanorc to /opt/nano/js.nanorc etc.
Then use it with:
include "/opt/nano/js.nanorc"
Sample ~/.nanorc is in file nanorc.
| ## JavaScript | |
| ## | |
| syntax "JS" "\.js$" "\.sjs$" | |
| # Reserved Keywords | |
| color yellow "\b(instanceof|typeof|break|do|new|var|case|else|return|void|catch|finally|continue|for|switch|while|this|with|debugger|function|throw|default|if|try|delete|in)\b" | |
| # Future Reserved Words | |
| color brightblue "\b(class|enum|extends|super|import|const|export|implements|let|private|public|yield|static|interface|package|protected)\b" | |
| # Punctuators | |
| color brightyellow "(\{|\}|\(|\)|\[|\]|\.|\;|\,|<|>|<=|===|\!==|>=|==|\!=|\+|\-|\*|\%|\+\+|\-\-|<<|>>|>>>|\&|\||\^|\!|\~|\&\&|\|\||\?|\:|=|\+=|\-=|\*=|\%=|<\=|>>=|>>>=|\&=|\|=|\^=|\/|\/=)" | |
| # Literals | |
| color yellow "\b(null|true|false|undefined)\b" | |
| # Strings | |
| color cyan "\"([^"]*|\\\")*\"" | |
| color cyan "'([^']*|\\')*'" | |
| # Comments | |
| color green "\s*//.*" | |
| color brightgreen start="/\*" end="\*/" | |
| # Mark non breaking space | |
| color yellow,red "Â " |
| set historylog | |
| set nowrap | |
| set suspend | |
| set tabsize 4 | |
| set morespace | |
| set const | |
| set nohelp | |
| set regexp | |
| set smarthome | |
| set smooth | |
| set fill 79 | |
| set wordbounds | |
| ## Here is a short example for HTML. | |
| ## | |
| syntax "html" "\.html$" | |
| color brightblue start="<" end=">" | |
| color red "&[^;[[:space:]]]*;" | |
| include "/opt/nano/js.nanorc" |