Hi,
On Thu, Aug 16, 2018 at 2:16 PM, David Briscoe
<[email protected]> wrote:
> I'm not sure if the opposition in #1628 to allowing tagfunc to be
> asynchronous is a roadblock, but I thought I'd suggest a simpler
> alternative: add a :push analog to :pop.
>
I think it will be more flexible to add a VimL function to push and pop file
location information from the tag stack along with a tag name.
Regards,
Yegappan
>
> Allowing plugin writers (i.e., jedi, omnisharp) to :push symbol-name before
> jumping to 'symbol-name' would let them integrate with the tagstack. This
> approach wouldn't solve the "support CTRL-W ] and similar" problem or allow
> custom sources for :tselect.
>
> Here's a prototype of this in vimscript:
>
> let g:tagimposter_tagfile = get(g:, 'tagimposter_tagfile',
> '~/.vim-cache/imposter.tags')
>
> function! Tagimposter_setup()
> if exists("g:tagimposter_has_hookedup_tagfile")
> return
> endif
> let g:tagimposter_has_hookedup_tagfile = 1
>
> exec 'set tags+='. g:tagimposter_tagfile
> endf
>
> function! Tagimposter_pushtag(symbol)
> call Tagimposter_setup()
> let symbol = 'IMPOSTER_' . a:symbol
> " Tags are a symbol, a file, and a search expression.
> let tag_str = printf("%s\t%s\t/^%s$/;", symbol, expand("%:p"),
> getline('.'))
> exec "keepalt split +edit ". g:tagimposter_tagfile
> .,$delete _
> put! =tag_str
> write
> close
> exec 'tjump '. symbol
> endf
>
> command! -bar Push silent call Tagimposter_pushtag(expand("<cword>"))
>
> nnoremap <Leader>jT :<C-u> Push <Bar> OmniSharpGotoDefinition<CR>
>
> (I just pushed a slightly more complete version of this code as
> vim-tagimposter.)
>
> By implementing natively in vim, we could avoid the tempfile, messing with
> the user's 'tags', and the inaccurate symbol name.
>
> While not as full-featured as 'tagfunc', it looks like there's lots of
> interest in this base-level functionality:
>
> prabirshrestha/vim-lsp#49
> fatih/vim-go#667
> mhinz/vim-lookup#2
> Valloric/YouCompleteMe#1675
> natebosch/vim-lsc#89
> https://stackoverflow.com/questions/26291758/how-to-manually-push-stack-entry-into-vim-tagstack
> https://groups.google.com/forum/#!topic/rope-dev/2nU_iq09k2M
> http://lists.gnu.org/archive/html/help-global/2001-08/msg00004.html
>
--
--
You received this message from the "vim_dev" 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_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.