QML syntax highlighting in Vim
-
wrote on 20 Jul 2010, 04:42 last edited by
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!
-
wrote on 27 Jul 2010, 14:04 last edited by
Thanks! We will make the syntax highlight here on this forum/qtdevnet work with QML as well.
-
wrote on 5 Aug 2010, 19:36 last edited by
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.
-
wrote on 6 Aug 2010, 09:50 last edited by
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?
-
wrote on 6 Aug 2010, 10:07 last edited by
If there's no reason to make a separate code tag due to the implementation, I see no reason they can't coexist. QML is just another language, from the perspective of reading code listings. And QML doesn't use the '@' character specially.
-
wrote on 6 Aug 2010, 10:20 last edited by
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?
-
wrote on 6 Aug 2010, 10:30 last edited by
Hum, with caching, minimizing and gz compression I guess it's not a big deal. It would add 34k to the first page load and stay cached in the browser for a year.
-
wrote on 6 Aug 2010, 16:33 last edited by
I'm not sure, but maybe highlighting all the 7832 Qt functions would made code less readable, a bit visually polluted.
-
wrote on 6 Aug 2010, 16:54 last edited by
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.
-
wrote on 6 May 2011, 16:00 last edited by
I was wondering if you have already or were planning on pushing this upstream to the vim team?