help-nano
[Top][All Lists]
Advanced

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

[Help-nano] C language color syntax highlighting


From: Geremy F.
Subject: [Help-nano] C language color syntax highlighting
Date: Tue, 06 Jan 2004 14:59:03 -0500

Hello!

I just discovered nano today.  My nano is the following version:

GNU nano version 1.2.2 (compiled 22:34:11, Sep  5 2003)
Email: address@hidden    Web: http://www.nano-editor.org/
Compiled options: --enable-extra --enable-color --enable-multibuffer --enable-nanorc

Anyway, I have downloaded the nanorc.sample file and uncommented the C color syntax highlighting sections.

All of the 'color' statements work EXCEPT for the following (cut'n'paste from the nanorc.sample file):
color red "\<[A-Z_]{2,}\>"
color green "\<(float|char|int|void|static|const|struct)\>"
color brightyellow "\<(if|while|do|else|case|switch)\>"

I have switched around the colors to make sure that all the colors can be displayed on my terminal setup.

If I change the second and third line to:
color green "(float|char|int|void|static|const|struct)"
color brightyellow "(if|while|do|else|case|switch)"

It works somewhat, but if those character strings are present inside a larger word they will be highlighted, which is obviously not desired behavior.

Basically I need to fix the two regexp expression to find the C keywords, and I need a better expression to find operator symbols (+,-,=,&,%,!,|,~,.) etc.

Thanks!

I'd


---
-Geremy-->

_________________________________________________________________
Have fun customizing MSN Messenger — learn how here! http://www.msnmessenger-download.com/tracking/reach_customize





reply via email to

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