Open alichtman opened 9 months ago
Does :Scratch
do what you want?
No, because the scratch pad doesn't stay open when I change windows back to where I'm working. I guess this detail wasn't exactly clear from my original post :)
I see. :Scratch
should have the behavior you describe if you add g:scratch_insert_autohide = 0
to your config.
This almost gets there, but the Scratch window doesn't close when I run the same key binding again. I'd like :ScratchToggle
to have the following behavior:
OK, I see. There is no built-in command with this behavior. You could implement it by checking for the existence of the __Scratch__
buffer (very similar to preview
's underlying logic). If you are interested in contributing it to this repo, I would be happy to review a PR which adds a :ScratchPreview
bang argument to tweak its behavior accordingly.
I wanted to set up a scratch buffer that is toggle-able (like
:ScratchPreview
) and automatically focuses my cursor on the buffer when opening it. I was expecting a:ScratchToggle
command, but did not find one.Here's my current config for
scratch
inlazy.nvim
:When I want to open a scratch window, I use
<leader>sp
. This opens a scratch buffer, but I have to manually move the cursor there.Any chance this could be added to the plugin?