I want to open a bld.log file as default else the input filename in vim vsplit window or in newtab no matter from which nested subfolder I am opening it.
So I added following function in ~/.vimrc but instead of opening searched path path1 its opening the newfile with name path1.
Please let me know what I am missing here or how can I achieve it ?
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. I want to do above in .vimrc only not in .bashrc