Git Product home page Git Product logo

zeek-sublime's Introduction

zeek-sublime

Zeek syntax highlighting definitions for Sublime Text and TextMate.

Sublime Text Installation

Package Control

Install the "Zeek Language" package. Highlighting will automatically be provided for files ending in .zeek or .bro.

Manual Installation

Go to Preferences -> Browse Packages, and then either download this repo's contents to a directory named Zeek or use this command:

git clone https://github.com/zeek/zeek-sublime Zeek

Updating the Syntax Files

The Zeek.YAML-tmLanguage file is the one to edit. The others are generated from it with help from the PackageDev package, which you must first install. For example:

  • With Zeek.YAML-tmLanguage open in SublimeText run command: PackageDev: Convert (YAML, JSON, PList) to...

  • With Zeek.tmLanguage open in SublimeText run command: Plugin Development: Convert Syntax to .sublime-syntax

You can add syntax test cases to syntax_test.zeek and, with that file open, execute them by running the command: Build With: Syntax Tests

zeek-sublime's People

Contributors

cstruck avatar jsiwek avatar pchaigno avatar pingtrip avatar sethhall avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

zeek-sublime's Issues

tmPreference file for sublime block commenting

Not sure how this can be auto generated by packageDev, if at all, but dropping the following into the package gives access to commenting/block commenting, in sublime.

Comments (Zeek).tmPreferences

<?xml version="1.0" encoding="UTF-8"?>
<plist version="1.0">
<dict>
    <key>name</key>
    <string>Comments</string>
    <key>scope</key>
    <string>source.zeek</string>
    <key>settings</key>
    <dict>
        <key>shellVariables</key>
        <array>
            <dict>
                <key>name</key>
                <string>TM_COMMENT_START</string>
                <key>value</key>
                <string># </string>
            </dict>
            <dict>
                <key>name</key>
                <string>TM_COMMENT_DISABLE_INDENT_2</string>
                <key>value</key>
                <string>yes</string>
            </dict>
        </array>
    </dict>
</dict>
</plist>

IPv6 subnets not colored correctly

The regular expression used to color the IPv6 subnet type does not include the ones place of the subnet mask sometimes. Examples are [100::]/64, [64:ff9b::]/96, and [2001:db8::]/32.

This blog post provides a good regexp. I modified it to replace all occurences of "d" with [0-9], removed the two occurences of "s" (not sure their purpose), and added the brackets surrounding the IPv6 address to conform to Bro's standard representation.

Probaby a bit of modifying necessary since I haven't tested it myself, but regex101 liked it. Thanks for this syntax plugin!

Here it is: ^[((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])(.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])(.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])(.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])(.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])(.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])(.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])(.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])){3}))|:)))(%.+)?(]/([0-9]|[0-9][0-9]|1[0-1][0-9]|12[0-8]))$

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.