I want to go further and style more things. For example I will like to style the following:
setting1 = 4
setting2 = 192.168.1.12
etc...
I will like to style everything to the left of the =
blue and everything to the right purple.
The problem is that atom regex engine does not support negative look ahead or positive look ahead. As a result, I have tried using the begin
and end
directives but that still does not work. In other words I have tried:
{
# section reference
'begin': '^\\s*.*?=' # match a line that contains an = sign
'end': '.+$' # continue until the end of the line
'match': '^\\s*[^=]*' #only match everything that is not an equal sign
'name': 'blue' #style it with the blue style
},
So basically, I need it to look like this:
Any ideas?
atom-alignment packageUse ctrl+cmd+a on Mac or ctrl+alt+a to align multiple matches. If you want to align the first match only, call Atom Alignment:Align from the command palette.
Open a file written in the language that you want to specify the colors for in Atom. Put the cursor at the characters in an element that you want to change the color, pressing Ctrl + Alt + Shift + P (Windows …
I came up with this solution: (reules.cson)
'scopeName': 'source.conf'
'name': 'CONF'
'fileTypes': ['CONF']
'patterns': [
{
# equality
'match': '(?x) ^ ([^=;]+) (=) (.+?)\\n'
'captures':
'1' :
'name' : 'blue'
'2' :
'name' : 'yellow'
'3' :
'name' : 'purple'
}
]
You can style every capture differently.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With