Ⅰ. 插件描述
Vim plugin for Bluespec SystemVerilog (BSV)Ⅱ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'mtikekar/vim-bsv'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'mtikekar/vim-bsv'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'mtikekar/vim-bsv'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/mtikekar/vim-bsv
Ⅳ. 文档说明
# Vim plugin for Bluespec SystemVerilog (BSV)
- Syntax highlighting
- Autoindent
Autocomplete options:
- From dictionary of words: ctrl-x ctrl-k
- From
imported files: ctrl-x ctrl-i - Above options are simply settings for vim's builtin
'complete'feature. Make it more useful with plugins like supertab or autocomplpop.
Move between matching keywords (%) with vim's built-in matchit plugin. Enable the plugin in vimrc:
if !exists('g:loaded_matchit') runtime! macros/matchit.vim endif- Open
imported file: In normal mode, pressgf(goto file) with cursor over file name. - Code snippets for snipmate, or new snipmate
- Rules for endwise
Features involving imported files use vim's path option to look for the files. There are several ways to do this:
- Per project:
set exrc secure, put a .vimrc in your project folder withset path=... - Per file:
set modeline, put a comment at the beginning of your code// vim:path=... - Can export the per file setting globally with:
autocmd BufWinEnter *.bsv if &l:path != '' | let &path = &l:path | endif - roll your own file format that can be read by both vim and your build script
Do :help path, :help exrc, :help modeline for more info.
I prefer the last option. In my top-level source folder, I have a file called "bsvpath". In vimrc:
function! BSVSetPath(srcdir)
let pathfile = a:srcdir . '/bsvpath'
if filereadable(pathfile)
set path=
for line in readfile(pathfile)
if line =~# '^[^$/]'
let line = simplify(a:srcdir . '/' . line)
endif
execute "set path+=" . line
endfor
endif
endfunction
autocmd FileType bsv call BSVSetPath(expand('<afile>:p:h'))