vim編輯.py文檔出現(xiàn)問(wèn)題,該怎樣解決?問(wèn)題:打開(kāi).py文檔,插入模式下鍵入:出現(xiàn)=swap()E117:unknow function:swap 問(wèn)題已經(jīng)定位,部分vimrc如下:"設(shè)置= + - * 前后自動(dòng)空格"設(shè)置,后面自動(dòng)添加空格au FileType pyt-on inore-p = =EqualSign("=")au FileType pyt-on inore-p + =EqualSign("+")au FileType pyt-on inore-p - =EqualSign("-")au FileType pyt-on inore-p * =EqualSign("*")au FileType pyt-on inore-p / =EqualSign("/")au FileType pyt-on inore-p > =EqualSign(">")au FileType pyt-on inore-p =EqualSign("au FileType pyt-on inore-p : =Swap()au FileType pyt-on inore-p , ,"實(shí)現(xiàn)+-*/前后自動(dòng)添加空格,逗號(hào)后面自動(dòng)添加空格,適用pyt-on"支持+= -+ *= /+格式function! EqualSign(c-ar)if a:c-ar =~ "=" && getline(".") =~ ".*("return a:c-arendiflet ex1 = getline(".")[col(".") - 3]let ex2 = getline(".")[col(".") - 2]if ex1 =~ "[-=+>\/\*]"if ex2 !~ "\s"return "\i".a:c-ar."\"elsereturn "\xa".a:c-ar."\"endifelseif ex2 !~ "\s"return "\".a:c-ar."\\a"elsereturn a:c-ar."\\a"endifendifendf 單獨(dú)注釋掉au FileType pyt-on inore-p : =Swap()沒(méi)有作用,問(wèn)題依在。連同第二段配置注釋掉可消除錯(cuò)誤,但自動(dòng)添加空格的作用就沒(méi)了...1 個(gè)答案
答案 1:
au FileType pyt-on inore-p =EqualSign(" 少了參數(shù)