QML syntax highlighting in Vim
-
While Qt Quick includes using Qt Creator as the tool for creating complete QML applications, no one is forcing you to use it. For those still using Vim for editing QML, I've made available "the vim syntax highlighting file":http://gitorious.org/qt-qml-demo-playground/qt-qml-demo-playground/blobs/master/qml.vim I've been using. Enjoy!
-
Interesting! I've also made mine. You can find it "here":http://www.cecm.usp.br/~gustavo/arquivos/vim/syntax/qml.vim if you prefer an alternative syntax highlighting file.
There's an indent file for qml too. It's "here":http://www.cecm.usp.br/~gustavo/arquivos/vim/indent/qml.vim. Actually, it's mostly based on a javascript indent file found on vim website.
-
Cheers, we have a feature request logged here: "http://bugreports.qt.nokia.com/browse/QTWEBSITE-53":http://bugreports.qt.nokia.com/browse/QTWEBSITE-53.
My questions is: We're using "@" as the general code tag on devnet, do you guys think we need to add another code tag for js/qml or would they coexist ok with just one?
-
Ok, we'll make a syntax highlighting file that takes care of C++ (with Qt classes), JavaScript and QML whenever it's invoked by a pair of @'s.
Here is another question: Qt has 7832 functions last time I "checked":http://doc.qt.nokia.com/4.7-snapshot/functions.html. Adding them all to the syntax file bloats it quite a bit. How would you rate the value of having those in there?
-
Thanks a bunch for this Alan.
I know we should (as you said at aKademy) use Qt Creator, but for us Vim-addicts, this is a much better solution :)
For me, the function highlighting is not that important, especially if it is not context sensitive. Usually, I just put all Qt and KDE classes along with a few macros (Q_OBJECT, Q_...) and leave the methods out.
Although, if "highlighting" would also mean links from methods to the docs... that could be quite useful.