If I copy some text; while pasting, I need to tinker with the copied text; then how can I do that?
For example, if I am copying the math/LaTeX Code:
$x+y=2$ … and when I copy it, by default, it takes, that dollar sign as well and when I want to paste it somewhere else, I no longer required those dollar signs, so how do I get rid of that?
Moreover, this is just a sample question… but I might have more complex situations… for example, I need to remove $ and then the earlier LaTeX environment as well… and similarly, in the last also, $ and subsequent environments, then how to do that?
Is there any quick command to do such kind of thing?
This could be done with a PopClip extension as follows:
(The above block is an extension snippet — select it then click “Install Extension” in PopClip.)
regex: \$.+\$matches inputs containing
$...$capturing everything between the first and last
.slice(1,-1)removes the first and last character
popclip.copyText()copies the result to the clipboard.
For other situations, you would of course need to modify the regex and code accordingly. I hope this provides a starting point.