Ⅰ. 插件描述
Vim extensions for programming in NASLⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'tenable/vim-nasl'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'tenable/vim-nasl'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'tenable/vim-nasl'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/tenable/vim-nasl
Ⅳ. 文档说明
vim-nasl
Vim extensions for programming in NASL.
Installation can be done through [Vundle] or your favourite vim plugin manager.
Alternatively, for a bare-bones or custom install, just clone this repo and copy these folders (indent, syntax, syntax_checkers) into ~/.vim, then proceed with the instructions below.
Syntax Highlighting
Add the following to your .vimrc:
let nasl_space_errors = 1
autocmd BufNewFile,BufRead *.audit set syntax=xml
autocmd BufNewFile,BufRead *.nasl set filetype=nasl
autocmd BufNewFile,BufRead *.inc set filetype=nasl
autocmd BufNewFile,BufRead *.inc set indentexpr=To set the recommended formatting settings for NASL files, add this too:
autocmd FileType nasl setlocal shiftwidth=2 tabstop=2 expandtab softtabstop=2 colorcolumn=120[Syntastic]
Currently, Syntastic support is provided by nasl -XLW (from the nessus package) or nasl-parse parse (from the nasl gem). Ensure that one of these is in your path to enable the syntax checker.
If you want to use both syntax checkers, you might want to add something like this to your .vimrc:
let g:syntastic_nasl_checkers = ['nasl_parse', 'nasl']This will first run your file through nasl-parse and then, if no errors were found, run it through nasl.
[Tagbar]
Instructions here: https://github.com/majutsushi/tagbar/wiki#nasl.
Tagbar integration is very crude so far. The simple, regex method has many limitations, so a true parser method would be a huge improvement.