[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-nano] Syntax highlighting in nano

From: Tom Farmer
Subject: [Help-nano] Syntax highlighting in nano
Date: Thu, 25 Mar 2010 18:32:38 -0400


I am trying to get this working on my user account on the school's server.

I followed a few guides that had the values to copy/paste into .nanorc
in my home directory. I've done so, but the only thing that shows up
in nano, is gray 'bolded' words. No text is showing in color. I know
it's not my SSH client (from because color shows in directory
names when I'm logged into the account. I know the file is doing
something because the 'bolded' words don't show up without the file I
put there, and nano complained a few times about line breaks when
starting up (which I've since fixed).

Any ideas how to get the syntax highlighting working? Below is what I
have in my .nanorc file:

syntax "c" "\.(c|C|cc|cpp|cxx|h|H|hh|hpp|hxx)$"
## Preprocessor directives (Anything that begins with #)
color brightblack "#+(.*)"
## General syntax
color brightred "\<[A-Z_][0-9A-Z_]+\>"
color green 
color green "\<(u_?)?int(8|16|32|64|ptr)_t\>"
color green 
color brightyellow "\<(for|if|while|do|else|case|default|switch)\>"
color brightyellow "\<(try|throw|catch|operator|new|delete)\>"
color magenta "\<(goto|continue|break|return|throw)\>"
color brightcyan
color brightmagenta "'([^'\]|(\\["'abfnrtv\\]))'"
"'\\(([0-3]?[0-7]{1,2}))'" "'\\x[0-9A-Fa-f]{1,2}'"
## GCC builtins
color cyan "__attribute__space:*\(\([^)]*\)\)"
## String highlighting.  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=""(\\.|[^"])*\\space:*$" end="^(\\.|[^"])*""
## Comment highlighting
color brightblue "//.*"
color brightblue start="/\*" end="\*/"


reply via email to

[Prev in Thread] Current Thread [Next in Thread]