unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* viper question
@ 2006-07-28 20:16 smudgef1
  2006-07-29 10:23 ` Lennart Borgman
       [not found] ` <mailman.4629.1154168642.9609.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 3+ messages in thread
From: smudgef1 @ 2006-07-28 20:16 UTC (permalink / raw)


Hello,

I'm trying to simulate vim's visual mode in viper. I have been somewhat
succesful using the pc-selection-mode. So far I just have

(define-key viper-vi-global-user-map (kbd "v") 'forward-char-mark)

With this setting, I can then use the viper navigation keys to select
more text (very similiar to vim). The only thing I need now is a
binding that will bind 'y' to yank the selected text. I need 'y' binded
to copy-region-as-kill-nomark (same thing alt-w is binded to), but only
when text is selected. Does anyone know how to do this?

This should work since the viper key 'p' already pastes what was copied
with alt-w.

Thanks!

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: viper question
  2006-07-28 20:16 viper question smudgef1
@ 2006-07-29 10:23 ` Lennart Borgman
       [not found] ` <mailman.4629.1154168642.9609.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 3+ messages in thread
From: Lennart Borgman @ 2006-07-29 10:23 UTC (permalink / raw)
  Cc: help-gnu-emacs

smudgef1@yahoo.com wrote:
> Hello,
>
> I'm trying to simulate vim's visual mode in viper. I have been somewhat
> succesful using the pc-selection-mode. So far I just have
>
> (define-key viper-vi-global-user-map (kbd "v") 'forward-char-mark)
>
> With this setting, I can then use the viper navigation keys to select
> more text (very similiar to vim). The only thing I need now is a
> binding that will bind 'y' to yank the selected text. I need 'y' binded
> to copy-region-as-kill-nomark (same thing alt-w is binded to), but only
> when text is selected. Does anyone know how to do this?
>
> This should work since the viper key 'p' already pastes what was copied
> with alt-w.
>
> Thanks!
>   
I do a similar thing with no additional key bindings at all:

1) I use cua-mode together with viper. I suppose the steps below also 
works with pc-selection-mode, but I am not sure.
2) I first select some characters.
3) Then I use the normal vi commands (w, j etc) to move the point. The 
selected region is extended as the point move.
4) To cut or copy I use "dr" or "yr".

However I am doing this in the not yet released version 22.0.50.1 of 
Emacs. I do not know if it works in older region.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: viper question
       [not found] ` <mailman.4629.1154168642.9609.help-gnu-emacs@gnu.org>
@ 2006-08-06 22:08   ` austin.wood
  0 siblings, 0 replies; 3+ messages in thread
From: austin.wood @ 2006-08-06 22:08 UTC (permalink / raw)



Lennart Borgman wrote:
> smudgef1@yahoo.com wrote:
> > Hello,
> >
> > I'm trying to simulate vim's visual mode in viper. I have been somewhat
> > succesful using the pc-selection-mode. So far I just have
> >
> > (define-key viper-vi-global-user-map (kbd "v") 'forward-char-mark)
> >
> > With this setting, I can then use the viper navigation keys to select
> > more text (very similiar to vim). The only thing I need now is a
> > binding that will bind 'y' to yank the selected text. I need 'y' binded
> > to copy-region-as-kill-nomark (same thing alt-w is binded to), but only
> > when text is selected. Does anyone know how to do this?
> >
> > This should work since the viper key 'p' already pastes what was copied
> > with alt-w.
> >
> > Thanks!
> >
> I do a similar thing with no additional key bindings at all:
>
> 1) I use cua-mode together with viper. I suppose the steps below also
> works with pc-selection-mode, but I am not sure.
> 2) I first select some characters.
> 3) Then I use the normal vi commands (w, j etc) to move the point. The
> selected region is extended as the point move.
> 4) To cut or copy I use "dr" or "yr".
>
> However I am doing this in the not yet released version 22.0.50.1 of
> Emacs. I do not know if it works in older region.

Hey thanks! This works great!

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-08-06 22:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-28 20:16 viper question smudgef1
2006-07-29 10:23 ` Lennart Borgman
     [not found] ` <mailman.4629.1154168642.9609.help-gnu-emacs@gnu.org>
2006-08-06 22:08   ` austin.wood

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).