Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Autocomplete Systemverilog in VIM

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

like image 988
Vineeth Avatar asked Jul 16 '26 15:07

Vineeth


1 Answers

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.

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

  2. "Auto indenting" should happen automatically. If you want "formatting", select a few lines and press =.

  3. Modify the autocommand above:

    augroup Systemverilog
        autocmd!
        autocmd FileType systemverilog setlocal omnifunc=syntaxcomplete#Complete foldmethod=indent
    augroup END
    
like image 53
romainl Avatar answered Jul 26 '26 19:07

romainl



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!