Can I use different tag files for omnicomplete and general tag viewing in Vim?

I have been using ctags in Vim for years, but I just opened omnicomplete. (Seems good.)

However, I have a problem: for omnicomplete to work correctly, I have to use the -extra = + q option when creating tags, which is good, but that then changes the behavior of the general tag view so that I don't like it.

For example, when the tag names for filling tabs in Vim I don’t want to mark in the “hierarchy” of classes, that is, when the “Clas” tab gets “ClassA, ClassA :: var1, ClassA :: var2, ClassB” instead of “ClassA, ClassB” - but this happens when using --extra = + q.

So, I think I will send one of two things. Or: 1. The ability to disable the tab in the "tag hierarchy", even if these hierarchies exist in the tag file. Or, 2. The ability to use differently named tag files (that is, Generated with various parameters) for omnicomplete and general tag viewing.

Any ideas would be much appreciated!

Greetings

thoughton.

+3
source share
2 answers

OK, I think I really came up with the answer to my question.

First, I generate two tag files: tags_c_vim and tags_c_omni.

In my _vimrc, I have:

let tags_vim='tags_c_vim'
let tags_omni='tags_c_omni'

exe "set tags=".tags_vim

to set some variables that point to different tag files, and set the "vim" tags as default tags.

, _vimrc:

imap <F8> <ESC>:exe "set tags=".tags_omni<CR>a<C-X><C-O>
autocmd InsertLeave * if pumvisible() == 0|exe "set tags=".tags_vim|endif

F8, "omni", omnicomplete, "vim" , .

, , , , .

, :

  • "omni" omnicomplete C-X, C-O F8. ( , , omni # cpp # maycomplete # Complete(), , )
  • "vim" omnicomplete

, , .

,

thoughton.

+1
0

Source: https://habr.com/ru/post/1732331/


All Articles