vim: get buffer number for unloaded buffer -
suppose have file c:/users/pedro/desktop/foo.txt
. if open gvim , run :echo bufnr('c:/users/pedro/desktop/foo.txt')
returns -1
since buffer not loaded. know can edit file (i.e run execute "edit " 'c:/users/pedro/desktop/foo.txt'
) , obtain buffer number bufnr()
. however, editing file, become visible. question is: how can (or assign) buffer number buffer not loaded in vim without making visible? equivalently: there way load vim buffer without making visible?
edit: know :hide
problem not work on last window on screen.
you can use :badd somefile
add somefile
buffer list without leaving current buffer.
:argadd
same argument list.
see :help :badd
, :help :argadd
.
Comments
Post a Comment