Use Vim as the IDE developed by QT

Source: Internet
Author: User

Reprinted please indicate the link and author huihui1988

 

After using Vim for a while, I like this simple and efficient editor. Just as I was learning QT, I turned Vim into a tool for developing QT. The specific configuration is as follows.

1. syntax highlighting: 1. Enable vimdir/vim72/syntax/CPP. vim and add

SYN keyword cppstatement slot, signal SYN keyword cppaccess slots, signals

2. added the QT type name: SYN keyword ctype activeqt q3accel q3action q3actiongroup has been added too many parameters q3basebucket has q3button q3buttongroup q3cstring q3cache has q3canvas has q3canvasitem has been added too many errors INE has sent too many q3checklistitem q3checktableitem too many items too many queries q3datatable too many q3datetimeedit too many q3dict too q3dns q3dnssocket too many queries q3dragobject too q3editorfactory too many q3filepreview q3fra Me q3ftp q3garray q1_cache %q3gdict %q3glist %%%q%vector q3grid %q3gridview q3groupbox q3hbox %%%%%q3header q3http %%%%%%%%%q3intcache %q3 2017q3lnode q3listbox publish q3listview q3listviewitem publish q3localfs q3mainwindow q3memarray publish q3networkoperation q3networkprotocol publish q3objectdictionary publish q3picture q3pointarray q3polygon1_q3 Popupmenu q3process q3progressbar q3ptrbucket q3ptrbucket q3ptrcollection has been released without any errors q3rangecontrol q3scrollview queries q3serversocket q3shared q3signal limit q3socket q3socketdevice limit q3spinwidget q3sqlcursor limit Q 3. q3sqlform has been released without any restrictions. q3strivec q3strlist has q3strvec has been released without any restrictions. Erator q3vbox too many messages cannot exceed q3valuestack too many q3widgetstack q3wizard too many q1_actfileengine too q1_actitemmodel q1_actlistmodel too qargument qatomic qatomicpointer qbasicatomic too qb Itarray qbitref qbool qbuffer contains too many qcoord qcache qchar qcharref contains too qcoreapplication contains qdatastream qdate qdatetime qdebug qdir qevent qeventloop qfsfileengine contains qfile qfileinfo contains too many qflag qflags cannot contain too many Ument qglobalstatic qhash qhashdata contains too many qhashnode qiodevice too many qinternal too many qlibrary too qline qlinef q1_list too many q1_listnode qlist qlistdata too qlocale qmap qmapdata too many qmetaobject too q1_ype QM Etatypeid qmimedata qmodelindex qmodelindexlist qmultihash qmultimap extends qmutex qmutexlocker qnodebug extends qobject extends qobjectdata qobjectlist qobjectuserdata qpair implements qpluginloader qpoint qpoi NTF qpointer qprocess qqueue qreadlocker limit qrect limit qregexp qresource limit qset limit qsettings qshareddata limit qsize limit qstack qstdwstring qstringlist limit qsystemlocale QTS limit qtextcodec limit Qtextistream qtextostream qtextstream qtextstreamfunction extends qthread qthreadstorage limit qtime limit qtimer limit qtranslator qtypeinfo quintforsize quintfortype qurl quuid limit qvariant limit qvector limit qwaitcondition qwritelocker limit 2 q_int64 q_int8 q_llong q_long q_pid limit q_uint32 limit q_ullong q_ulong limit qdbusconnection limit qdbuserror qdbusinterface qdbusmessage limit qdbusserver limit Torinterface extends qdesignercomponents qdesignercontainerextension extends qdesignercustomwidgetinterface qdesignerdnditeminterface extends qdesignerextrainfoextension qdesignerformeditorinterface extends qdesignerformwindowcursorinterface qdesignerform#winterface extends Ace internal qdesignericoncacheinterface internal component qdesignermetadatabaseinterface qdesignermetadatabaseiteminterface qdesignerobjectinspectorinterface qdesignerpropertyeditorinterface internal component qdesignerwidgetboxinterface qdesignerwidgetda Tabaseiteminterface quota qextensionfactory qextensionmanager qformbuilder quota q1_actitemview quota q1_actprintdialog q1_actproxymodel q1_actscrollarea quota q1_actspinbox quota q1_actundoitem qaccessible qaccessibleapplication quota E) Too many queries every second qaction qactionevent qactiongroup qapplication qbitmap qboxlayout qbrush restart qbuttongroup qcdestyle qcalendarwidget qcheckbox qcleanlooksstyle qclipboard restart qcloseevent qcolor qcolordialog qcolorgroup Qcolormap publish qcommonstyle qcompleter publish qcursor qcursorshape publish qdatetimeedit q1_topservices publish qdial qdialog qdialogbuttonbox qdirmodel qdockwidget publish qdrag qdragenterevent publish qerrormessage qfiledialog alog T too qfocusframe qfont too qfontdatabase qfontdialog qfontinfo too many qframe qgradient qgradientstop too many qgraphicsitem too qgraphicsitemgroup qgraphicslineitem too many queries qgraphicsrectitem too many queries Qgraphicsview qgridlayout qgroupbox qhboxlayout qheaderview qhelpevent qhideevent qhoverevent qicon qicondragevent qiconengine qiconengineplugin qiconset qimage qimageiohandler too Q Imageioplugin your desired qimagewriter qinputcontext when your desired parameter has been created using qintvalidator qitemdelegate when your qitemeditorfactory qitemselection qitemselectionmodel qitemselectionrange qkeyevent qkeysequence qlcdnumber qlabel qlayout when necessary Erator alert qlistview qlistwidget alert qmacmime alert qmainwindow qmatrix qmenu alert qmessagebox alert qmimesource qmotifstyle qmouseevent alert qmovie alert qpaintdevice qpaintengine alert qpainterpath alert qpalette qpen Re-installed into your desired qpixmap qpixmapcache when creating your desired qprintdialog qprintengine qprinter qprogressbar when creating your desired qregion qresizeevent qrgb qrubberband qscrollarea when qsessionmanager qshortcut when creating qsizepolicy qslider Terproxymodel qsound qspaceritem qspinbox qsplashscreen qsplitter limit qstackedlayout qstackedwidget qstandarditem limit qstandarditemmodel qstatusbar limit qstringlistmodel qstyle qstylefactory limit qstyleoption limit qstyle Optionfocusrect qstyleoptionframe implements too qstyleoptiongroupbox qstyleoptionheader implements qstyleoptionprogressbar when too many threads exceed qstyleoptionslider qstyleoptionspinbox qstyleoptiontab implements qstyleoptiont Abv2 too many parameters too many qstyleplugin too qsystemtrayicon qtabbar qtabwidget qtableview qtablewidget too many qtabletevent qtextblock qtextblockformat qtextblockgroup qtextblockuserdata qtextbrowser qtextcharformat qtextcurs Or qtextdocument extends qtextedit qtextformat extends qtextframe qtextframeformat extends qtextlayout extends qtextline extends qtextlistformat extends qtextoption qtexttable extends qtimeedit qtoolbar limit qtoolbox qtoolbutton qtooltip limit Ewidget too many qundocommand too qundostack too many qwmatrix too many qwheelevent qwidget qwidgetaction qwidgetdata too qwidgetlist too many qwindowsmime qwindowsstyle qwindowsxpstyle qworkspace q1_actsocket qftp qhostaddress qhostinfo qhttp too Qnetworkaddre6address qnetworkaddressentry qnetworkinterface qnetworkproxy qtcpserver qtcpsocket qudpsocket qurlinfo restart qglcolormap qglcontext qglformat limit qglwidget limit qmysqlresult limit qpsqlresult qsqlite2driver limit qsql Database qsqldriver too many queries qsqlerror qsqlfield qsqlindex qsqlquery qsqlquerymodel qsqlrecord qsqlrelation limit qsqlresult qsqltablemodel qsvgrenderer qsvgwidget limit qsignalspy limit qtestdata qtestdelayevent Q Testevent qtesteventlist qtesteventloop extends qtestkeyevent qtestmouseevent quiloader qdomattr extends qdomdocument extends qdomdocumenttype qdomelement extends qdomnode extends qdomtext qxmlattributes extends Dler qxmldeclhandler extends qxmlentityresolver extends qxmlinputsource qxmllexicalhandler qxmllocator extends qxmlparseexception qxmlreader qxmlsimplereader 2. Smart completion 1. Installing omnicppcomplete from http://www.vim.org/scripts/script.php? Download omnicppcomplete from script_id = 1520 and decompress it to the vim installation directory (vimfiles in the window). 2. Install ctags and templates. Ctags-r -- C ++-kinds = + p -- fields = + IAS -- extra = + q Then, the tags files are generated in the two directories respectively. Edit _ vimrc and add Set nocp

