Ernie Rael wrote:
Hi all,
I've just joined this list. I'm not a vim developer per se. However, I
put together jVi, http://jvi.sourceforge.net , whose core is a port of
some of vim to java. It runs on NetBeans ( and JBuilder, but not
supported any more). jVi is based on vim-5.6.
A jVi user has added visual char/line and is now tackling block. So now
I want to setup access to the *real* vim clipboard, so blockmode paste
works between vim and jVi. So I'm learning how to access "native" data
formats in clipboard from java.
I couldn't get anything to work, so I looked at the vim7 source,
couldn't find windows source (I run cygwin, but not cygwin's vim, at
home). I downloaded extras. I now see that the clipboard name has
changed to VimClipboard2, and there's a whole lot more... So I changed
the name, but still no luck. I thought I'd ping this list in case anyone
has accessed the vim clipboard from java or has some clues.
As an experiment I'm doing
public static final String VIM_CLIPBOARD2 = "VimClipboard2";
SystemFlavorMap.addFlavorForUnencodedNative(
ViManager.VIM_CLIPBOARD2, Misc.VimClipboardDataFlavor.get());
and the other way around. But after a paste into jVi from vim the
DataFlavor I've defined is not available.
Any clues?
In os_mswin.c it looks like VimClipboard2 is always made available, so
it should be there somewhere.
Once I get something working, I'll look at doing all the various
encodings... based on VimClipboard2. Or maybe, I'll use VimClipboard2
just to find out if it is MCHAR/MLINE/MBLOCK. Then go to the regular
DataFlavors to pick the string type I'm looking for.
-ernie
IIUC, there is no specific interface between Vim and java, so java will have
to do whatever any other application may do, without special knowledge about Vim.
Whatever gvim writes to the + register is available in the system clipboard,
just as if you'd used "Edit => Copy" in just about any application. There's
nothing Vim-specific there.
Best regards,
Tony.
--
You know you have a small apartment when Rice Krispies echo.
-- S. Rickly Christian