#
sublime-f5-irules
[](https://github.com/ArtiomL/sublime-f5-irules/releases)
[](https://github.com/ArtiomL/sublime-f5-irules/commits/master)
[](https://github.com/ArtiomL/sublime-f5-irules/graphs/code-frequency)
[](https://github.com/ArtiomL/sublime-f5-irules/issues)
[](https://www.sublimetext.com/3)

[](https://packagecontrol.io/packages/F5%20iRules)
[](/LICENSE)
## Description
Sublime Text package for F5 iRules syntax highlighting and auto-completion.
## Installation
#### [Package Control](https://packagecontrol.io/packages/F5%20iRules)
This is the recommended way to install the package. Package Control will install the latest release on your system and keep it up to date:
* Make sure Package Control is [installed](https://packagecontrol.io/installation)
* Open the **_Command Palette_** from the main menu of Sublime Text (Tools → Command Palette or ⌘+⇧+P)
* Start typing: `Package Control: Install Package` and select the command to show a list of all available packages
* Type: `F5 iRules` and select it to install the package
#### Manual (Windows, Linux, macOS)
* [Download](https://github.com/ArtiomL/sublime-f5-irules/archive/master.zip) the **master** branch archive
* Open the **_Packages_** directory from the main menu of Sublime Text (Preferences → Browse Packages...)
* Extract the archive into its own folder under the _Packages_ directory
#### Git
> Linux:
```shell
cd ~/.config/sublime-text-3/Packages
git clone https://github.com/ArtiomL/sublime-f5-irules.git
```
> macOS:
```shell
cd ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/
git clone https://github.com/ArtiomL/sublime-f5-irules.git
```
## Color Scheme
Please use the **_MonokaiRule_** theme included in this package for optimal highlighting experience.
Otherwise, add the following scopes to your current color scheme:
| Scope | Suggested Color |
| :------------------------ |:---------------:|
| keyword.name.event.irule | #66D9EF |
| keyword.control.irule | #7FE22A |
| keyword.operator.irule | #FF971F |
| keyword.log.irule | #F19090 |
| keyword.disabled.irule | #FF0000 |
| variable.other.irule | #AE81FF |
| command.httpheader.irule | #88FFFF |
Example:
```xml
scope
keyword.name.event.irule
settings
foreground
#66D9EF
```
## Filetypes and Syntax Association
The package syntax is used for `.irule` files by default.
Using the `.txt` extension is also supported: the first line of the file should begin with the following sequence:
```
#!iRule
```
Or you can set the syntax manually:
* Open the **_Command Palette_** from the main menu of Sublime Text (Tools → Command Palette or ⌘+⇧+P)
* Start typing: `Set Syntax: iRule` or `ssir` and select the command to activate it
## Snippets
Code snippets are small blocks of reusable code that can be inserted into a file to avoid repetitive typing.
Start typing one of the following:
```tcl
ACCESS
class
HTTP
for
foreach
if
ILX
log
set
switch
when
```
and select the _command..._ from the context menu (Tab).
## Pseudo-Validation
Highlighting for a specific scope will be disabled (to indicate an **_error_**) based on the following set of rules:
#### Spaces
- Only a single space should be used between the highlighted commands, arguments and operators
#### Events
- The **_when_** statement can't start with a whitespace
- Only a single space should be used between the **_when_** keyword and the **_EVENT_NAME_**
- The **_EVENT_NAME_** should only contain capital letters, underscores and numerals 2 and 7 (for _ACCESS2_POLICY_EXPRESSION_EVAL_ and _IN_DOSL7_ATTACK_)
#### More
- In development