clicked cword

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

clicked cword

Xavier Noria
I'd like to map <A-LeftMouse> to :tag <cword>, handy when doing a walkthrough where you don't type.

But <cword> is the word under the cursor. Is there a way to get the clicked word or identifier? Bonus points if the cursor doesn't move.

--
--
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: clicked cword

Xavier Noria
For the archives: I realized you can use <LeftMouse> in the RHS of the mapping, this is working well:

nmap <silent> <A-LeftMouse> <LeftMouse>:exe 'tag ' . expand('<cword>')<CR>


--
--
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: clicked cword

Xavier Noria
On Sun, Sep 17, 2017 at 12:49 AM, Xavier Noria <[hidden email]> wrote:

For the archives: I realized you can use <LeftMouse> in the RHS of the mapping, this is working well:

nmap <silent> <A-LeftMouse> <LeftMouse>:exe 'tag ' . expand('<cword>')<CR>

Even simpler, since <LeftMouse> makes the clicked word the cword, that can be simplified leveraging existing commands. My current map is

nmap <silent> <A-LeftMouse> <LeftMouse>g<C-]>



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