Questions tagged [scratch-buffer]
The scratch-buffer tag has no usage guidance.
10 questions
0
votes
1
answer
20
views
Show lines in scratch buffer in preview window
I am looking for a way to create a new scratch buffer from given lines of text and show the result in a preview window (as done by :pedit).
I think I have a handle on creating the buffer, but I am ...
4
votes
3
answers
1k
views
Is there a shorter way to start vim with scratch buffer?
Often times I use vim as a scratchpad - I just want to throw some text in there, maybe copy it to the clipboard, or munge it a bit, but it's not really important to keep it around.
Most of the time I ...
4
votes
2
answers
1k
views
Saving a scratch buffer
I currently use scratch buffers a lot for various uses such as when I read from STDIN to quickly analyze some data or take some very temporary notes. That way I don't have to worry about a swap file ...
2
votes
1
answer
1k
views
How to create Preview window to display a string?
I'm using a LSP plugin to call a command from the server, and currently it is logging the data using echom.
My current code is like this:
function! PtypeCallback(result)
echom json_encode(a:...
3
votes
1
answer
2k
views
how to create a buffer like a fugitive temporary buffer
When we call :Gdiff on a file, fugitive will create a buffer with a name fugitive:///path/to/file/. The modifiable option is off and readonly option is on. Most importantly, the file does not exist on ...
2
votes
1
answer
589
views
How to create a new 'secure scratchpad' buffer?
I want to be able to create a new buffer (and a new window with which to interact with it) to work with secret or sensitive info, e.g. passwords.
Ideally, none of the contents of the buffer would ...
1
vote
2
answers
1k
views
What is the difference between :file and :saveas
Both :file and :saveas seem to change the name of the buffer without writing. What's the difference between them? Also, in scratch buffers, :saveas seems to cause an error while :file does not. I ...
3
votes
1
answer
698
views
How to detect the buffer number of new buffer?
I would like to create a new scratch buffer in vim script. I would like to use this buffer to output the result of the execution of a scala script.
I am creating the buffer with this function:
...
3
votes
1
answer
363
views
How can I reset the scratch / preview buffer height?
When performing autocompletion on PHP or javascript, vim opens a scratch buffer which contains info about the function being autocompleted.
Unfortunately, I increased the height of this scratch buffer ...
92
votes
6
answers
51k
views
Is there an easy way to close a scratch buffer/preview window?
One of the plugins I have installed (probably Supertab) provides a nice view of documentation for the currently highlighted item in the completion menu:
The (apparently) scratch buffer remains open ...