https://github.com/eth-p/nvim-clone-buffer
A small neovim plugin for creating a scratch copy of the current buffer.
https://github.com/eth-p/nvim-clone-buffer
Last synced: about 1 year ago
JSON representation
A small neovim plugin for creating a scratch copy of the current buffer.
- Host: GitHub
- URL: https://github.com/eth-p/nvim-clone-buffer
- Owner: eth-p
- License: mit
- Created: 2025-03-24T04:25:59.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2025-03-24T05:06:10.000Z (about 1 year ago)
- Last Synced: 2025-03-24T05:31:00.441Z (about 1 year ago)
- Language: Lua
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# nvim-clone-buffer
A small neovim plugin for creating a scratch copy of the current buffer.
## Installation
**With Lazy.nvim:**
```lua
{
"eth-p/nvim-clone-buffer",
opts = {
-- ...
}
}
```
## Usage
This plugin registers two user commands:
### `:CloneBuffer`
Creates a copy of the current buffer and switches the current window to it.
### `:CloneBufferInBackground`
Creates a copy of the current buffer and leaves it in the background.
## Configuration
>[!tip]
> **enabled**: If set to `false`, the plugin's user commands will not be registered.
>
> Type: `boolean`
> Default: `true`
>[!tip]
> **suppress_autocmd**: If set to `true`, autocmds will not run while creating the cloned buffer.
>
> Type: `boolean`
> Default: `true`
>[!tip]
> **cloned_options**: The buffer-local options that will be cloned.
> If an option is set to false, it will be skipped.
>
> Type: `map`
> Default:
>
> ```lua
> {
> filetype = true,
> syntax = true,
>
> shiftwidth = true,
> expandtab = true,
> tabstop = true,
> }
> ```
>[!tip]
> **cloned_vars**: The buffer-local variables that will be cloned.
> If the variable is set to false, it will be skipped.
>
> Type: `map`
> Default:
>
> ```lua
> {}
> ```