💄 [MIRROR] A Sublime Text 3+ syntax definition for your nftables rules https://git.io/Nftables
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Go to file
Samuel FORESTIER 9fd8077d9a Bumps to v2.1.0 7 months ago
.github Renames GitHub Actions workflow to prevent ST "All Syntaxes" oversight 1 year ago
.gitattributes Exclude syntax test files from package 7 months ago
CHANGELOG.md Bumps to v2.1.0 7 months ago
Comments.tmPreferences Allows source lines comment toggling (#1) 3 years ago
LICENSE So we finally got something here, let's draft a first commit ! 3 years ago
Nftables.sublime-build Renames project source files to match internal syntax name (`Nftables`) 3 years ago
Nftables.sublime-syntax Renames `storage.type.ct-expecation.nftables` to `storage.type.ct-expectation.nftables` 7 months ago
README.md README updates for Sublime Text 4 7 months ago
syntax_test_Nftables.nft Fixes `ct status { ... }` usages in rules 1 year ago



A Sublime Text 3+ syntax definition for your nftables rules



nftables should now be the regular way of handling Netfilter rules, and I was surprised not to find any syntax definition for Sublime Text.
This project aims to provide a "basic" one, as long as a building procedure for GNU/Linux users (when the nft binary is available for "dynamic" syntax checks).

This project has been inspired by the official nano syntax definition.
See the Scripting nftables Wiki page for external reference.


With Package Control

  1. Open your command palette and type in : Package Control: Install Package
  2. Browse the list or search for Nftables
  3. Press Enter and you're done !

Package Control dedicated page here.


  1. Move into Sublime Text packages folder (usually $HOME/.config/sublime-text/Packages/ or %AppData%\Sublime Text\Packages\)
  2. Clone this repository there : git clone https://github.com/HorlogeSkynet/Nftables.git
  3. Restart Sublime Text and... 🎉



  • Open your command palette and type in : Set Syntax: Nftables

  • Click on the bottom-right corner : Nftables

  • View > Syntax > Nftables


  • Open your command palette and type in : Build With: Nftables

  • Press CTRL + B

  • Tools > Build

Formats currently supported

  • nftables output
  • scripted configuration

Frequently Asked Questions

Do you plan to support the whole nftables syntax ?

No, but feel free to contribute.

Why does this syntax coloration s*cks ?

Well, sorry to hear that. Grammar wasn't my favorite course at school.
I'd be pleased to review any issue or pull request.

Why didn't you convert the official Bison parser to Sublime's definition syntax ?

It looks like such a tool does not exist (yet ?).

Would this plugin help me building a secure fire-wall ?

No, but I would advise you this blog post as a well-explained starting point, written by @tasn.

I've noticed you got an extensive tests suite, can I run it ?

Of course, open the Nftables.sublime-syntax file, press CTRL + Shift + B and choose Build With: Syntax Tests.