亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

  免費注冊 查看新帖 |

Chinaunix

  平臺 論壇 博客 文庫
最近訪問板塊 發(fā)新帖
查看: 1771 | 回復(fù): 0
打印 上一主題 下一主題

[C] vim插件-帶參數(shù)運行c [復(fù)制鏈接]

論壇徽章:
0
跳轉(zhuǎn)到指定樓層
1 [收藏(0)] [報告]
發(fā)表于 2013-05-07 15:36 |只看該作者 |倒序瀏覽
本帖最后由 blackfur 于 2013-10-23 22:36 編輯

“run-arg.vim
  1. "vim global plugin for run with argments

  2. "define global sign
  3. if exists("g:loaded_runarg")
  4.   finish
  5. endif
  6. let g:loaded_runarg= 1

  7. "backup original settings
  8. let s:save_cpo = &cpo
  9. set cpo&vim

  10. "map and menu
  11. if !hasmapto('<Plug>RunargRa')
  12.   map <unique> <Leader>ra  <Plug>RunargRa
  13. endif
  14. noremap <unique> <script> <Plug>RunargRa  <SID>Ra

  15. noremenu <script> Plugin.Run\ With\ Arguments      <SID>Ra

  16. noremap <SID>Ra :call <SID>Ra(expand("%:p:h"),expand("%:t:r"),expand("%:e"))<CR>

  17. "define func
  18. function s:Ra(filePath,fileName,fileExtension)
  19.         let arg=input("Run ".a:fileName." with arguments: ")
  20.         exe "w"
  21.         if a:fileExtension=="c"
  22.                 let compiler="gcc"
  23.         elseif a:fileExtension=="cpp"
  24.                 let compiler="g++"
  25.         endif
  26.         exe "!".compiler." -o ".a:filePath."\\".a:fileName.".out ".a:filePath."\\".a:fileName.".".a:fileExtension."&&".a:filePath."\\".a:fileName.".out ".arg
  27.         echo "!".a:filePath."\\".a:fileName.".out ".arg
  28. endfunction

  29. "define a command
  30. if !exists(":Rwa")
  31.   command -nargs=0  Rwa :call s:Ra(expand("%:p:h"),expand("%:t:r"),expand("%:e"))
  32. endif

  33. "restore setting
  34. let &cpo = s:save_cpo
復(fù)制代碼
您需要登錄后才可以回帖 登錄 | 注冊

本版積分規(guī)則 發(fā)表回復(fù)

  

北京盛拓優(yōu)訊信息技術(shù)有限公司. 版權(quán)所有 京ICP備16024965號-6 北京市公安局海淀分局網(wǎng)監(jiān)中心備案編號:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年舉報專區(qū)
中國互聯(lián)網(wǎng)協(xié)會會員  聯(lián)系我們:huangweiwei@itpub.net
感謝所有關(guān)心和支持過ChinaUnix的朋友們 轉(zhuǎn)載本站內(nèi)容請注明原作者名及出處

清除 Cookies - ChinaUnix - Archiver - WAP - TOP