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

--to-clipboard not working #15

Open
ndom91 opened this issue Apr 14, 2023 · 4 comments
Open

--to-clipboard not working #15

ndom91 opened this issue Apr 14, 2023 · 4 comments

Comments

@ndom91
Copy link

ndom91 commented Apr 14, 2023

I'm having trouble with copying the generated images to my clipboard.

While generally the plugin works great and I've been able to generate png's in my configured path, images don't appear on the clipboard.

I saw a reference to xclip in the code, although seemingly just to check if the executable exists. So since I'm on wayland, I replaced /bin/xclip with a symlink to /bin/wl-copy (the wayland copy-to-clipboard binary).

This works everywhere else on the command line, etc. But not from the nvim silicon plugin.

I've tried the following:

  • :'<,'>Silicon --to-clipboard, which results in the error message failed to parse command-line argument: '--to-clipboard'
  • :'<,'>Silicon --to-clipboard=true, after double checking the flag parsing code. This gives a success message, but doesn't actually put anythign on the clipboard
  • Setting g:to-clipboard = true in the config
  • Adding an inotifywait listener on /bin/xclip does fire when executing the :Silicon command in nvim, I see a /bin/xclip OPEN notification

Any idea what I might be doing wrong?

@ndom91 ndom91 changed the title --to-clipboard not working --to-clipboard not working Apr 14, 2023
@dr0bz
Copy link

dr0bz commented Feb 29, 2024

Hi,

you need to escape the space:

:'<,'>Silicon\ --to-clipboard

BTW: there is a shortcut for --to-clipboard: -c

Regards

@dr0bz
Copy link

dr0bz commented Feb 29, 2024

crap...

event with --to-clipboard it writes a file: --to-clipboard.png. But also copies to clipboard.

Is there a chance to fix it and have only one output: either a file or clipboard?

BTW: great plugin!!

@ndom91
Copy link
Author

ndom91 commented Feb 29, 2024

So the way I have been using it is as follows. I highlight a few lines, then just execute Silicon from cmd mode (:'<,'>Silicon) which results in the highlighted lines of text being fed into Silicon via the plugin and my clipboard being filled with the generated image. Seems to work without a hitch 👍 🤞

@dr0bz
Copy link

dr0bz commented Feb 29, 2024

I see now. --to-clipboard can be omitted. But it also writes a file.

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

2 participants