转换记事本++ vim 语法高亮文件(或者有人有 aq/kdb+ vim 语法高亮文件吗?)
我有一个 q/kdb+ 语言的语法突出显示文件,我想将其转换为 vim 兼容文件,这样我的 q 代码就不会看起来比平常更难看。
是否有实用程序可自动将 notepad++ xml 语法突出显示文件转换为 vi 版本?我环顾四周,但没有发现任何东西。
或者有人有 vim q 语法高亮文件吗?
I have a syntax highlighting file for the q/kdb+ language and I'd like to convert it to a vim compatible file so my q code won't look any more ugly than usual.
Are there utilities available to automatically convert notepad++ xml syntax highlighting files to vi versions? I had a look around but I couldn't find anything.
Alternatively does anyone have a vim q syntax highlighting file?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
aq/kdb+ vim 语法高亮文件:
https://github.com/simongarland/vim
a q/kdb+ vim syntax highlight files:
https://github.com/simongarland/vim
这两个问题的答案都是“否”(我不知道有任何转换器,也没有 aq 语法高亮文件),但是 Notepad++ 语法高亮 XML 格式看起来非常简单。我手头没有“Q”一本书,但我查看了 网站 并且翻译看起来非常简单。在这种情况下,您可以使用以下命令完成大部分工作:
这会生成许多看起来像这样的行:
您必须调整语法类(本例中为 Words1),使其成为在 Vim 中突出显示的内容(或 syn-将其链接到将在 Vim 中突出显示的内容)。
然后,您可能可以使用正则表达式处理这些符号,但手动处理可能会更容易,因此将:转换
为:(
这是
\<
来标记单词边界,然后是包含所有符号的字符类[..]
)。然后,您只需
在开头添加: 并
在末尾添加: 。
当然,这并不能帮助您完成全部任务,但希望它能为您提供获得所需语法文件所需的大量信息。可以在以下位置找到大量帮助:
并查看运行时文件夹的语法目录中的示例。
祝你好运!
The answer to both questions is no (I don't know of any converters and I don't have a q syntax highlighting file), but the Notepad++ syntax highlighting XML format looks extremely simple. I don't have the 'Q' one to hand, but I had a look at one of the ones from the website and the translation looks pretty trivial. In that case, you could do most of the work with:
This generates lots of lines that look like:
You'll have to tweak the syntax class (Words1 in this case) to be something that will be highlighted in Vim (or syn-link it to something that will be highlighted in Vim).
You could probably then deal with the symbols with a regexp, but it might be easier to just do them by hand, so convert:
into:
(this is
\<
to mark a word boundary, followed by a character class[..]
with all the symbols in it).You would then just need to add:
at the start and:
at the end.
Of course, this doesn't get you all the way, but hopefully it will give you a lot of what you need to get the syntax file that you want. There is plenty of help available in:
and by looking at the examples in the syntax directory of the runtime folder.
Good luck!