Filetype plugin indent on Set tags + = qtdir/include/tags Set tags + = dqtdir/src/tags3, set the tab Automatic completion, http://www.vim.org/scripts/script.php? Script_id = 1643, copy supertab. Vim to the plugin directory, and add Set completeopt = longest, menu Let G: supertabretaincompletiontype = 2 Let G: supertabdefacomplecompletiontype = "<C-X> <C-O>"
For more information, see: http://easwy.com/blog/archives/advanced-vim-skills-omin-complete/
Syntax highlighting: Syntax enable

3. Use Vim in Windows to edit and compile QT and create a new text file named qt_vim.bat. Find qtenv In the QT directory. bat. modify the content as follows for your reference.

@ Echo off <br/> REM this file is generated <br/> REM <br/> echo setting up a mingw/Qt only environment... <br/> echo -- qtdir set to D:/QT/4.6.0/QT <br/> echo -- path set to D: /QT/4.6.0/QT/bin <br/> echo -- adding D: /QT/4.6.0/bin to path <br/> echo -- adding % SystemRoot %/system32 to path <br/> echo -- qmakespec set to win32-g ++ <br/> set qtdir = D: /QT/4.6.0/QT <br/> set Path = D:/QT/4.6.0/QT/bin <br/> set Path = % PATH %; D: /QT/4.6.0/bin; D:/QT/4.6.0/mingw/bin; D: /program files/Vim/vim72 // remember to add the vim path <br/> set Path = % PATH %; % SystemRoot %/system32 <br/> set qmakespec = win32-g ++ <br/> Cd "F: /code/Qt "// enter the working directory <br/> Start" "gvim-O2" F: /code/Qt "// set the QT working directory <br/> exit // exit CMD and keep the gvim windowFinally, run ctags-r -- C ++-kinds = + p -- fields = + IAS -- extra = + q in the project directory to open a CPP file and perform a test.

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.