m main.cpp192 打开后 第一件事就是导入 cscope 数据库了:193 :cs add /home/yourname/workpace/cscope.out /home/yourname/workpace194195 cscope 数据库导入成功后 就可以利用quot步骤4quot中定义的快捷键进行相关的查找196 浏览等操作了当然也可以直接利用相关命令 嘿嘿.197198199 5. c.vim 插件200 1. 帮助手册查看201 help csupport202203 2. 功能204 C/C-IDE for Vim/gVim. 简单的说 就是如果安装配置好后 vim/gvim 就是一个205 c/c编程的一个 IDE 其功能堪比 windows 里常用的 vc.206207 3. 安装208 下载 cvim.zip 压缩包后 把压缩包 copy 到 HOME/.vim 目录windows 下 copy 到209 C:/Program Files/Vim/vimfiles下解压 即可.210 unzip cvim.zip // 解压命令211212 4. 使用方法213 安装好后就可以直接用了 具体例子看quot使用例子quot.214215 5. 使用例子216 在终端用 vim打开一个 c 文件:217 vim hello.c218 进入 vim 敲入 quot/imquot 即可发现一个 main 函数框架就这样快捷简单完美地写出.219220 我比效常用的的操作有第一列为命令 第二列为说明 第三列为该命令所支持的模221 式n:普通模式 v:可视模式 i:插入模式:222 -- Help -----------------------------------------------223 /hm show manual for word under the cursorni224 /hp show plugin help ni225226 -- Comments -------------------------------------------227 /cl end-of-line comment nvi228 /cj adjust end-of-line comments nvi229 /cs set end-of-line comment column n230 /c code -gt comment / / nv231 /cc code -gt comment // nv232 /co comment -gt code nv233 /cfr frame comment ni234 /cfu function comment ni235 /cme method description ni236 /ccl class description ni237 /cd date nvi238 /ct date /amp time nvi239240 -- Statements ------------------------------------------241 /sd do while nvi242 /sfo for nvi243 /sife if else nvi244 /se else nvi245 /swh while nvi246 /ss switch nvi247248 -- Preprocessor -----------------------------------------249 /plt include ltgt ni250 /p include quotquot ni251 /pd define ni252 /pu undef ni253 /pie if else endif nvi254 /pid ifdef else endif nvi255 /pin ifndef else endif nvi256 /pind ifndef def endif nvi257 /pi0 if 0 endif nvi258 /pr0 remove if 0 endif ni259 /pe error ni260 /pl line ni261 /pp pragma ni262263 -- Idioms ------------------------------------------------264 /if function nvi265 /isf static function nvi266 /im main nvi267 /i0 for x0 xltn x1 nvi268 /in for xn-1 xgt0 x-1 nvi269 /ie enum typedef ni270 /is struct typedef ni271 /iu union typedef ni272 /ip printf ni273 /isc scanf ni274 /ica pcalloc ni275 /ima pmalloc ni276 /isi sizeof nvi277 /ias assert nv278 /ii open input file ni279 /io open output file ni280281 -- Snippets ------------------------------------------------282 /nr read code snippet ni283 /nw write code snippet nvi284 /ne edit code snippet ni285 /np pick up prototype nvi286 /ni insert prototypes ni287 /nc clear prototypes ni288 /ns show prototypes ni289 /ntl edit local templates ni290 /ntg edit global templates ni291 /ntr rebuild templates ni292293 -- C ----------------------------------------------------294 /co cout ltlt ltlt endl ni295 /c class ni296 /cn class using new ni297 /ci class implementation ni298 /cni class using new implementation ni299 /mi method implementation ni300 /ai accessor implementation ni301302 /tc template class ni303 /tcn template class using new ni304 /tci template class implementation ni305 /tcni template class using new impl. ni306 /tmi template method implementation ni307 /tai template accessor implementation ni308309 /tf template function ni310 /ec error class ni311 /tr try ... catch nvi312 /ca catch nvi313 /c. catch... nvi314315 -- Run ---------------------------------------------------316 /rc save and compile ni317 /rl link ni318 /rr run ni319 /ra set comand line arguments ni320 /rm run make ni321 /rg cmd. line arg. for make ni322 /rp run splint ni323 /ri cmd. line arg. for splint ni324 /rk run CodeCheck TM ni325 /re cmd. line arg. for CodeCheckTM ni326 /rd run indent nvi327 /rh hardcopy buffer nvi328 /rs show plugin settings ni329 /rx set xterm size n only Linux/UNIX amp GUI330 /ro change output destination ni331332 关于此插件的更多功能和各种说明 请查看帮助手册 help csupport.333334335336 6. omnicppcoplete 插件337 1. 帮助手册查看338 :help omnicppcoplete339 2. 功能340 实现像 vc 那样的代码自动补全功能 比如 this-gtltCtrlXgtltCtrlOgt 后 将出现一个341 提示框 其中包含了 this 指针所有可以接收的函数或数据成员等.342 3. 安装343 把下载下来的 omnicppcoplete-0.41.zip 压缩包 copy 到 HOME/.vim/windows 复344 制到 C:/Program Files/Vim/vimfiles 然后解压 即可.345 4. 使用方法346 在.vimrc 中添加以下两条语句:347 set nocp quot不兼容 vi348 filetype plugin on quot开启文件类型识别功能349 进入 c源码目录 在终端执行命令 ctags -R --c-kindsp --fieldsiaS350 --extraq .351 5. 使用例子352 编写 c代码时 如要自动补全 敲入 CtrlX CtrlO 即可在出现的提示框中用353 CtrlN 选择符合要求的.354355356357 7. a.vim 插件358 1. 帮助手册查看359 这个插件没有帮助手册 不过大可放心使用 其提供的功能也不是很多 就几条命令360 但是用起来真的是很方便.361 2. 功能362 在 .h 和 .c/.cpp 文件中切换. 英文原句 quotA few of quick commands to swtich363 between source files and header files quickly.quot364 3. 安装365 把下载到的 a.vim 插件放到 HOME/.vim/plugin 目录下 即可.366 4. 使用方法367 只要在 vim中输入以下命令即可完成相应的功能:368 :A switches to the header file corresponding to the current file being369 edited or vise versa370 :AS splits and switches371 :AV vertical splits and switches372 :AT new tab and switches373 :AN cycles through matches374 :IH switches to file under cursor375 :IHS splits and switches376 :IHV vertical splits and switches377 :IHT new tab and switches378 :IHN cycles through matches379 ltLeadergtih switches to file under cursor380 ltLeadergtis switches to the alternate file of file under cursore.g.381 on ltfoo.hgt switches to foo.cpp382 ltLeadergtihn cycles through matches383384385 8. VisualMark.vim 插件386 1. 帮助手册查看387 这个插件没有帮助手册 不过大可放心使用 其提供的功能也不是很多 就几条命令388 但是用起来真的是很方便.389 2. 功能390 高亮书签.391 3. 安装392 把下载好的 VisualMark.vim 插件放到 HOME/.vim/plugin 目录下 即可.393 4. 使用方法394 只要在 vim中执行以下命令即可完成相应的功能:395 1. For gvim use quotCtrl F2quot to toggle a visual mark.396 For both vim and gvim use quotmmquot to toggle a visual mark.397 2. Use quotF2quot to navigate through the visu.
上一篇:
DES算法和RC4算法实验任务
下一篇:
小学英语作文:讨厌的蟑螂(双语)