简体   繁体   中英

gVim/Vim - how do I write vim buffer into a new (non vim) window?

This might not be strictly a vim question, but here goes. I have a proprietary IDE I'm working in, without any vim characteristics. I do, however, have keybindings.

My "diabolical plan" is to create a keybinding in the IDE (say Windows + V) to select all in the current buffer window in the IDE, open a gVim window, and dump the file into the window (perhaps setting filetype as well, but let's not get too fancy)

So the keybinding works to get it INTO a vim buffer - but how can I set up vim (either with a plugin or 3rd party tool) to grab the buffer on a:write and update the file in the IDE I launched it from?

Doable? Fool's errand?

If it's just about the IDE editor: write a Visual Studio Addon .

If you want to make this transparently work for any application (like "It's all text." that @xofon mentions)... World Domination!

As long as you can worry that this is a fool's errand, I already know you're not going to finish it. Geniuses go after their goals against all odds. Oh, and they reach them, of course. On-topic: I think you can manage this for selected standard controls only (and you'll run into walls especially as Windows is growing security awareness these days).

On WinNT/2000 and earlier it was as 'simple' as creating DLL injection, hooking window procs for the related controls and doing the grunt-work. Nowadays, I'm not so sure this is going to work without hitches. You'll run into process isolation issues, WOW isolation, clipboard sharing idiosyncrasies, Citrix/Terminal server sessions. So: I hope you are convinced you want to mount these kind of challenges. If so, I'm all for it. It would be great to have Vi support on windows surpassing that on any platform. <dreams/>

You might have a look at the docs for IME (Input-Method Editing). I'm afraid this won't let you achieve modal editing, really.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM