Skip to content

Instantly share code, notes, and snippets.

@thejhh
Created August 27, 2011 02:30
Show Gist options
  • Save thejhh/1174871 to your computer and use it in GitHub Desktop.
Save thejhh/1174871 to your computer and use it in GitHub Desktop.
My nano settings

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"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment