bugGNU nano - Bugs: bug #29943, Bash shell syntax highlighting

 
 
Show feedback again

bug #29943: Bash shell syntax highlighting

Submitted by:  None
Submitted on:  Sat 22 May 2010 07:55:58 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: None
Privacy: PublicAssigned to: None
Open/Closed: OpenRelease: None

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Sat 22 May 2010 07:55:58 PM UTC, original submission:

I modified /usr/share/nano/sh.nanorc to better highlight for Bash (IMO)

Here are the changes:

When a variable is within double quotes ("") it gets it's proper red colour, but if it is within single quotes ('') it gets quote colours. Any quotes within a line comment wont get quote colours.

Here's my fixed file.

## Here is an example for Bourne shell scripts.
##
syntax "bash" "\.sh$"
header "^#!./(ba|k|pdk)?sh[-0-9_]"
icolor brightgreen "^[0-9A-Z_]+\(\)"
color green "\<(case|do|done|elif|else|esac|exit|fi|for|function|if|in|local|read|return|select|shift|then|time|until|while)\>"
color green "(\{|\}|\(|\)|\;|\]|\[|`|\\|\$|<|>|!|=|&|\|)"
color green "-[Ldefgruwx]\>"
color green "-(eq|ne|gt|lt|ge|le|s|n|z)\>"
color brightblue "\<(cat|cd|chmod|chown|cp|echo|env|export|grep|install|let|ln|make|mkdir|mv|rm|sed|set|tar|touch|umask|unset)\>"
color brightyellow ""(\\.|[^"])*""
icolor brightred "\$\{?[0-9A-Z_!@#$*?-]+\}?"
color brightyellow "'(\\.|[^'])*'"
color cyan "(^|[[:space:]])#.*$"
color ,green "[[:space:]]+$"

Thanks!
Nick

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Do you think this task is very important?
If so, you can click here to add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.

 

Please enter the title of George Orwell's famous dystopian book (it's a date):

 

 

No Changes Have Been Made to This Item
Show feedback again

Back to the top


Powered by Savane 3.1-cleanup