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

Popular posts from this blog

mysql - FireDac error 314 - but DLLs are in program directory -

git - How to list all releases of public repository with GitHub API V3 -

c++ - Getting C2512 "no default constructor" for `ClassA` error on the first parentheses of constructor for `ClassB`? -