在VIM中自动完成Systemverilog

3
我正在使用VIM作为SystemVerilog的编辑器。我有三个问题。
在一些帖子中,我看到了VIM的自动完成功能。
1.如何在VIM中为我的Systemverilog文件启用自动完成功能?
2.如何自动缩进所选部分?
3.如何在VIM中启用折叠功能?
我正在使用由Nachum Kanovsky创建的插件来编辑Systemverilog。
2个回答

4

为了避免意外情况,确保在你的~/.vimrc文件中添加以下两行:

filetype plugin indent on
syntax on

假设已安装并正确使用链接插件,则将为每种支持的语言提供适当的缩进和语法突出显示。
  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
    

谢谢你的帮助。 但是缩进没有起作用。 我是否需要在vimrc中添加:set folding indent? - Vineeth

2

请尝试使用我的verilog_systemverilog.vim分支,我正在尝试实现这个功能。

注意:此功能仍有限制,请开启问题请求功能和/或报告错误。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接