I'd like to plant a number of @tags (e.g. @sea_ice, @models) in my markdown files when editing in vim. Currently I'm using SuperTab to tab-complete ordinary words. However if I hit <tab> after the @ symbol, it won't give me a list of all @tags, but rather a long list of all words found in the current context.
I noticed that SuperTab allows custom context definitions, however, as I know nothing about vim scripting and the documentation contains only 2 examples, I'm unable to script it myself.
After bit searching around I think I probably need to define a new custom omni complete function, specifically the 2nd half of the function:
function! TagComplete(findstart, base)
if a:findstart
" locate the start of the word
let line = getline('.')
let start = col('.') - 1
while start > 0 && line[start - 1] != '@'
let start -= 1
endwhile
return start
else
" find @tag
let res = []
????
????
endif
return res
endif
endfun
This is the code I'm working on. But I don't know how to test it or where is the right place to put it. Please help
Thanks

After quite a bit of struggling and searching for help, I figured out one solution.
Firstly create a
completefuncthat searches for@tagsin the current file (Credits to cherryberryterry: https://www.reddit.com/r/vim/comments/4dg1rx/how_to_define_custom_omnifunc_in_vim_seeking/):The put the following in
.vimrcto setup tab-completion using SuperTab: