Nmap Development mailing list archives

Re: Modules for vim/emacs


From: David Fifield <david () bamsoftware com>
Date: Tue, 2 Nov 2010 18:50:06 -0700

On Tue, Nov 02, 2010 at 08:29:00PM -0500, Ron wrote:
In the latest revision of my sample script, I added modelines to the top:
http://nmap.org/svn/docs/sample-script.nse

Specifically:
-- -*- mode: lua -*-
-- vim: set filetype=lua :
-- The preceding lines should be left intact to help vim/emacs do syntax
-- highlighting

Basically, they tell vim/emacs that it's a lus file, despite the
extension being .nse. The first thing I do when I start working on NSE
on a new box is update my vim syntax file appropriately, but I'm
guessing that not everybody knows how to do that so having a hint to
the editor that it's a lua file could be handy. 

I've tried adding this to a ~/.vimrc:

au BufNewRead,BufRead *.nse set filetype=lua

That doesn't solve the problem of having to do it on every new machine,
but it's less invasive than editing the syntax file.

David Fifield
_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://seclists.org/nmap-dev/


Current thread: