Dear Vimers,

How do I do something like the following:
"
if(defined(tags))
  return "\<c-x>\<c-]>"
endif
"
The tags-variable is the one set by :set tags="./tags".

How do I get the above to work?

Many thanks in advance!
Asis

My Background is the following:
Programming in Ruby I am using ctags in order to get tag-based completion.
I want to configure the supertab-plugin to use also <C-x><C-]>
(tag-completion).
The manual states:
"
 In addition to the default completion contexts, you can plug in your own
  implementation by creating a globally accessible function that returns
  the completion type to use (eg. "\<c-x>\<c-u>").

    function MyTagContext()
      if filereadable(expand('%:p:h') . '/tags')
        return "\<c-x>\<c-]>"
      endif
      " no return will result in the evaluation of the next
      " configured context
    endfunction
    let g:SuperTabCompletionContexts =
        \ ['MyTagContext', 's:ContextText', 's:ContextDiscover']
"
I don't want to check, if the tags-file is readable, I want to check if the
variable is set, because the rails-plugin sets it to ./tmp/tags and in other
contexts it might be something else again..

-- 
Asis Hallab
Rothehausstr. 6 - 12
50823 Köln

Skype: asis.hallab.cgn
Fest (Köln) 42346046
Mobil  (O2) 0176 63370211
Fax 01212 - 5 - 30697106

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

Reply via email to