set viminfo='20,\"100
處理 function SetTitle 時(shí)發(fā)生錯(cuò)誤:
第? ? 9 行:
E118: 函數(shù)的參數(shù)過多: line
E116: Invalid arguments for function append
請(qǐng)按 ENTER 或其它命令繼續(xù)
請(qǐng)問這個(gè)怎么處理
處理 function SetTitle 時(shí)發(fā)生錯(cuò)誤:
第? ? 9 行:
E118: 函數(shù)的參數(shù)過多: line
E116: Invalid arguments for function append
請(qǐng)按 ENTER 或其它命令繼續(xù)
請(qǐng)問這個(gè)怎么處理
舉報(bào)
2022-08-05
# 自動(dòng)加入文件頭, 編輯 vim /etc/vimrc 文件
autocmd BufNewFile *.py,*.sh, exec ":call SetTitle()"
let $author_name = "Hello"
let $author_mail = "Hello@163.com"
func SetTitle()
call setline(1, "\#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++")
call append(line("."), "\# FileName:".expend("%"))
call append(line(".")+1, "\# Author:".$author_name)
call append(line(".")+2, "\# Email:".$author_mail)
call append(line(".")+3, "\# CreateTime:".strftime("%C"))
call append(line(".")+4, "\#------------------------------------------------------------")
if &filetype == "sh"
call append(line(".")+5, "\# !/bin/bash")
else?
call append(line(".")+5, "\# !/bin/python")
endif
call append(line(".")+6, "")
autocmd BufNewFile * normal G
2021-01-28
第9行 末尾應(yīng)該加'號(hào)