cknadler / vim-anywhere Goto Github PK
View Code? Open in Web Editor NEWUse Vim everywhere you've always wanted to
License: MIT License
Use Vim everywhere you've always wanted to
License: MIT License
Sorry, I probably miss something very obvious but anyway:
So, that's the point then? :) Sure, I can assign a system-wide hotkey to open a new Vim buffer, paste there anything I want, edit, copy to clipboard, and paste the anywhere I want. vim-anywhere seems to save me just one keypress, am I wrong?
I used to :sav ~/path/to/filename.rb
and then :Gist
to upload it to githubgist. But it does not change the file name and used doc-140503064838.
Is there anyway I can change the file name?
Thanks in advance.
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.
I wrote a short two-paragraph text on vim-anywhere which I saved and closed and was ready to paste it on my blog post. The resulting view was an conjoined wall of text.
P.S: I love your work. vim-anywhere is indispensable for me now!
Is there a way to speed up opening MacVim by disabling animations specifically for that instance.
For example, if I wanted to edit this issue with vim, I would use the shortcut I set up and I expect this text to be present in editor when it starts; however, it is not, the buffer is empty.
Not to be a complainer (I love the idea of this), I realize this will be difficult to make work for all input fields. Various system's accessibility apis expose this information, so maybe something could be done with that?
I do realize that a trivial workaround is to to select the entire text field, copy, activate vim anywhere, and paste, but this is many steps, and context–such as cursor position–is lost.
versus
Potentially, the same accessibility apis may allow the original text field to be populated simultaneously with the vim buffer (I recall a browser plugin+editor plugin that required this sort of information exchange to update css live as it was editted in vim or sublime).
See this gist for the crash log... Fresh install, relatively recent build of MacVim.
Is there any default file like .vimrc
that is sourced automatically on starting vim via vim-anywhere (along with .vimrc
and .gvimrc
)? I'm currently quite happy with editing ./bin/run
, adding -c
or -s
options by hand, but I'd feel more comfortable if this application had such default file to write my preferences in.
One might want to source additional file on starting vim via vim-anywhere because the context it's usually used is somewhat different from usual editing with vim. As for me, I'd prefer white background because most websites have white backgrounds. One might want to set default filetype
to markdown, or enable plugins designed specifically for text editing, not coding (I'm thinking of something like vim-quotable).
When I try to use vim-anywhere in the Mail app on OS X 10.11 El Capitan, I get an error dialog saying
"The action “Run Shell Script” encountered an error."
Let me know if you need more information.
Hi,
Thank you a lot for this little app :)
Is it possible, just before opening Vim to do a "select all, copy, then paste in buffer" all contents present in the field of "primary apps" ?
For example, I start what I think it will be a simple comment on a website.
After 5 lines I realize that I will be more confortable on Vim.
I want all this previous text to be in Vim.
Good bye.
Is that mean I can use keyboard shortcuts of vim on applications other than vim? If it is, why it can't work on my linux desktop?
Sorry if i bother you guys but i have some questions.
Thanks
Need to write some tests for install
, uninstall
, update
, and run
.
Just installed it but doesn't seem to be working with Ubuntu 12.04. The shortcut works and the window pops open. I write something, run ":wq" but my text does not get copied over.
All scripts should accept a debug flag such as:
--debug
to pipe all output to stdout for debugging purposes.
Related: #9
Title says it all. No possible solutions were explored.
As soon as the install script is executed my current session crashes and when I try to login it crashes again. I have a pretty much fresh install of Ubuntu 17.10 so hopefully it's not just some weird setup of mine that produced the error.
Here is a relevant excerpt from /var/log/syslog
:
Nov 14 23:20:49 coffee gnome-session[6082]: gnome-session-binary[6082]: WARNING: App 'org.gnome.SettingsDaemon.MediaKeys.desktop' respawning too quickly
Nov 14 23:20:49 coffee gnome-session-binary[6082]: WARNING: App 'org.gnome.SettingsDaemon.MediaKeys.desktop' respawning too quickly
Nov 14 23:20:49 coffee gnome-session-binary[6082]: Unrecoverable failure in required component org.gnome.SettingsDaemon.MediaKeys.desktop
Nov 14 23:20:49 coffee gnome-session[6082]: gnome-session-binary[6082]: CRITICAL: We failed, but the fail whale is dead. Sorry....
Nov 14 23:20:49 coffee gnome-session-binary[6082]: CRITICAL: We failed, but the fail whale is dead. Sorry....
Nov 14 23:20:49 coffee org.a11y.atspi.Registry[1301]: XIO: fatal IO error 11 (Resource temporarily unavailable) on X server ":0"
Nov 14 23:20:49 coffee org.a11y.atspi.Registry[1301]: after 21 requests (21 known processed) with 0 events remaining.
Nov 14 23:20:49 coffee kernel: [ 2291.925365] rfkill: input handler enabled
Nov 14 23:20:49 coffee gdm3: GdmDisplay: display lasted 2.453852 seconds
Nov 14 23:20:49 coffee nautilus[6292]: Error reading events from display: Broken pipe
Nov 14 23:20:49 coffee org.gnome.Shell.desktop[6113]: could not connect to wayland server
Nov 14 23:20:49 coffee org.gnome.Shell.desktop[6113]: (EE)
Nov 14 23:20:49 coffee org.gnome.Shell.desktop[6113]: Fatal server error:
Nov 14 23:20:49 coffee org.gnome.Shell.desktop[6113]: (EE) Couldn't add screen
Nov 14 23:20:49 coffee org.gnome.Shell.desktop[6113]: (EE)
The install script changes this MediaKeys
variable:
media_keys=org.gnome.settings-daemon.plugins.media-keys
custom_kbd=org.gnome.settings-daemon.plugins.media-keys.custom-keybindings
kbd_path=/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/vim-anywhere
gsettings set $media_keys custom-keybindings "['others', '$kbd_path']"
gsettings set $custom_kbd:$kbd_path name $name
gsettings set $custom_kbd:$kbd_path binding $binding
gsettings set $custom_kbd:$kbd_path command $action
I fixed my issue with the following:
media_keys=org.gnome.settings-daemon.plugins.media-keys
gsettings reset $media_keys custom-keybindings
So I was unable to test out vim-anywhere
. I would love to try again at some point, it looks great! 😄
I would love to know if the bug is reproducible by others.
I am not using bash shell is it a problem? I can start vim by going to the folder and using ./run. however I can not set up the keybinding
Hi,
I tried using vim-anywhere but I haven't been successful so far. How do I debug ?
If I try to run ~/.vim-anywhere/bin/run
manually I am presented with an error 👍 'chmod: cannot access `/tmp/vim-anywhere/doc-131231154454': No such file or directory', however gvim does open.
Am I right to expect that when you have completed editing text and put :wq to quit the macvim, then in the web page editor I can see the pasted back text?? I am not seeing anything after I issued :wq to quit editing.
How to fix the issue?
Stephen
Hello!
When i use cyrillic and then paste it, i have a problem.
For example, i write:
Привет, test
And then paste:
–ü—Ä–∏–≤–µ—Ç, test
Hi Chris,
thanks for taking your time to enhance Vim's ecosystem with such a useful plugin. What nags my mind is that such a feature already exist in vimperator and I can not figure out the difference.
Pressing <C-i>
in any input field will invoke GVim where you can edit the text and by closing it, it will automatically insert the text in the field.
Does your plugin does something more than that? If yes, it isn't clear, maybe just add the link to Vimperator and try to explain the difference more cleanly.
Best wishes from Berlin,
Matthias
When I close Macvim window with :wq
the text is not pasted back into the original window. Why this may happen?
A picture paints a thousand words:
Macbook pro late 2015. Vanilla macvim (homebrew - macvim 7.4-86).
The GIF and pictures could use a bit of a high res update. If anyone is interested in re-creating them but at a higher resolution, I'd happily accept a pull request.
vim-anywhere should support GVim and some window managers in Linux.
VimR nightly builds are for all intents and purposes macvim with neovim, while neovim-gnome-terminal-wrapper might work for linux (not a linux user).
For now I'm using a if has('nvim')
in my .vimrc
for macvim compatibility, but it would be nice to get rid of that stuff.
If an operating system is supported by the installer, the install script must:
There are several operating systems where it seems like this isn't really possible. So far, these are:
There should be a link from the README to documents describing how to get vim-anywhere working on operating systems not supported by the installer.
Just install here in my Ubuntu 13.04 and tried ctrl+alt+v
, but nothing happens...
I use Vim but less on MacVim and almost all on terminal vim-nox. Wonder if it is possible to open terminal version of vi.
https://github.com/cknadler/vim-anywhere/blob/master/install#L105
This seems rather dangerous to me. I'm not terribly familiar with gsettings
, but it looks as if this line is making assumptions about the groups of settings in the specified key.
Also, does the key name have to be that long? Can we just go with something like vim-anywhere
?
Any way to set default filetype for new files? For example, I mostly use
vim-anywhere
to write in markdown
and need to set ft=markdown
any time
a new Vim window opened.
For now I use the custom autocommand in my .vimrc
to force set filetype for
vim-anywhere
files:
augroup ft_vim_anywhere
au!
au BufNewFile,BufRead **/vim-anywhere/doc-** setl ft=markdown
augroup END
Why not set filetype to text
or markdown
by default?
If I were to type in vim-anywhere:
"First
Second
Third"
This will copy/paste correctly on the command line as 3 different commands, it copy/paste fine in this issue box as well as 3 lines. But it did not work in gmail when writing email, which is showed up all on the same line. So I'm not sure if this is an issue with vim-anywhere or maybe how different text boxes handle newline characters.
First, the install script gave me a bunch of errors. Here's the transcript:
$ curl -fsSL https://raw.github.com/cknadler/vim-anywhere/master/install | sh
sh: 22: [: -a: unexpected operator
sh: 30: [[: not found
sh: 53: [[: not found
Installing vim-anywhere...
Cloning into '/home/michel/.vim-anywhere'...
remote: Counting objects: 165, done.
remote: Compressing objects: 100% (93/93), done.
remote: Total 165 (delta 87), reused 138 (delta 60)
Receiving objects: 100% (165/165), 242.88 KiB | 0 bytes/s, done.
Resolving deltas: 100% (87/87), done.
Checking connectivity... done
sh: 84: [[: not found
sh: 91: [[: not found
vim-anywhere has been successfully installed!
After running that, it was installed, but running it first gave me this error:
./.vim-anywhere/bin/run
chmod: cannot access ‘/tmp/vim-anywhere/doc-131230173218’: No such file or directory
./.vim-anywhere/bin/run: line 16: xclip: command not found
So I installed xclip
and was left with this:
./.vim-anywhere/bin/run
chmod: cannot access ‘/tmp/vim-anywhere/doc-131230173243’: No such file or directory
I tested it later using bash:
$ curl -fsSL https://raw.github.com/cknadler/vim-anywhere/master/install | bash
Cleaning up previous installation...
vim-anywhere requires gconftool to function.
Now it's gone? :'(
On a side-note: this was written in vim :) I use it to edit about anything...
Thanks for a great app!!!
Hi,
great work on this app :)
I had an idea, wouldn't it be great if vim-anywhere copied the clipboard of the user just before overwriting it with the text entered in vim. So that after a 10 second configurable timeout starting when the vim file is closed the clipboard could be re copied from its backup.
I hope I'm clear. What do you think ?
PS : I'm guessing you'll have to pay attention to the behavior when multiple vim-anywhere session are open at the same time, and if one is reopen before the end of the timeout. :)
Hi, great work! However, it is Windows that needs VIM integration the most. After all, Windows doesn't even COME with a decent editor or shell. It would be neat to have Vim-Anywhere work with the Mobaxterm/Cygwin package, which by extension, includes vim. Anyway, that is how I endure the corporate Win7 "development" laptop at my day job.
Looks like the trickest part of doing this in Windows will be setting up the keybinding. Likely it will be a manual step similar to how you have to set it up in the Apple system settings. Perhaps a Windows installer would create a desktop icon with a "Shortcut Key" defined, and then that would launch the bin/run file (or a *.bat equivalent if we want to avoid the Cygwin dependency) to get things going. Just some ideas, I'll look around!
See #65 for details.
I don't use brew but would love to use this!
The copy-paste process b0rks Umlauts.
When I use vim-anywhere
to write some text (see this short screencast) the umlauts are not returning correctly from the buffer.
On pasting I get ä
for ä, √∂
for ö and √º
for ü.
In the corresponding file in /tmp/vim-anywhere
the characters are saved correctly...
OS X "10.10.2 (14C109)", MacVim "Custom Version 7.4 (73)" installed via brew install macvim
and vim-anywhere
installed immediately after reading about it on one thing well.
There are no installation instructions for Windows, so I guess it doesn't work.
However, I found a hint here
http://usevim.com/2014/01/01/vim-anywhere/
that it might work, by using Autohotkey. If that's the case, it would be amazing if you could add installation instructions.
Upon running the install script, a default keyboard shortcut should be set for invoking vim-anywhere on OSX.
I have absolutely no idea how to do this.
gconftool
is officially deprecated. We should try to use dconf
first, then fall back to gconftool
if it isn't installed.
gconf has been deprecated in Gnome 3.
So basic install on Gnome 3.10 results in:
▸ curl -fsSL https://raw.github.com/cknadler/vim-anywhere/master/install | bash vim-anywhere requires gconftool to function
It would be nice to add support for dconf, I'll see if I can make a patch.
This is a pretty commonly requested feature.
When vim-anywhere is invoked:
This should be implemented as an alternate keybinding. Something like ctrl+cmd+c
(OSX) or ctrl+alt+c
(Linux). The current functionality of ctrl+cmd+v
shouldn't change at all.
Error is the following.
vim-anywhere requires mvim to function
Run `brew install macvim`.
Do I have to uninstall Macvim.app and install through brew?
Thanks in advance.
In case there's any interest in including documentation for configuring the key binding in other window managers, here's how to set up the key-binding in i3wm.
Add the following line to ~/.i3/config
:
bindsym $mod+Alt+v exec ~/.vim-anywhere/bin/run
Remember to reload i3wm, for the new configuration to take effect. This is bound to $mod+shift+r
, by default.
If interested in including this information, feel free to assign this ticket to me, and I can submit a patch to the README.
Just installed and updated in Ubuntu Gnome 14.04, I have gvim installed and am running the clipboard manager Parcellite.
When writing in vim-anywhere everything works well. When I write and exit the /tmp/vim-anywhere directory is updated but the text is not seen on the clipboard and is not available for pasting.
When using vim-anywhere in the past (with Ubuntu 13.10 and KDE) it worked well with Parcellite. Now I can't seem to get the text from vim-anywhere onto the clipboard. Any thoughts?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.