-
Notifications
You must be signed in to change notification settings - Fork 146
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
Feature Request: import selected text #78
Comments
I'd love this too. |
I did something on my branch, not sure if it will worth it to bring it here, as it'll affect the clipboard contents. (you'll lose your current clipboard content). I haven't found an easy way to do this (I could temporarily copy the current clipboard content to a file and restore it at the end.... <- I might try this idea later) you could see it in action on the demo gif here: https://github.com/d1egoaz/vim-anywhere/
|
I'm interested in Linux version of this. |
@d1egoaz Thanks for this! You mention that you thought about saving the clipboard contents to a file temporarily. Would it also be feasible in AppleScript to just store them in a variable and then copy them back to the clipboard once the selected contents have been pasted? |
@balta2ar I was too, but realized that with all the different manners of interaction with text selections and different window managers, etc that stepping it back to just using clipboard contents was the more reasonable solution not only for Linux but across platforms I submitted a pull request to do this: |
@99arobe yeah, that will work! that's a better idea actually |
That did the trick for me. |
lol 😈 |
I had used Vim-Anywhere some time ago and then kinda forgot about it. When trying it again now, was disappointed vim was opening with an empty buffer (OS X). I made a simple change to bin/run and now get the current clipboard: ` *** bin/run.1586528512 2020-04-10 10:21:52.000000000 -0400
Is there a better/more clever way to do this? [ my pasted code is getting munged, I only inserted the pbpaste line just before invoking mvim] |
that's v close to what I did in PR #99 🙂 been a minute though, and still no movement 😞 |
To be clear, with my one line change, prior to using: I first use c to copy the highlighted text into the paste buffer. Every place I use this, I initially get a pop-up window asking if The other fix I saw for this required using newer/different version of Ideally it would be great to not need to manually copy the highlighted |
I have no familiarity with MacOS, so I have no idea what one might do about clipboard permissions or what any of that really even means. But if I understand you correctly at the end there, you're wondering how to automagically pull a GUI text selection? I think that would likely be beyond the scope of vim-anywhere and I expect would not even be practically possible to do well across all the supported operating systems. The ugly duct tape way that comes to mind though on Linux would be to wrap vim-anywhere to use xdotool or equivalent to send ctrl+c (or whatever combo will copy things) as key events before launching vim-anywhere with clipboard reading functionality. Maybe there is an xdotool-equivalentish utility on Mac? It's an inelegant and fragile solution, and I wouldn't bother with it, but if you're really hurting for that behavior you might give something like it a go. |
I'm not sure if Automator can do this. But would be great if there was a condition for any selected text to be brought in to vim for editing.
The text was updated successfully, but these errors were encountered: