On 17/10/10 15:11, esquifit wrote:
I'm using gVim 7.3 in Windows. I want to drag a (binary) file and drop
it onto gVim and have gVim do something with the file path (for
example pass it as argument to a function) rather than loading the
file contents into a buffer, which seems to be the default behaviour.
Is this possible?

I've observed that if you drag and drop a *folder* from Windows
Explorer onto gvim, then netrw is automatically invoked in this
folder, but maybe this is just a special case of loading files. I'm
specially interested in image files (jpeg, png, gif, etc).


If you drag something and drop it onto Vim, it will invoke the :drop command on it, which involves opening the first or only element in an existing window if it is already loaded in one, or else in a new window.

The following are "standard behaviour" in Vim versions compiled with +autocmd running in 'nocompatible' mode:
* "Editing a folder" invokes netrw on it.
* "Editing" a zip, xpi, tar.gz, etc. archive shows you its table of contents, then if you hit <Enter> on one of the elements, you'll see that element's contents in another window. When you close that window, any edits you made will be saved back in the archive. * For image files, you get the text code of an SVG file or the binary code of a binary image.

If you want to "open" a certain category of files "your own way", you must be able to identify them (by name or by path, but not by contents) before they are opened. Then you should define autocommands to do what you want to do (maybe at the BufReadCmd event), depending on which ex-commands you wish to support.


Best regards,
Tony.
--
Nothing is better than Sex.
Masturbation is better than nothing.
Therefore, Masturbation is better than Sex.

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Reply via email to