Force linewise visual mode

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Force linewise visual mode

Bertram Scharpf
Hi,

is there a way to force a marco switching to linewise visual
mode? What I mean is to define either of

  :vmap <Fx> d
  :vmap <Fx> Vd

depending on whether charwise/block or linewise visual mode
had selected the area.

Or is it just superfluous because you can alway say
something like

  :vmap <Fx> :d<cr>...

where '<,'> will be inserted automatically?

Bertram


--
Bertram Scharpf
Stuttgart, Deutschland/Germany
http://www.bertram-scharpf.de
Reply | Threaded
Open this post in threaded view
|

Re: Force linewise visual mode

Charles E Campbell Jr
Quoting Bertram Scharpf <[hidden email]>:

> is there a way to force a macro switching to linewise visual
> mode? What I mean is to define either of
>
>   :vmap <Fx> d
>   :vmap <Fx> Vd
>
> depending on whether charwise/block or linewise visual mode
> had selected the area.
> ...

You can't simply change the mode, but ex commands do always
work on the line-oriented range.  So, try

:vmap <Fx> :d<cr>

Regards,
Chip Campbell