Wildcard syntax matching #20
Replies: 1 comment 1 reply
-
|
The third argument of You could use a loop if you need to support many filetypes: You could even query all filetypes that Vim supports instead of supplying a hard-coded list; though this might turn out to be too slow, and maybe the buffer needs to be inspected on actual used markers instead (which also takes time, but only once on buffer loading). The downside of that is newly added filetypes aren't recognized until the buffer is reloaded. Also, typically (for example in GitHub markdown) the syntax names don't correspond 100% to Vim's filetypes, so some sort of mapping is necessary. With all those complications and the fact that most users only ever encounter a handful of filetypes, the manual definition still seems to be the best approach. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to make a pattern which makes any following lines a specific syntax depending on the pattern. A bit like how you can define the syntax of some code in GitHub markdown with
```pythonor```javascript.I can define many lines in my
after/syntaxfile, e.g.but I was wondering if I could do something like regex group capture e.g.
Where
\(\w\+\)captures something likevimand'\1'would get substituted forvim.The vim docs mention "External matches", where you can capture something in
start=and use it inend=. E.g.This means I can start a python block with anything e.g.
<<foobar>>and then I have to end it with@foobar. But the third argument can't accept the wildcard\z1.Beta Was this translation helpful? Give feedback.
All reactions