C-v to toggle between v-block/visual ?

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

C-v to toggle between v-block/visual ?

M Kelly
Hi,

Anyone know of a way to vnoremap <C-v> to toggle between visual and v-block modes ?  As it is now for me, <C-v> from visual mode goes to v-block mode (which is great), but press <C-v> again and it exits all visual modes, I would like it to just toggle it back to visual mode and update the selection.

thx for the vim universe,
-m

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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: C-v to toggle between v-block/visual ?

Christian Brabandt

On Di, 20 Nov 2018, M Kelly wrote:

> Anyone know of a way to vnoremap <C-v> to toggle between visual and
> v-block modes ?  As it is now for me, <C-v> from visual mode goes to
> v-block mode (which is great), but press <C-v> again and it exits all
> visual modes, I would like it to just toggle it back to visual mode
> and update the selection.

Something along this perhaps?

xnoremap <expr> <c-v> mode()=="\<c-v>"?"V":"\<c-v>"


Best,
Christian
--
Warum ist der Schwanz des Eichhörnchens hinten?
Weil vorne schon das Eichhörnchen ist.

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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: C-v to toggle between v-block/visual ?

M Kelly
> Something along this perhaps?
>
> xnoremap <expr> <c-v> mode()=="\<c-v>"?"V":"\<c-v>"

Thank you.  To follow-up how do we know to V or v (how visual was originally started) ?  Is that possible ?

take care,
-m

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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: C-v to toggle between v-block/visual ?

M Kelly
Hi,

> Thank you.  To follow-up how do we know to V or v (how visual was originally started) ?  Is that possible ?

Can I get mode() as V or v and save it to restore ?  I will try.

thx again,
-m

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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: C-v to toggle between v-block/visual ?

M Kelly

> Can I get mode() as V or v and save it to restore ?  I will try.

Yes, perhaps with visualmode() :-)

thx,
-m

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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: C-v to toggle between v-block/visual ?

Ruben Safir
On 11/20/18 1:50 PM, M Kelly wrote:
> Yes, perhaps with visualmode() :-)
which is poison


--
So many immigrant groups have swept through our town
that Brooklyn, like Atlantis, reaches mythological
proportions in the mind of the world - RI Safir 1998
http://www.mrbrklyn.com

DRM is THEFT - We are the STAKEHOLDERS - RI Safir 2002
http://www.nylxs.com - Leadership Development in Free Software
http://www2.mrbrklyn.com/resources - Unpublished Archive
http://www.coinhangout.com - coins!
http://www.brooklyn-living.com

Being so tracked is for FARM ANIMALS and and extermination camps,
but incompatible with living as a free human being. -RI Safir 2013

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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.