visual mode popup menu ?

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

visual mode popup menu ?

M Kelly
Hi,

Is there a way to be in visual mode with some text highlighted and popup a menu and keep the highlighted text during and after the popup menu ?

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].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/2c64134b-229e-421d-b1c9-0aef4a40bd6e%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: visual mode popup menu ?

Andy Wokula
Am 27.04.2020 um 02:37 schrieb M Kelly:
> Hi,
>
> Is there a way to be in visual mode with some text highlighted and
> popup a menu and keep the highlighted text during and after the popup
> menu ?
>
> thx, -m

I would think it could make sense for some popup menu entries, but not all ...
how about an example?

You can override specific menu entries.

For what to override, see
     :vmenu PopUp
     :split +/PopUp/ $VIMRUNTIME/menu.vim

For example, original:
     :vnoremenu 1.30 PopUp.&Copy "+y
modified (see vimrc below) (do not modify in-place):
     :vnoremenu PopUp.&Copy "+ygv

" ------------------------------------------------
" in the vimrc ... more work for delayed execution
augroup KellyVimrc
augroup END

au! KellyVimrc VimEnter * call s:OverrideMenu()

func! s:OverrideMenu()
     vnoremenu PopUp.&Copy "+ygv
     " ... more ...
endfunc

"" for reloading ...
"if !has('vim_starting')
"   doau <nomodeline> KellyVimrc VimEnter
"endif


--
Andy

--
--
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].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/5EAAF40C.80905%40yahoo.de.
Reply | Threaded
Open this post in threaded view
|

Re: visual mode popup menu ?

M Kelly
Andy, hi again

I was thinking of something like -

    call popup_menu(g:menulist, #{ title: 'MyMenuTitle:', filter: 'MyFilter', callback: 'MyCallback' })

I would highlight some code and then press a key to trigger the popup menu and select some option from that menu,
but when the menu pops I didn't want to lose the visual highlighting.
Perhaps I can do something like exe normal gv as part of the popup ??

I wasn't thinking of vmenu - is that available at the cursor location ?  I will read up on it.

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].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/29ce641c-b422-4023-99e5-1bf3eb84aaf0%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: visual mode popup menu ?

M Kelly
Andy, hi

I think it does work if I add the exe normal gv in the popup func.
cool!

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].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/bd143494-6e0f-453c-82aa-173306fa258e%40googlegroups.com.