A micro-plugin for opening [Scratch]
buffers in Vim.
Vim's [Scratch]
buffers are very useful, but opening them is non-intuitive.
:help special-buffers
defines a scratch buffer as:
:setlocal buftype=nowrite
:setlocal bufhidden=delete
:setlocal noswapfile
This plugin abstracts these details away behind a more friendly interface.
Command | Description |
---|---|
:ScratchSplit |
Open a [Scratch] buffer in a new split. |
:ScratchVSplit |
Open a [Scratch] buffer in a new vsplit. |
:ScratchTab |
Open a [Scratch] buffer in a new tab. |
Used independently, all commands will create a new, empty [Scratch]
buffer:
:ScratchVSplit
Equally, they can be chained with other commands (particularly :read
) to fill
the new buffer with content:
:ScratchTab | read !grep -r foo bar/
mkdir -p ~/.vim/pack/git-plugins/start
git clone https://github.com/hamish-miller/itch.git ~/.vim/pack/git-plugins/start/itch
Issues and Pull Requests welcome.
Issues - Please provide as much detail as possible.
Pull Requests - Please aim to keep this micro-plugin simple and lightweight.