• Stars
    star
    230
  • Rank 169,355 (Top 4 %)
  • Language
    Lua
  • License
    MIT License
  • Created over 8 years ago
  • Updated 7 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

killring-alike plugin for neovim and vim 8 with no default mappings

nvim-miniyank

The killring-alike plugin with no default mappings.

Works in neovim, as well as vim with lua enabled and patch 8.0.1394.

Usage

Yanks and deletes will be detected using TextYankPost autocommand, so no mappings for these actions are needed. The yank history is shared between [n]vim instances.

There is two different mappings for starting to put from the history. To remap p, "autoput" mapping should be used. This will first put the same text as unmapped "p" would have, and still support "xp and clipboard=unnamed[plus]:

map p <Plug>(miniyank-autoput)
map P <Plug>(miniyank-autoPut)

"startput" will directly put the most recent item in the shared history:

map <leader>p <Plug>(miniyank-startput)
map <leader>P <Plug>(miniyank-startPut)

Right after a put, use "cycle" to go through history:

map <leader>n <Plug>(miniyank-cycle)

Stepped too far? You can cycle back to more recent items using:

map <leader>N <Plug>(miniyank-cycleback)

Maybe the register type was wrong? Well, you can change it after putting:

map <Leader>c <Plug>(miniyank-tochar)
map <Leader>l <Plug>(miniyank-toline)
map <Leader>b <Plug>(miniyank-toblock)

clipboard=unnamed register type fixing

Currently neovim doesn't have support for register types in the clipboard. This makes blockwise yanking and putting broken when clipboard=unnamed or unnamedplus is used. When this option is set, and "p" is mapped to "autoput" mappings as suggested above, this plugin will try to correct the register type when an unnamed paste is done. It uses heuristics that at least will work if you yank blockwise and then immediately paste unnamed in the same or another nvim instance.

Of course, regardless if clipboard=unnamed is set or not, you can always do the correct paste using a "startPut" mapping, or cycling one step back in history when needed.

Throttling of big unnamed deletes

The plugin tries to avoid unnecessary copying on unnamed deletes (d or c with no preceeding "x). Unnamed deletes with more than g:miniyank_delete_maxlines (default 1000) will be ignored. To force yanking, just add a register name, like ""d or "*d.

Denite source

If Denite is installed, the yank history can be displayed using :Denite miniyank

FAQ

Does it work in vim 8?

Yes, if lua is enabled and with vim 8.1 or later. (Lua is not really intrinsically needed. One day I might implement the small necessary subset of msgpack directly in vimL.)

It doesn't work!

This plugin tries to autodetect a suitable file path for the shared yankring. $XDG_RUNTIME_DIR is used if set, otherwise stdpath('cache') will be used. Check that g:miniyank_filename was set to a location that is both readable and writeable by your user account. If not, either fix your environment, or override it manually:

let g:miniyank_filename = $HOME."/.miniyank.mpack"

Is python3 required?

Python is only required for the optional Denite source. The rest of the plugin is pure vimscript.

10 items? That is not close to be enough!

How about

let g:miniyank_maxitems = 100

It doesn't persist across reboots!

Sigh, just why? Okay, do

let g:miniyank_filename = $HOME."/.miniyank.mpack"

More Repositories

1

nvim-ipy

IPython/Jupyter plugin for Neovim
Python
413
star
2

nvim-luadev

REPL/debug console for nvim lua plugins
Lua
264
star
3

Neovim.jl

Neovim client for Julia
Julia
40
star
4

bfredl.github.io

public docs and dotfiles
Lua
17
star
5

forklift

x86-64 JIT backend for Zig
Zig
16
star
6

nvim-incnormal

Probably the most insane multi-cursor plugin for Neovim
Vim Script
15
star
7

vim-argclinic

movements and operators for manipulating argument lists
Vim Script
10
star
8

pangoterm

C
10
star
9

nvim-zigclient

nvim-zigclient
Lua
10
star
10

nvim-matrix

Simple matrix client in nvim
Python
6
star
11

nvim-jupyter

neovim - jupyter kernels interaction (testing)
Python
6
star
12

zigui

zig all the things (libvterm, nvim ext_multigrid, and so on)
Zig
5
star
13

eiri

Self-contained kprobe/uprobe+eBPF tracer in zig
Zig
5
star
14

ibus-chords

Experiments with key chords and such stuff
Python
5
star
15

nvim-lanterna

Lua
5
star
16

nvim-miniluv

Lua
4
star
17

nvim-cxx

neovim c++ experiment (not finished)
C++
2
star
18

nvim-lspmirror

Nvim LSP PR mirror as a plugin for neovim master
Lua
2
star
19

libtickit

Mirror of http://bazaar.leonerd.org.uk/c/libtickit/
C
2
star
20

nvim-luvlsp

Old luv-based LSP client sketch. Since integrated into the mainline nvim 0.5 client
Lua
2
star
21

GI.jl

GObject-introspection for julia
Julia
1
star
22

SKRAPET

CSS
1
star
23

nvim-bufmngr

Vim Script
1
star
24

nvim-x11

Prototype of native X11 selections for neovim
C
1
star
25

weebgpu

weebgpu
C
1
star
26

typetrainer

Python
1
star
27

advent2021

Assembly
1
star
28

tutorial

Jupyter Notebook
1
star
29

bmidi

C++
1
star
30

nvim-lspext

Lua
1
star
31

llama.cpp

Port of Facebook's LLaMA model in C/C++
C
1
star
32

x

1
star