Re: bind a key to multiple commands in copy mode

2011-05-18 Thread Randy Stauner
not a problem. thank you very much! On Wed, May 18, 2011 at 11:07 AM, Nicholas Marriott < nicholas.marri...@gmail.com> wrote: > Applied to OpenBSD now, thanks, with some tweaks. Sorry for the delay. > > On Sat, Apr 30, 2011 at 12:16:01PM -0700, Randy Stauner wrote: > >Dave's original command

Re: bind a key to multiple commands in copy mode

2011-05-18 Thread Nicholas Marriott
Applied to OpenBSD now, thanks, with some tweaks. Sorry for the delay. On Sat, Apr 30, 2011 at 12:16:01PM -0700, Randy Stauner wrote: >Dave's original command highlighted the line(s), >but did not immediately copy it (you still had to hit Enter). >We may not need both commands, but I w

Re: bind a key to multiple commands in copy mode

2011-05-10 Thread Dave Disser
Yes, I goofed it up spectacularly! Here's the correct patch. --Dave On Fri, Apr 29, 2011 at 1:40 PM, Randy Stauner wrote: > is this patch missing something? > it looks awfully short and doesn't make sense to me... it just looks like a > line was moved up. > It doesn't apply to sf cvs and if i j

Re: bind a key to multiple commands in copy mode

2011-05-10 Thread Dave Disser
I decided I didn't like my kludge. Here's a proper copy-line with working prefix arg. I also have another patch to use a single function for begin-selection and copy-selection since I like to have both bound to the same key, if anyone's interested. --Dave On Thu, Apr 28, 2011 at 6:49 PM, Randy

Re: bind a key to multiple commands in copy mode

2011-04-30 Thread Randy Stauner
Dave's original command highlighted the line(s), but did not immediately copy it (you still had to hit Enter). We may not need both commands, but I wanted to respect Dave's contribution. I didn't want to remove the select-only version if that functionality was desirable to anyone so I renamed his t

Re: bind a key to multiple commands in copy mode

2011-04-30 Thread Nicholas Marriott
If copy and select line are the same surely there is no need for both? Also please use C89 block comments (/* */) not C++ comments. On Sat, Apr 30, 2011 at 11:24:18AM -0700, Randy Stauner wrote: >Sorry about that. >Attached is a full patch containing Dave's initial work >and my addit

Re: bind a key to multiple commands in copy mode

2011-04-30 Thread Randy Stauner
Sorry about that. Attached is a full patch containing Dave's initial work and my additions for: select-line, copy-line, and copy-end-of-line. Let me know if you'd prefer incremental patches or if you need them based off of a different point in the source history. Thanks! On Sat, Apr 30, 2011 at 3:

Re: bind a key to multiple commands in copy mode

2011-04-30 Thread Nicholas Marriott
I only seem to be getting half of this exchange, where is this patch? On Fri, Apr 29, 2011 at 04:45:34PM -0700, Randy Stauner wrote: >I added copy-end-of-line on top of the last two patches. >In copy mode it selects from the cursor to the end of the line, then >copies and exits. >

Re: bind a key to multiple commands in copy mode

2011-04-29 Thread Randy Stauner
I added copy-end-of-line on top of the last two patches. In copy mode it selects from the cursor to the end of the line, then copies and exits. Is that what you were thinking Nicholas? I tested it in vi and emacs mode, it works for me. I bound it to D (vi) and C-k (emacs) to be consistent with edi

Re: bind a key to multiple commands in copy mode

2011-04-29 Thread Randy Stauner
Very nice! I will use this. I must admit I still find myself too lazy to want to hit Enter afterwards, though, since this only selects the lines. I did think the feature might be useful, though, so I changed your function to 'select-line' and defined 'copy-line' to additionally copy the selection

Re: bind a key to multiple commands in copy mode

2011-04-29 Thread Randy Stauner
is this patch missing something? it looks awfully short and doesn't make sense to me... it just looks like a line was moved up. It doesn't apply to sf cvs and if i just add the line it won't compile. Is there some other patch i need to apply first, or is this for a different branch or is the patch

Re: bind a key to multiple commands in copy mode

2011-04-29 Thread Nicholas Marriott
I'd like to see copy-line-to-end like C-k in emacs. On Thu, Apr 28, 2011 at 08:11:53AM -0700, Randy Stauner wrote: >With: >bind-key Y send-keys '^' Space '$' Enter >I can hit prefix + Y in copy-mode and get it to copy the line. >Not an optimal solution, but an acceptable workarou

Re: bind a key to multiple commands in copy mode

2011-04-28 Thread Randy Stauner
thanks for the idea. I definitely must applaud the effort. you've given me an idea for the 5Y option... if i ever take it any further i'll write back. On Thu, Apr 28, 2011 at 12:55 PM, Dave Disser wrote: > I *just* subscribed now, but I was wrestling with nearly the same problem > yesterday. He

Re: bind a key to multiple commands in copy mode

2011-04-28 Thread Dave Disser
I *just* subscribed now, but I was wrestling with nearly the same problem yesterday. Here's my kludge of rebinding with unprefixed keys. Hard to follow, I know, but the gist is that when entering copy mode it rebinds y and Enter (unprefixed) to source scripts. The scripts in turn do actions and

Re: bind a key to multiple commands in copy mode

2011-04-28 Thread Randy Stauner
With: bind-key Y send-keys '^' Space '$' Enter I can hit prefix + Y in copy-mode and get it to copy the line. Not an optimal solution, but an acceptable workaround. Of course now I remember that that sequence used to be repeatable (5Y to copy 5 lines)... that may be a bit trickier to recreate. It

Re: bind a key to multiple commands in copy mode

2011-04-22 Thread Micah Cowan
On 04/22/2011 05:26 PM, Randy Stauner wrote: > I first tried using send-keys (bind-key -t vi-copy send-keys ^ ' ' $ Enter) > but send-keys isn't a valid command in copy-mode. Drop the -t vi-copy; you want to use a normal-map binding so you can use the normal-map command (of course, this means you'

Re: bind a key to multiple commands in copy mode

2011-04-22 Thread Randy Stauner
I first tried using send-keys (bind-key -t vi-copy send-keys ^ ' ' $ Enter) but send-keys isn't a valid command in copy-mode. On Fri, Apr 22, 2011 at 5:20 PM, Randy Stauner wrote: > I can bind a key in copy mode (bind-key -t vi-copy Y end-of-line), > but I haven't yet found a way to bind a single

bind a key to multiple commands in copy mode

2011-04-22 Thread Randy Stauner
I can bind a key in copy mode (bind-key -t vi-copy Y end-of-line), but I haven't yet found a way to bind a single key to multiple copy-mode commands... Specifically I am trying to recreate a key I used in screen a lot... in copy mode Y would just copy the whole current line... so for tmux I was t