Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Nano syntax coloring for /etc/portage stuff
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
bensberg
n00b
n00b


Joined: 09 Mar 2005
Posts: 36

PostPosted: Mon Jun 05, 2006 12:15 pm    Post subject: Nano syntax coloring for /etc/portage stuff Reply with quote

When using vim, the files in /etc/portage have their syntax highlighted, but not when using nano. Adding the following to /etc/nanorc changes this:
Code:
## Highlighting for the files in /etc/portage/.
syntax "/etc/portage" "\.(keywords|mask|unmask|use)$"
# Base text:
color green "^.+$"
# Use flags:
color brightred "[[:space:]]+\+?[a-zA-Z0-9_-]+"
color brightblue "[[:space:]]+-[a-zA-Z0-9_-]+"
# Likely version numbers:
color magenta "-[[:digit:]].*([[:space:]]|$)"
# Accepted arches:
color white "[[:space:]]~?(alpha|amd64|arm|hppa|ia64|mips|ppc|ppc64|sh|sparc|x86)[[:space:]]*$"
# Categories:
color cyan "^.*/"
# Masking regulators:
color brightmagenta "^[[:space:]]*(=|~|<|<=|=<|>|>=|=>)"
# Comments:
color blue "^[[:space:]]*#.*$"

Any improvements are welcome.

[Edit 1: changed order, improved use flag coloring.]
[Edit 2: colored likely version numbers everywhere.]


Last edited by bensberg on Sun Jun 25, 2006 1:12 pm; edited 2 times in total
Back to top
View user's profile Send private message
mark_alec
Bodhisattva
Bodhisattva


Joined: 11 Sep 2004
Posts: 6066
Location: Melbourne, Australia

PostPosted: Mon Jun 05, 2006 12:24 pm    Post subject: Reply with quote

Moved from Other Things Gentoo to Documentation, Tips & Tricks.
Back to top
View user's profile Send private message
bensberg
n00b
n00b


Joined: 09 Mar 2005
Posts: 36

PostPosted: Fri Jul 28, 2006 11:12 am    Post subject: Reply with quote

With some improvements by vapier, this has gone into nano-1.3.12-r1. 8)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum