Skip to content

Instantly share code, notes, and snippets.

@zanematthew
Created July 28, 2016 14:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zanematthew/ed6364255931a665aaf3c392043458e9 to your computer and use it in GitHub Desktop.
Save zanematthew/ed6364255931a665aaf3c392043458e9 to your computer and use it in GitHub Desktop.
## Sample initialization file for GNU nano
## Please note that you must have configured nano with --enable-nanorc
## for this file to be read! Also note that characters specially
## interpreted by the shell should not be escaped here.
##
## To make sure a value is not enabled, use "unset <option>"
##
## For the options that take parameters, the default value is given.
## Other options are unset by default.
## Use auto-indentation
# set autoindent
## Backup files to filename~
# set backup
## Constantly display the cursor position in the status bar.
# set const
## Use cut to end of line with ^K by default
# set cut
## Set the line length for wrapping text and justifying paragraphs.
## If fill is negative, the line length will be the screen width less
## this number.
##
# set fill -8
## Enable ~/.nano_history for saving and reading search/replace strings.
# set historylog
## Use alternate keypad routines
# set keypad
## Allow multiple file buffers (using ^R inserts into separate buffer).
## You must have configured with --enable-multibuffer or --enable-extra
## for this to work.
##
set multibuffer
## Don't convert files from DOS/Mac format
set noconvert
## Don't follow symlinks when writing files
# set nofollow
## Don't display the help lists at the bottom of the screen
set nohelp
## Don't wrap text at all
set nowrap
## Set operating directory. nano will not read or write files outside
## this directory and its subdirectories. Also, the current directory
## is changed to here, so files are inserted from this dir. A blank
## string means the operating directory feature is turned off.
##
# set operatingdir ""
## Preserve the XON and XOFF keys (^Q and ^S)
# set preserve
## The email-quote string, used to justify email-quoted paragraphs.
## This is an extended regular expression if your system supports them,
## otherwise a literal string. Default:
# set quotestr "^([ ]*[\|>:}#])+"
## if you have regexps, otherwise:
# set quotestr "> "
## You can get old nano quoted-justify behavior via:
# set quotestr "(> )+"
## Do extended regular expression searches by default
# set regexp
## Use smooth scrolling as the default
set smooth
## Use this spelling checker instead of the internal one. This option
## does not properly have a default value.
##
set speller "aspell -c"
## Allow nano to be suspended with ^Z
set suspend
## Use this tab size instead of the default; it must be greater than 0
set tabsize 4
## Save automatically on exit, don't prompt
# set tempfile
## Disallow file modification, why would you want this in an rc file? ;)
# set view
## Color setup
## Format:
## syntax "short description" ["filename regex" ...]
## color foreground,background "regex" ["regex"...]
##
## Legal colors: white, black, red, blue, green, yellow, magenta, cyan.
## You may use the prefix "bright" to mean a stronger color highlight.
##
## To use multi-line regexes use the start="regex" end="regex" format.
##
## If your system supports transparency, not specifying a background
## color will use a transparent color. If you don't want this, be sure
## to set the background color to black or white.
##
# syntax "c-file" "\.(c|h)$"
# color red "\<[A-Z_]{2,}\>"
# color green "\<(float|char|int|void|static|const|struct)\>"
# color brightyellow "\<(if|while|do|else|case|switch)\>"
# color brightcyan "^#( )*(define|include|ifn?def|endif|elif|else|if)"
##
## You will in general want your comments and strings to come last,
## because syntax highlighting rules will be applied in the order they
## are read in.
##
# color brightyellow "<[^= ]*>" ""(\\.|[^\"])*""
##
## This string is VERY resource intensive!!!
# color brightyellow start=""(\\.|[^\"])*\\( | )*$" end="^(\\.|[^\"])*""
##
## And we want to have some nice comment highlighting too
# color brightblue "//.*"
# color brightblue start="/\*" end="\*/"
## Here is a short example for HTML
syntax "HTML" "\.html$"
color blue start="<" end=">"
color red "&[^; ]*;"
## Here is an example for your .nanorc
##
syntax "nanorc" "[\.]*nanorc$"
color white "^ *(set|unset).*$"
color cyan "^ *(set|unset) (autoindent|backup|const|cut|fill|keypad|multibuffer|noconvert|nofollow|nohelp|nowrap|operatingdir|preserve|quotestr|regexp|smooth|speller|suspend|tabsize|tempfile|historylog|view)"
color brightwhite "^ *syntax [^ ]*"
color brightblue "^ *set\>" "^ *unset\>" "^ *syntax\>"
color white "^ *color\>.*"
color yellow "^ *color (bright)?(white|black|red|blue|green|yellow|magenta|cyan)\>"
color magenta "^ *color\>"
color green "^#.*$"
syntax "php" ".*/*.(php|html)$"
color brightwhite "\{|\}|\."
color brightwhite "('[^']*')"
color brightwhite "\"[^\"]*\""
color brightred "(\$([[:alpha:]_]|->)*)"
color magenta "die"
color green "((\$(([[:alpha:]_0-9])+\->)+)[[:alpha:]_0-9]+\()"
color brightyellow "(if|else if|else|elseif|return|case|break|switch|for|foreach|while|define|is_defined|function_exists|add_flag|header|extends)"
color brightyellow "(print|echo|printf|sprintf|require|include|include_once|require_once|print_r)"
color brightyellow "(class|function |public|private|protected)"
color brightyellow "\|\||\?|\?php|!|\||&&|=|;|\(|\)|<|>"
color brightwhite "[[:space:]]+debug|[[:space:]]+echo|\$this\->debug"
color cyan "//.*"
color cyan start="/\*" end="\*/"
## ZendFramework
color brightmagenta "(get_class_methods)"
## WordPress
color red "(get_header|get_footer|get_sidebar|get_template_part|the_title|the_content|the_date|the_excerpt|the_time|the_permalink|the_category|the_tags|get_permalink|edit_post_link)"
## Smarty
syntax "Smarty" ".*/*.(tpl)$"
color yellow "\{[^\}]*\}"
color cyan start="\{\*" end="\*\}"
##Smarty
syntax "Smarty" ".*/*.(tpl2)$"
color yellow "\{\{[^\}]*\}\}"
color cyan start="\{\{\*" end="\*\}\}"
color cyan start="<!--" end="-->"
color magenta start="/\*" end="\*/"
##############################################################################
#
# Syntax highlighting for CSS files
#
# Author: Simon Rupf, simon.rupf(a)int-ag.ch
# License: GPL 2 or later
#
# Version: 2005-02-14
#
##############################################################################
syntax "css" "\.css$"
color brightred "."
color brightyellow start="\{" end="\}"
color brightwhite start=":" end="[;^\{]"
color brightblue ":active|:focus|:hover|:link|:visited|:link|:after|:before|$"
color magenta start="\/\*" end="\\*/"
color green ";|:|\{|\}"
syntax "JavaScript" "\.(js)$"
# Default
color white "^.+$"
# Decimal, cotal and hexadecimal numbers
color yellow "\<[-+]?([1-9][0-9]*|0[0-7]*|0x[0-9a-fA-F]+)([uU][lL]?|[lL][uU]?)?\>"
# Floating point number with at least one digit before decimal point
color yellow "\<[-+]?([0-9]+\.[0-9]*|[0-9]*\.[0-9]+)([EePp][+-]?[0-9]+)?[fFlL]?"
color yellow "\<[-+]?([0-9]+[EePp][+-]?[0-9]+)[fFlL]?"
# Keywords
color green "\<(break|case|catch|continue|default|delete|do|else|finally)\>"
color green "\<(for|function|if|in|instanceof|new|null|return|switch)\>"
color green "\<(switch|this|throw|try|typeof|undefined|var|void|while|with)\>"
# Type specifiers
color red "\<(Array|Boolean|Date|Enumerator|Error|Function|Math)\>"
color red "\<(Number|Object|RegExp|String)\>"
color red "\<(true|false)\>"
# String
color brightyellow "L?\"(\\"|[^"])*\""
color brightyellow "L?'(\'|[^'])*'"
# Escapes
color red "\\[0-7][0-7]?[0-7]?|\\x[0-9a-fA-F]+|\\[bfnrt'"\?\\]"
# Comments
color magenta start="/\*" end="\*/"
color magenta "//.*$"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment