0
開放我想開一個bld.log文件作爲默認別人在vim VSPLIT窗口或NEWTAB無論輸入文件名從嵌套子文件夾,我打開它。
所以我在〜/ .vimrc中添加下列功能,但不是開放路徑1檢索與名稱路徑1打開的newfile路徑。
請讓我知道我在這裏錯過了什麼,或者我該如何實現它?搜索的父目錄向上文件,並在VSPLIT或NEWTAB
function! Err1(...)
if a:0 > 0
let s:path1 = findfile(a:1,';')
else
let s:path1 = findfile('bld.log',';')
end
exec ':vsp ' . s:path1
endfunction
command -nargs=1 Err call Err1(...)
P.S.我想在.bashrc中在上面的.vimrc只做不
非常感謝鮑里斯。還有一個疑問可以告訴我,我們可以重寫相同的函數來接收README.md作爲參數,例如運行時參數。 – ypp
@ypp':H輸入()' – sidyll
@sidyll:我試過,但沒有工作'的功能! Err1(file1) let s:path1 = findfile('a:file1',';') 「findfile('xr_bld.ncs4k.log',';') exec':vsp'。s:path1 endfunction 命令錯誤調用ERR1()' – ypp