View previous topic :: View next topic |
Author |
Message |
bensberg n00b
Joined: 09 Mar 2005 Posts: 36
|
Posted: Mon Jun 05, 2006 12:15 pm Post subject: Nano syntax coloring for /etc/portage stuff |
|
|
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 |
|
|
mark_alec Bodhisattva
Joined: 11 Sep 2004 Posts: 6066 Location: Melbourne, Australia
|
Posted: Mon Jun 05, 2006 12:24 pm Post subject: |
|
|
Moved from Other Things Gentoo to Documentation, Tips & Tricks. |
|
Back to top |
|
|
bensberg n00b
Joined: 09 Mar 2005 Posts: 36
|
Posted: Fri Jul 28, 2006 11:12 am Post subject: |
|
|
With some improvements by vapier, this has gone into nano-1.3.12-r1. |
|
Back to top |
|
|
|
|
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
|
|