Closed oschoudhury closed 5 years ago
A simple demo of the --getreg
option. Let's say you have a file and yank the following lines in registers a, s, d, and f.
python
-c
import os;
os.system('echo 42')
Inside a shell, you can then run
$(nvr --getreg a) $(nvr --getreg s) "$(nvr --getreg d) $(nvr --getreg f)"
and it returns 42.
Okay, I put some more thought into this and decided against merging the PR.
It's easy to add new features that improve a certain workflow. But it would only be used by a very small share of the users. (Maybe only you. ;-)).
And yes, there is the "issue" of follow-up requests for this (and related) features.
IMHO, nvr
should not add more nvr-specific features but be as compatible to the Vim options as possible. That's one of the two main scopes after all.
Moreover, it's easy enough to emulate this via:
$ echo foo | nvr -c 'silent delete r' -
and
$ nvr --remote-expr 'trim(getreg("r"))'
.oO(We should introduce a general --nvr-script
option that takes any *.vim
file and executes it in the remote instance. Then everyone can go wild.)
So, no hard feelings 🙏 , but I'm closing this. Nevertheless, thanks for taking the time.
I've added an option
-r
which will read from stdin into a neovim register, similarly to xclip. The benefit here is that it is added directly into a (un)named register.Examples
The first line puts "41\n" into the named register a, the second line puts "42\n" into the unnamed register. Access to the x11 clipboard is a bonus.
It is possible to extend this functionality and provide a read-register option. That way one would have access to the dozens of registers outside the terminal environment instead of 1 or 2 system clipboards.