Sunday, September 4, 2011

Re: Problem with text drag-and-drop from browser to gvim

On 09/04/2011 12:40 PM, Marty Fried wrote:
> On Sun, Sep 4, 2011 at 8:40 AM, AK <andrei.avk@gmail.com
> <mailto:andrei.avk@gmail.com>> wrote:
>
> Hi,
>
> I often need to copy and paste snippets of text from webpages into gvim.
> The easiest way to do this is to highlight and drag and drop text.
> Unfortunately, gnome "helpfully" adds all kinds of tags
> around the text (when using chrome; adds ^@ chars with Firefox). Other
> programs like gedit, abiword, terminal only get the text dropped without
> tags.
>
> How can I get plain text in Gvim?
>
> I know that I can set up a mapping to strip tags, but I hope there's a
> way to do this automatically.
>
> Personally I find it easier to cut and paste rather than drag and drop.
> That doesn't require that both windows be visible at the same time,
> and I feel I have more control over where it goes. Seems more like the
> "vim way", too.


I find it much easier to drag and drop in this instance, because in
99.9% of cases both of my windows are visible, because I do coding
with browser open to the side of gvim, and I start insert mode
at the right spot beforehand.


I think the issue is that Gvim sets itself up as a DnD text target
that accepts formatting. There doesn't seem to be a way to tweak
this outside of vim code.

Does anyone know what code I need to change in Gvim itself? Or is
there an easier way?


-ak

--
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

No comments: