Skip to content

How does it work to obtain visual selection buffer? #59

Description

@unphased

I'm trying to write some vimscript to allow me to instantly write the yanked buffer out to my filesystem, so that I can make more tools around it. (mainly so I can be able to slurp the yank into another instance of Vim, when on a headless machine that does not have a clipboard)

Of course, I'd like to keep vim yankstack functionality intact.

Now I also expect that yankstack itself has some code that achieves (using some black magic) the slurping of the buffer.

I've been reading the source code and I'm still a little confused.

My main limiting issue is that I need to cause the original yank behavior to proceed, in particular in visual mode, and to run some code AFTER that happens. This appears to be essentially impossible without manually reimplementing what the y key does because the contents of the yank buffer do not land until after it happens, and in an expr map I have to have the thing return (and therefore any funcs it calls) the "y" value in order for that yank to proceed.

Maybe yankstack works around this by just cleverly shuffling registers, so that the next paste operations work properly. But if I need to persist the yank onto the filesystem then I seem to be out of luck.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions