https://github.com/tenable/vim-nasl
Vim extensions for programming in NASL
https://github.com/tenable/vim-nasl
Last synced: 4 months ago
JSON representation
Vim extensions for programming in NASL
- Host: GitHub
- URL: https://github.com/tenable/vim-nasl
- Owner: tenable
- Created: 2013-08-16T20:43:37.000Z (almost 13 years ago)
- Default Branch: master
- Last Pushed: 2022-05-31T16:37:24.000Z (about 4 years ago)
- Last Synced: 2024-12-31T08:13:24.073Z (over 1 year ago)
- Language: Vim script
- Size: 131 KB
- Stars: 9
- Watchers: 21
- Forks: 11
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
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`:
```vim
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 *.static set filetype=nasl
autocmd BufNewFile,BufRead *.inc set indentexpr=
```
To set the recommended formatting settings for NASL files, add this too:
```vim
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`:
```vim
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.
[Syntastic]:https://github.com/scrooloose/syntastic
[Tagbar]:https://github.com/majutsushi/tagbar
[Vundle]:https://github.com/gmarik/vundle