Reprint please indicate link with author huihui1988
For a period of time vim, like this simple and efficient editor. Coincides with the learning of QT, so vim becomes a tool to develop QT. The following are the specific configurations.
First, syntax highlighting support: 1, open Vimdir/vim72/syntax/cpp.vim, join
syn keyword cppstatement slot,signal
syn keyword cppaccess slots,signals2. Added QT type name: SYN keyword CTYPE ACTIVEQT q3accel q3action q3actiongroup q3asciibucket Q3asciicache Q3asciicacheiterator q3asciidict q3asciidictiterator q3basebucket q3boxlayout q3button Q3ButtonGroup Q3CString Q3Cache Q3cacheiterator Q3canvas q3canvasellipse q3canvasitem q3canvasitemlist q3canvasline Q3CanvasPixmap Q3canvaspixmaparray q3canvaspolygon q3canvaspolygonalitem q3canvasrectangle q3canvasspline Q3CanvasSprite Q3canvastext q3canvasview q3checklistitem q3checktableitem q3cleanuphandler q3colordrag Q3ComboBox Q3ComboTableItem Q3databrowser q3datatable q3dataview q3dateedit q3datetimeedit q3datetimeeditbase Q3DeepCopy Q3Dict Q3DictIterator Q3dns q3dnssocket q3dockarea q3dockarealayout q3dockwindow q3dragobject q3dropsite Q3EditorFactory Q3FileDialog Q3fileiconprovider q3filepreview q3frame q3ftp q3garray q3gcache q3gcacheiterator Q3GDict Q3GDictIterator Q3GList Q3glistiterator q3gliststditerator q3gvector q3grid q3gridlayout q3gridview q3groupbox Q3HBox Q3HBoxLayout Q3HButtonGrOUP Q3hgroupbox q3header q3http q3httpheader q3httprequestheader q3httpresponseheader Q3IconDrag Q3IconDragItem Q3iconview q3iconviewitem q3imagedrag q3intbucket q3intcache q3intcacheiterator q3intdict Q3IntDictIterator Q3LNode Q3listbox q3listboxitem q3listboxpixmap q3listboxtext q3listview q3listviewitem q3listviewitemiterator Q3LocalFs Q3mainwindow q3memarray q3mimesourcefactory q3multilineedit q3networkoperation q3networkprotocol Q3networkprotocoldict q3networkprotocolfactory q3networkprotocolfactorybase q3objectdictionary Q3paintdevicemetrics q3painter q3picture q3pointarray q3polygonscanner q3popupmenu Q3Process Q3ProgressBar Q3progressdialog q3ptrbucket q3ptrcollection q3ptrdict q3ptrdictiterator q3ptrlist Q3PtrListIterator Q3ptrliststditerator q3ptrqueue q3ptrstack q3ptrvector q3rangecontrol q3scrollview Q3Semaphore Q3ServerSocket Q3Shared Q3signal q3simplerichtext q3singlecleanuphandler q3socket q3socketdevice q3sortedlist Q3SpinWidget Q3SqlCursor Q3sqleditorfactory Q3sqlfieldInfo q3sqlfieldinfolist q3sqlform q3sqlpropertymap q3sqlrecordinfo q3sqlselectcursor Q3StoredDrag Q3StrIList Q3StrIVec Q3strlist q3strlistiterator Q3strvec q3stringbucket q3stylesheet q3stylesheetitem Q3SyntaxHighlighter Q3TSFUNC Q3tabdialog q3table q3tableitem q3tableselection q3textbrowser q3textdrag q3textedit Q3TextEditOptimPrivate Q3textstream q3textview q3timeedit q3toolbar q3uridrag q3url q3urloperator q3vbox q3vboxlayout Q3VButtonGroup Q3vgroupbox q3valuelist q3valuelistconstiterator q3valuelistiterator q3valuestack Q3ValueVector Q3WhatsThis Q3widgetstack q3wizard qassistantclient qabstracteventdispatcher qabstractfileengine QAbstractFileEngineHandler Qabstractitemmodel Qabstractlistmodel qabstracttablemodel qargument qatomic qatomicpointer QBasicAtomic Qbasicatomicpointer qbasictimer qbitarray qbitref qbool qbuffer qbytearray qbytearraymatcher QByteRef QCOORD QCache QChar Qcharref qchildevent qconststring qcoreapplication qcustomevent qdatastream qdate QDateTime QDebug QDir QEVent qeventloop qfsfileengine qfactoryinterface QFile qfileinfo qfileinfolist qfileinfolistiterator QFileSystemWatcher Qflag qflags qforeachcontainer qforeachcontainerbase qgenericargument qgenericreturnargument QGlobalStatic QHash Qhashdata qhashdummynode qhashdummyvalue qhashiterator qhashnode qiodevice qintforsize QIntForType QInternal Qlatin1char qlatin1string qlibrary qlibraryinfo qline qlinef qlinkedlist qlinkedlistdata QLinkedListIterator Qlinkedlistnode qlist qlistdata qlistiterator qlocale qmap qmapdata qmapiterator qmetaclassinfo QMetaEnum QMetaMethod QMe Taobject qmetaproperty qmetatype qmetatypeid qmimedata qmodelindex qmodelindexlist QMultiHash QMultiMap Qmutablehashiterator qmutablelinkedlistiterator qmutablelistiterator qmutablemapiterator QMutableSetIterator Qmutablestringlistiterator qmutablevectoriterator Qmutex qmutexlocker qnodebug qnoimplicitboolcast QObject Qobjectcleanuphandler qobjectdata qobjectlist qobjectuserdata qpair qpersistentmodelindex QPluginLoader QPoinT qpointf qpointer qprocess qqueue qreadlocker qreadwritelock qrect qrectf qregexp qresource QReturnArgument QSemaphore QS ET qsetiterator qsettings qshareddata qshareddatapointer qsignalmapper qsize qsizef qsocketnotifier QStack QStdWString QS Tring qstringlist qstringlistiterator qstringmatcher qsysinfo qsystemlocale QTS qtemporaryfile QTextCodec Qtextcodecfactoryinterface qtextcodecplugin qtextdecoder qtextencoder qtextistream QTextOStream QTextStream Qtextstreamfunction qtextstreammanipulator qthread qthreadstorage qthreadstoragedata QTime QTimeLine QTimer Qtimerevent qtranslator qtypeinfo quintforsize quintfortype qurl quuid qvarlengtharray QVariant Qvariantcomparisonhelper qvariantlist qvariantmap qvector qvectordata qvectoriterator QVectorTypedData QWaitCondition Qwritelocker q_int16 q_int32 q_int64 q_int8 q_llong q_long q_pid q_uint16 q_uint32 q_uint64 Q_UINT8 Q_ULLONG Q_ULONG QDBus Abstractadaptor qdbusabstractinterface qdbusargument qdbusconnection qdbusconnectioninterface QDBusError qdbusinterface qdbusmessage qdbusmetatype qdbusobjectpath qdbusreply qdbusserver QDBusSignature QDBusVariant Qabstractextensionfactory Qabstractextensionmanager Qabstractformbuilder Qdesigneractioneditorinterface Qdesignerbrushmanagerinterface qdesignercomponents qdesignercontainerextension Qdesignercustomwidgetcollectioninterface Qdesignercustomwidgetinterface Qdesignerdnditeminterface Qdesignerexportwidget qdesignerextrainfoextension Qdesignerformeditorinterface QDesignerFormEditorPluginInterface Qdesignerformwindowcursorinterface Qdesignerformwindowinterface Qdesignerformwindowmanagerinterface Qdesignerformwindowtoolinterface Qdesignericoncacheinterface qdesignerlayoutdecorationextension Qdesignermembersheetextension Qdesignermetadatabaseinterface Qdesignermetadatabaseiteminterface Qdesignerobjectinspectorinterface Qdesignerpropertyeditorinterface qdesignerpropertysheetextension Qdesignertaskmenuextension qdesignerwidgetboxinterface Qdesignerwidgetdatabaseinterface QDesignerWiDgetdatabaseiteminterface qdesignerwidgetfactoryinterface qextensionfactory Qextensionmanager QFormBuilder Qabstractbutton Qabstractgraphicsshapeitem qabstractitemdelegate Qabstractitemview QAbstractPageSetupDialog Qabstractprintdialog Qabstractproxymodel Qabstractscrollarea Qabstractslider Qabstractspinbox Qabstracttextdocumentlayout Qabstractundoitem qaccessible qaccessibleapplication QAccessibleBridge Qaccessiblebridgefactoryinterface Qaccessiblebridgeplugin qaccessibleevent Qaccessiblefactoryinterface Qaccessibleinterface qaccessibleobject qaccessibleplugin qaccessiblewidget qaction QActionEvent QActionGroup Qapplication qbitmap qboxlayout qbrush qbrushdata qbuttongroup qcdestyle qcalendarwidget QCheckBox QCleanlooksStyle Qclipboard qclipboardevent qcloseevent qcolor qcolordialog qcolorgroup qcolormap qcombobox QCommonStyle QCompleter Qconicalgradient qcontextmenuevent qcursor qcursorshape qdatawidgetmapper qdateedit QDateTimeEdit QDesktopServices Qdesktopwidget qdial Qdialog qdialOgbuttonbox Qdirmodel qdockwidget qdoublespinbox qdoublevalidator qdrag qdragenterevent QDragLeaveEvent QDragMoveEvent Qdragresponseevent qdropevent qerrormessage qfiledialog qfileiconprovider qfileopenevent QFocusEvent QFocusFrame QFont Qfontcombobox qfontdatabase qfontdialog qfontinfo qfontmetrics qfontmetricsf qframe QGradient QGradientStop Qgradientstops qgraphicsellipseitem qgraphicsitem qgraphicsitemanimation qgraphicsitemgroup QGraphicsLineItem Qgraphicspathitem Qgraphicspixmapitem Qgraphicspolygonitem Qgraphicsrectitem qgraphicsscene Qgraphicsscenecontextmenuevent qgraphicsscenedragdropevent qgraphicssceneevent QGraphicsSceneHelpEvent Qgraphicsscenehoverevent qgraphicsscenemouseevent qgraphicsscenewheelevent Qgraphicssimpletextitem Qgraphicstextitem qgraphicsview qgridlayout qgroupbox qhboxlayout qheaderview qhelpevent QHideEvent QHoverEvent QIcon Qicondragevent qiconengine qiconenginefactoryinterface qiconengineplugin qiconset QImage QImageIOHandler QimageiohandlerfactoryinterFace Qimageioplugin qimagereader Qimagetextkeylang qimagewriter qinputcontext qinputcontextfactory Qinputcontextfactoryinterface qinputcontextplugin qinputdialog qinputevent qinputmethodevent QIntValidator Qitemdelegate qitemeditorcreator qitemeditorcreatorbase qitemeditorfactory qitemselection QItemSelectionModel Qitemselectionrange qkeyevent qkeysequence qlcdnumber qlabel qlayout qlayoutitem qlayoutiterator QLineEdit Qlineargradient qlistview qlistwidget qlistwidgetitem qmacmime qmacpasteboardmime QMainWindow QMatrix QMenu QMenuBar Qmenuitem qmenubarupdatedevent qmessagebox qmessageboxex qmimesource qmotifstyle QMouseEvent QMoveEvent QMovie Qpagesetupdialog qpaintdevice qpaintengine qpaintenginestate qpaintevent qpainter QPainterPath QPainterPathPrivate Qpainterpathstroker qpalette qpen qpicture qpictureformatinterface qpictureformatplugin QPictureIO QPixmap Qpixmapcache qplastiquestyle qpolygon qpolygonf qprintdialog qprintengine qprinter QProgressBar QProgressDialog Qproxymodel QPUShbutton qradialgradient Qradiobutton qregexpvalidator qregion qresizeevent qrgb qrubberband QScrollArea QScrollBar Qsessionmanager qshortcut qshortcutevent qshowevent qsizegrip qsizepolicy qslider QSortFilterProxyModel QSound Qspaceritem qspinbox qsplashscreen qsplitter qsplitterhandle qstackedlayout qstackedwidget QStandardItem Qstandarditemeditorcreator Qstandarditemmodel qstatusbar qstatustipevent qstringlistmodel QStyle QStyleFactory Qstylefactoryinterface qstylehintreturn qstylehintreturnmask qstyleoption Qstyleoptionbutton QStyleOptionComboBox Qstyleoptioncomplex qstyleoptiondockwidget qstyleoptionfocusrect qstyleoptionframe QStyleOptionFrameV2 Qstyleoptiongraphicsitem Qstyleoptiongroupbox Qstyleoptionheader Qstyleoptionmenuitem QStyleOptionProgressBar QStyleOptionProgressBarV2 Qstyleoptionq3dockwindow Qstyleoptionq3listview Qstyleoptionq3listviewitem Qstyleoptionrubberband Qstyleoptionsizegrip Qstyleoptionslider Qstyleoptionspinbox QStyleOptionTab Qstyleoptiontabbarbase QstyleoPtionTabV2 qstyleoptiontabwidgetframe Qstyleoptiontitlebar Qstyleoptiontoolbar Qstyleoptiontoolbox Qstyleoptiontoolbutton qstyleoptionviewitem qstylepainter qstyleplugin qsyntaxhighlighter QSystemTrayIcon QTabBar Qtabwidget qtableview qtablewidget qtablewidgetitem qtablewidgetselectionrange qtabletevent QTextBlock Qtextblockformat qtextblockgroup qtextblockuserdata qtextbrowser qtextcharformat QTextCursor QTextDocument Qtextdocumentfragment qtextedit qtextformat qtextfragment qtextframe qtextframeformat QTextFrameLayoutData Qtextimageformat qtextinlineobject qtextitem qtextlayout qtextlength qtextline qtextlist QTextListFormat QTextObject Qtextobjectinterface qtextoption qtexttable Qtexttablecell qtexttableformat qtimeedit QToolBar QToolBarChangeEvent Qtoolbox Qtoolbutton qtooltip qtreeview qtreewidget qtreewidgetitem qtreewidgetitemiterator QUndoCommand QUndoGroup Qundostack qundoview qupdatelaterevent qvboxlayout qvalidator qwmatrix qwhatsthis QWhatsThisClickedEvent QWheelEvent QwidgET qwidgetaction qwidgetdata qwidgetitem qwidgetlist qwidgetmapper qwindowstatechangeevent QWindowsMime QWindowsStyle Qwindowsxpstyle qworkspace qabstractsocket qftp qhostaddress qhostinfo qhttp qhttpheader QHttpRequestHeader Qhttpresponseheader qipv6address qnetworkaddressentry qnetworkinterface qnetworkproxy QTcpServer QTcpSocket Qudpsocket qurlinfo q_ipv6addr qglcolormap qglcontext qglformat qglframebufferobject QGLPixelBuffer QGLWidget Qibasedriver qibaseresult qmysqldriver qmysqlresult qodbcdriver qodbcresult qpsqldriver QPSQLResult QSQLite2Driver Qsqlite2result qsqlitedriver qsqliteresult qsqldatabase qsqldriver qsqldrivercreator QSqlDriverCreatorBase Qsqldriverfactoryinterface qsqldriverplugin qsqlerror qsqlfield qsqlindex qsqlquery QSqlQueryModel QSqlRecord Qsqlrelation qsqlrelationaldelegate qsqlrelationaltablemodel qsqlresult qsqltablemodel QSvgRenderer QSvgWidget Qeventsizeofchecker qsignalspy qspontanekeyevent qtestaccessibility qtestaccessibilityevent QTestData QTestDelayEVent qtestevent qtesteventlist qtesteventloop qtestkeyclicksevent qtestkeyevent qtestmouseevent QUiLoader QDomAttr Qdomcdatasection qdomcharacterdata qdomcomment qdomdocument qdomdocumentfragment QDomDocumentType QDomElement Qdomentity qdomentityreference qdomimplementation qdomnamednodemap qdomnode qdomnodelist QDomNotation Qdomprocessinginstruction qdomtext qxmlattributes Qxmlcontenthandler qxmldtdhandler QXmlDeclHandler Qxmldefaulthandler qxmlentityresolver qxmlerrorhandler qxmlinputsource qxmllexicalhandler QXmlLocator Qxmlnamespacesupport qxmlparseexception Qxmlreader Qxmlsimplereader Second, intelligent completion 1, installation Omnicppcomplete, from http://www.vim.org/ scripts/script.php?script_id=1520 download Omnicppcomplete, directly extracted to the Vim installation directory (window under the Vimfiles) 2, installation ctags,http:// ctags.sourceforge.net/, and add it to the environment variable, to the QT include directory and the SRC directory to execute separately
ctags-r--c++-kinds=+p--fields=+ias--extra=+q
then the files of tags were generated in two directories. Edit _VIMRC, join
Set NOCP
filetype plugin indent on
Set Tags+=qtdir/include/tags
Set Tags+=dqtdir/src/tags3, Set tab auto-completion, http://www.vim.org/scripts/script.php?script_id=1643, copy Supertab.vim to plugin directory, and add in _VIMRC
Set Completeopt=longest,menu
Let G:supertabretaincompletiontype = 2
Let g:supertabdefaultcompletiontype = "<C-X><C-O>"For more information on completion, see: http://easwy.com/blog/archives/advanced-vim-skills-omin-complete/Open Syntax highlighting support:
syntax EnableThird, under Windows use Vim to edit and compile qt new text file, named Qt_vim.bat, find the QT directory under the Qtenv.bat, make corresponding changes, the following is my content, for reference
[CPP]View Plaincopy
- @echo off
- Rem
- REM This file is generated
- Rem
- Echo Setting up a MINGW/QT only environment ...
- echo--Qtdir set to D:/QT/4.6.0/QT
- Echo-PATH set to D:/qt/4.6.0/qt/bin
- echo--Adding D:/qt/4.6.0/bin to PATH
- echo--Adding%systemroot%/system32 to PATH
- echo--Qmakespec set to win32-g++
- Set QTDIR=D:/QT/4.6.0/QT
- Set Path=d:/qt/4.6.0/qt/bin
- Set path=%path%;D:/qt/4.6.0/bin;d:/qt/4.6.0/mingw/bin;d:/program files/vim/vim72 //Remember to add Vim path
- Set Path=%path%;%systemroot%/system32
- Set qmakespec=win32-g++
- CD "F:/CODE/QT" //Enter the working directory
- Start " " Gvim-o2 " f:/code/qt" //Set QT working directory
- Exit //quit CMD, keep gvim window
And then run the ctags-r--c++-kinds=+p--fields=+ias--extra=+q http://blog.csdn.net/huihui1988/article/details/5601495 in the project catalog.
Use VIM as the IDE for QT development