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

  免費(fèi)注冊(cè) 查看新帖 |

Chinaunix

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

vim配置問題請(qǐng)教 [復(fù)制鏈接]

論壇徽章:
0
跳轉(zhuǎn)到指定樓層
1 [收藏(0)] [報(bào)告]
發(fā)表于 2011-07-21 09:59 |只看該作者 |倒序?yàn)g覽
按照網(wǎng)上搜到的資料如下:
http://vim.1045645.n5.nabble.com ... onal-td1141787.html

在.vimrc文件中添加一些配置語句, 要判斷vim打開的文件是否是c文件, 語句如下:
  1. let mytype = &filetype
  2. echo "xxxxxxxxxxxxxxxxxxxxxxxxx============="mytype"========================================"
  3. if &filetype=="c" || &filetype=="C"
  4. "if &ft == "c"
  5.     echo "-----------------------file type was c------------------------------"
  6.     " 'filetype' is c
  7. elseif &filetype == "cpp"
  8.     echo "-----------------------file type was cpp------------------------------"
  9.     " it is cpp
  10. else
  11.     echo "-----------------------file type was other------------------------------"
  12.     " it is something else
  13. endif
復(fù)制代碼
可無論我每次用vim打開什么文件, filetype讀取出來都是空的,  輸出如下:
  1. $ vi test.c
  2. xxxxxxxxxxxxxxxxxxxxxxxxx=============  ========================================
  3. -----------------------file type was other------------------------------
  4. 請(qǐng)按 ENTER 或其它命令繼續(xù)
復(fù)制代碼
而進(jìn)入了test.c文件后, 我用命令獲取到的文件類型又是正確的, 輸出如下:
  1. :set filetype
  2. filetype=c
復(fù)制代碼
請(qǐng)高手解惑

論壇徽章:
0
2 [報(bào)告]
發(fā)表于 2011-07-21 10:06 |只看該作者
au FileType C 吧

論壇徽章:
0
3 [報(bào)告]
發(fā)表于 2011-07-21 10:13 |只看該作者
filetype on

論壇徽章:
0
4 [報(bào)告]
發(fā)表于 2011-07-21 10:51 |只看該作者
學(xué)習(xí)

論壇徽章:
0
5 [報(bào)告]
發(fā)表于 2011-07-21 11:46 |只看該作者
au FileType C 吧
yangyang1581 發(fā)表于 2011-07-21 10:06


完全木有用:
  1. filetype on
  2. au FileType C
  3. let mytype = &filetype
  4. echo "xxxxxxxxxxxxxxxxxxxxxxxxx============="mytype"========================================"
  5. if &filetype=="c" || &filetype=="C"
  6. "if &ft == "c"
  7.     echo "-----------------------file type was c------------------------------"
  8.     " 'filetype' is c
  9. elseif &filetype == "cpp"
  10.     echo "-----------------------file type was cpp------------------------------"
  11.     " it is cpp
  12. else
  13.     echo "-----------------------file type was other------------------------------"
  14.     " it is something else
  15. endif
復(fù)制代碼
設(shè)置了以后輸出還是:
$ vi test.c

--- 自動(dòng)命令 ---
xxxxxxxxxxxxxxxxxxxxxxxxx=============  ========================================
-----------------------file type was other------------------------------
請(qǐng)按 ENTER 或其它命令繼續(xù)

論壇徽章:
0
6 [報(bào)告]
發(fā)表于 2011-07-21 11:48 |只看該作者
回復(fù) 3# lkk2003rty


這個(gè)我也早試過了, 沒有用, 進(jìn)入到c文件以后用filetype看很正常:
  1. :filetype
  2. filetype detection:ON  plugin:ON  indent:ON
復(fù)制代碼

論壇徽章:
0
7 [報(bào)告]
發(fā)表于 2011-07-21 11:59 |只看該作者
au FileType php call AddPHPFuncList()
function AddPHPFuncList()
    echo "-----------------------file type was PHP------------------------------"
endfu

論壇徽章:
0
8 [報(bào)告]
發(fā)表于 2011-07-21 17:49 |只看該作者
au FileType php call AddPHPFuncList()
function AddPHPFuncList()
    echo "-----------------------f ...
yangyang1581 發(fā)表于 2011-07-21 11:59



    這種方法沒有問題, 我以前也是用 autocmd FileType c,cpp 來處理,  偶然在網(wǎng)上發(fā)現(xiàn)&filetype的方法, 想嘗試下, 結(jié)果不行.
您需要登錄后才可以回帖 登錄 | 注冊(cè)

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

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP