Sometimes I see a window open with name
I know it is some kind of temporary buffer/window.
How can I crate one?
:h scratch returns nothing.
Vi and Vim Stack Exchange is a question and answer site for people using the vi and Vim families of text editors. It only takes a minute to sign up.Sign up to join this community
It is probably a scratch buffer, which can be named. From the help:
Contains text that can be discarded at any time. It is kept when closing the window, it must be deleted explicitly. Settings: >
:setlocal buftype=nofile :setlocal bufhidden=hide :setlocal noswapfile The buffer name can be used to identify the buffer, if you give it a meaningful name.
This can be found in
I remember a vim tip (which has been migrated to vim.wikia) on the subject.
The latest version of the function I use to create scratch buffers also sets:
(From my VimL library plugin: lh-vim-lib)
function! lh#buffer#scratch(bname, where) abort try set modifiable " The next function takes care of working around this damn E36 call lh#window#create_window_with(a:where.' sp '.escape(substitute(a:bname, '\*', '...', 'g'), '#%')) catch /.*/ throw "Can't open a buffer named '".a:bname."'!" endtry setlocal bt=nofile bh=wipe nobl noswf ro return bufnr('%') endfunction