I would like to introduce a variable containing the regular expression into the yaml file, is it possible?
so that i can use configurations for syntax.
I would like to introduce a variable containing the regular expression into the yaml file, is it possible?
so that i can use configurations for syntax.
Not sure what you mean in this vague context. Can you provide an actual case which you think it should work like?
i have a log file with different interesting contents to which i wish to make it as symbols to quickly jump using ctrl+R.
but i wanted strings to be read from a config file, so that i can make it generic.
‘.(Entering.)\b’
‘.*(\b[a-zA-Z]+::init.Initializing.)\b’
i want more like this be added, but not modifying the yaml file, instead read it from a settings or config file.
my current yaml file as below,
%YAML 1.2
---
# http://www.sublimetext.com/docs/3/syntax.html
name: Logging stubs
file_extensions: [log]
scope: source.log
contexts:
main:
# tuts captured
- match: '.*(Entering.*)\b'
scope: meta.function.text.plain
captures:
1: entity.name.function.text.plain
# tuts captured
- match: '.*(\b[a-zA-Z]+::init.*Initializing.*)\b'
scope: meta.function.text.plain
captures:
1: entity.name.function.text.plain
my tmpreferences file as below,
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>name</key>
<string>Symbol List</string>
<key>scope</key>
<string>markup.bold</string>
<key>settings</key>
<dict>
<key>showInSymbolList</key>
<integer>1</integer>
</dict>
</dict>
</plist>
so you mean i can write directly to the syntax file from the plugin.
if that is the way i think it is cool too…
Your plugin can write to the place like Packages/my_plugin/my_syntax.sublime-syntax
when ST starts or the settings file changed for sure. ST will reload the changed syntax file.
This sounds good enough for my situation. but if i have to deploy in store, will this logic work?
by logic, i mean writing to the file directly inside Packages/my_plugin/my_syntax.sublime-syntax file.