Closed henry-hsieh closed 5 years ago
Maybe you could set 'completefunc'
instead and use i_CTRL-X_CTRL-U
when you want to use that second plugin?
Or even better, the Supertab plugin includes a completion chaining option:
set completefunc=syntaxcomplete#Complete
autocmd FileType verilog_systemverilog
\ if &omnifunc != '' |
\ call SuperTabChain(&omnifunc, "<c-u>") |
\ endif
I have to be honest though, I tried this and it didn't work in a verilog_systemverilog FileType file, so it is possible something in my syntax makes it incompatible.
I use completefunc
in replacement of omnifunc
and use following vim script:
set completefunc=syntaxcomplete#Complete
let g:omni_syntax_group_include_verilog_systemverilog = 'verilog\w\+'
Because syntax group name of verilog_systemverilog are beginning with verilog, e.g., verilogStatement, you need to set g:omni_syntax_groupinclude{filetype} beginning with verilog.
However, using Supertab will cause some problems. Using another key mapping or dictionary completion may be a better solution.
Did you end up choosing any solution that you might want to share for other people to use?
I think dictionary completion is a good solution. Add following statement in .vimrc to enable dictionary completion.
autocmd FileType verilog_systemverilog set dictionary+=~/.vim/dict/verilog_systemverilog_keyword
autocmd FileType verilog_systemverilog set dictionary+=~/.vim/dict/verilog_systemverilog_system
autocmd FileType verilog_systemverilog set dictionary+=~/.vim/dict/verilog_systemverilog_directive
autocmd FileType verilog_systemverilog set dictionary+=~/.vim/dict/verilog_systemverilog_synopsys
autocmd FileType verilog_systemverilog set iskeyword+=36
The contents of these files are very simple.
Thanks for sharing!
@henry-hsieh ,can you share the 4 dictionary files with me ,greatly appreciate crystallang624@gmail.com
Vim has provided the syntax completion. Howerver, it uses omnifunc to complete SystemVerilog keywords, which conflict with this repo. My solution is adding SystemVerilog keywords to dictionaray and using dictionaray completion. Do you have better idea of this?