GithubHelp home page GithubHelp logo

vim-nasl's Introduction

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 *.static 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

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.

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.

vim-nasl's People

Contributors

benbergman avatar halsteaw avatar alexwebr avatar xorrbit avatar mplough-tenable avatar lcd047 avatar jhammack avatar invisiblethreat avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.