vim-yanktools
vim-yanktools copied to clipboard
Clipboard tools for vim
Yanktools
- Installation
- Features list
- Introduction
- Usage
- Pictures
- Related projects
- License
Installation
Use vim-plug or any other plugin manager.
With vim-plug:
Plug 'mg979/vim-yanktools'
Features list
-
Yank Stack: yanks and deletions are stored in a list, that can be cycled at cursor position, back and forth, with a specific keybinding, swapping elements of the stack, and keeping properties of the last paste command (autoformat, paste before, etc).
-
Preservation of unnamed register: c, C, x, X, Del, visual paste
-
Swap-&-paste: cycle among stack elements, or show them in popup
-
Replace operator: replace text objects with register. Repeatable.
-
Duplicate operator: without altering registers. Repeatable.
-
Zeta stack: a disposable yank stack, from which items are taken from the back, and pasting them removes them from the stack as well. You can populate the stack both by yanking and deleting.
-
Autoindent: you can toggle it, or use mappings to perform a single indented paste.
-
Interactive paste: in command line or fzf
-
Convert yank type: convert selected register to/from blockwise.
Introduction
Yanktools is a plugin inspired by vim-yankstack and vim-easyclip.
The main concept is to have a dedicated stack, where yanks and deletions can be stored and later accessed, so to have a "clipboard history" in vim.
There are differences between this and other plugins of this kind. Here you have a main yank stack where text is not saved automatically with each yank, but manually:
- yanks/deletions performed with specific mappings
- saving a register directly in the stack
There is also a small automatic stack, where yanked text is recorded automatically, but it's small in size (10 items by default). Yanks that are selected from this stack are also transferred to the main stack.
Usage
A main key should be defined, and this key will used for both saving into the stack, and for the replace operator. I use the 's' key.
let g:yanktools_main_key = 's' " or '<c-s>', 'S', 'Z'...
Full documentation with :help yanktools.txt
Pictures
Swapping:

Interactive paste with fzf:

Preview with popup (vim 8.1 or neovim 0.4)

Related projects
vim-easyclip
vim-yankstack
nvim-miniyank
vim-yank-queue
License
License: same terms as Vim itself