andri-ch / gotoword

vim plugin that gives users the possibility to write and access documentation about the word or expr. under cursor
GNU Lesser General Public License v3.0
0 stars 0 forks source link

Highlight contexts that are listed with :HelperWordContexts #33

Closed andri-ch closed 9 years ago

andri-ch commented 9 years ago

related to #32 Thus, the user clicks on it or presses "Enter" and the buffer would display the info from that context.

andri-ch commented 9 years ago

highlighted contexts act like hyperlinks in a browser, or like vim tags. This is useful: http://stackoverflow.com/questions/10670111/remap-nerdtree-double-click-to-t

The code below executes Helper cmd after a double click is done on the word under the mouse cursor:

noremap <2-LeftMouse> :Helper<cr>

This affects all buffers, but I want this behaviour only for the Helper buffer:

noremap <buffer> <2-LeftMouse> :Helper<cr>

But this makes all words on which I double click to call Helper, so I want this behaviour only for some words (the words that are already highlighted):

noremap <buffer> <2-LeftMouse> :call g:Gotoword_make_links()<cr>

where Gotoword_make_links() takes word under cursor and if it is a link it will call Helper.

andri-ch commented 9 years ago

solved with commit d0d36721c3ff5ae1cf05fe6e2a7f6d9509b3522f