Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
unphased opened this issue Sep 13, 2017 · 1 comment
Open

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

unphased opened this issue Sep 13, 2017 · 1 comment

Comments

@unphased
Copy link

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.

@unphased
Copy link
Author

unphased commented Sep 13, 2017

I think the existence of this shows that what i've discovered is a real problem.

I do use nvim sometimes, but last I checked had some performance issues with it compared to vanilla vim.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant