Gentoo Archives: gentoo-user

From: Stroller <stroller@××××××××××××××××××.uk>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Re: Commenting out multiple lines in vim
Date: Sat, 14 Feb 2009 06:02:23
Message-Id: C78D77A0-50CB-4955-A393-991DCB89038A@stellar.eclipse.co.uk
In Reply to: Re: [gentoo-user] Re: Commenting out multiple lines in vim by daid kahl
1 On 14 Feb 2009, at 05:03, daid kahl wrote:
2 >>>
3 >>> Is there any way to access the vim buffers from other than vi?
4 >>> Using Konsole, if I want to copy something from vim I have to
5 >>> highlight with the mouse and right click, which is annoying. I
6 >>> really just want a better way to copy from Konsole that doesn't
7 >>> involve right click. At least shift+insert works for pasting from
8 >>> elsewhere...
9 >>>
10 >> Do you want to copy without using right-click (i.e. copy upon mouse
11 >> select) or copy without using the mouse at all? I assume the
12 >> latter, but that was not my initial reaction when I read "I really
13 >> just want a better way ... that doesn't involve right click".
14 >
15 > Haha, either one. I guess ideally it would be neat to be able to
16 > copy from Konsole without using the mouse at all, but I'd settle for
17 > mouse highlight and keystroke. Since I use a laptop with a
18 > touchpad, the highlighting isn't a huge hand motion away from the
19 > keyboard. Though, strtictly speaking, this thread is on vim, and I
20 > like to copy from vim more than Konsole anyway (except for like
21 > compile bugs, which I guess I could access through vim and the log
22 > files).
23
24 I can certainly answer copying using mouse but without needing to click.
25
26 I started to write this before I realised the other possibility:
27
28 IMO terminal emulators should copy on selection, as was the
29 traditional
30 X11 style. This is clearly undesirable behaviour in most any other
31 application - in a word-processor or email program you may want to
32 highlight a selection of text which you want to paste over, and
33 it's no use trying that when doing so overwrites the clipboard -
34 but that doesn't ever apply to terminal applications.
35
36 Surely Konsole should offer a copy-upon-selection option?
37
38 I then realised that it was daft to ask this question without Googling
39 it and quickly found this thread:
40 http://forums.whirlpool.net.au/forum-replies-archive.cfm/718984.html
41
42 The last post gives the answer, I think.
43
44 It must surely be possible to access the clipboard API at the command
45 line & create a vim command that passes the highlighted text to it,
46 but I have no idea how.
47
48 Stroller.