I am using VIM as the editor for SystemVerilog. I have three questions.
In some posts I saw there is a auto-complete function for VIM.
1.How can I enable auto-complete function for my Systemverilog files in VIM??
2.How can I auto-indent a selected portion in VIM?
3.How can I enable folding in VIM?
I am using plugin created by Nachum Kanovsky in VIM for Systemverilog
Just in case, make sure you have these two lines in your ~/.vimrc:
filetype plugin indent on
syntax on
Assuming the linked plugin is installed and working correctly this will get you proper indenting and syntax highlighting for every supported language.
I can't find a Systemverilog-specific omnicompletion script on vim.org but you can still use basic syntax-based completion. Add these lines to your ~/.vimrc:
augroup Systemverilog
autocmd!
autocmd FileType systemverilog setlocal omnifunc=syntaxcomplete#Complete
augroup END
The completion menu is activated by pressing Ctrl+XCtrl+O in succession.
See :help ins-completion.
"Auto indenting" should happen automatically. If you want "formatting", select a few lines and press =.
Modify the autocommand above:
augroup Systemverilog
autocmd!
autocmd FileType systemverilog setlocal omnifunc=syntaxcomplete#Complete foldmethod=indent
augroup END
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With