bugGNU nano - Bugs: bug #29943, slightly improve bash shell syntax...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #29943: slightly improve bash shell syntax highlighting

Submitter:  None
Submitted:  Sat 22 May 2010 07:55:58 PM UTC
   
 
Severity:  3 - Normal Status:  Fixed
Assigned to:  bens Open/Closed:  Closed

Sun 23 Feb 2014 04:17:21 PM UTC, comment #1: 

Agreed.  Colouring "" strings before variables, and those before '' strings, and all those before comments is a nicer order.  It's in SVN now.  Thanks.

Benno Schulenberg <bens>
Group administrator
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.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by bens (Posted a comment)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2014-02-23 bens StatusNone Fixed
        Assigned toNone bens
        Open/ClosedOpen Closed
        SummaryBash shell syntax highlighting slightly improve bash shell syntax highlighting

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code