Add option to print to standard out instead of copying to clipboard
Hi, I have just come across this project and I'm wondering how it interacts with various operating systems. Does it copy to the system clipboard such that I can paste with Ctrl+V wherever I want (Windows and Linux)?
How do I paste on the command line without mouse? Your readme just says that I can now paste after the copying. In particular, how do I paste on servers where tools like xsel or xclip do not work (because there is no X)? Does this program have some kind of file buffer (like ~/.numberwang/buffer or so) that I can paste from with your tool? Is something like
numberwang --buff | gvim
possible?
Kind regards, Matthias
I would also find it convenient if numberwang would optionally write a selection to stdout, so it could be used in shell pipelines.
It seems to be using https://github.com/atotto/clipboard for handling the clipboard. You might be able to find more info there.
Yep as @twe4ked said it's using a library (https://github.com/atotto/clipboard) to access the clipboard. This library uses the system clipboard on Windows, xsel or xclip or Linux and pbpaste/pbcopy on OS X.
I agree having a target other than clipboard would be useful. Note that you can already do nw 1 2 3 to immediately make a selection without prompting but then you'd still need to parse out the selected file names which defeats the purpose of using numberwang in the first place.
@MatthiasKauer For environments without X you might be interested in working from within a tmux session. This allows you to enter copy mode (see man 1 tmux).
Copy mode allows you to select certain text on the screen and then paste it.
So, once numberwang outputs it's final line (eg. nw: wrote ".git .gitignore " to clipboard), jump there and select the file names. Then paste wherever desired.
A little clumsier than just SHIFT+Ins, but it gets the job done in such "restricted areas" (without the mouse :)