Skip to main content

Editor Setup

Get syntax highlighting for AILANG in your favorite editor.

The easiest way to install editor support is via the AILANG CLI:

# Install for VS Code
ailang editor install vscode

# Install for Vim
ailang editor install vim

# Install for Neovim
ailang editor install neovim

# Check installation status
ailang editor status

The CLI embeds all editor files, so it works from anywhere after ailang is installed.

VS Code

CLI Install

ailang editor install vscode

Then restart VS Code or run Developer: Reload Window (Cmd+Shift+P on Mac, Ctrl+Shift+P on Windows/Linux).

Manual Install

  1. Copy the extension folder to your VS Code extensions:

    # macOS/Linux
    cp -r .vscode/extensions/ailang ~/.vscode/extensions/

    # Windows (PowerShell)
    Copy-Item -Recurse .vscode\extensions\ailang $env:USERPROFILE\.vscode\extensions\
  2. Restart VS Code

Troubleshooting

Colors not showing?

  1. Check file has .ail extension
  2. Check bottom-right of VS Code shows "AILANG" as language
  3. Try "Developer: Reload Window" (Cmd+Shift+P)
  4. Check for conflicting extensions

Extension not loading?

# Verify extension is installed
ls ~/.vscode/extensions/ | grep ailang

# Check VS Code output for errors
# View > Output > Extension Host

Vim

CLI Install

ailang editor install vim

Manual Install

cp -r editors/vim/* ~/.vim/

Files with .ail extension will automatically use AILANG syntax highlighting.

Neovim

CLI Install

ailang editor install neovim

Manual Install

# macOS/Linux
cp -r editors/vim/* ~/.config/nvim/

# Windows
Copy-Item -Recurse editors\vim\* $env:LOCALAPPDATA\nvim\

Sublime Text

Copy syntaxes/ailang.tmLanguage.json to your packages directory:

PlatformPath
macOS~/Library/Application Support/Sublime Text/Packages/User/
Linux~/.config/sublime-text/Packages/User/
Windows%APPDATA%\Sublime Text\Packages\User\

TextMate

Double-click syntaxes/ailang.tmLanguage.json to install.

Other Editors

Most modern editors that support TextMate grammars can use the syntaxes/ailang.tmLanguage.json file. Consult your editor's documentation for adding custom language support.

Syntax Highlighting Features

The grammar supports all AILANG language features:

FeatureExample
Comments-- comment or // comment
Keywordslet, letrec, func, match, if, then, else, type
Booleanstrue, false
Primitive typesint, float, bool, string, char, unit
Effect typesIO, FS, Net, Clock, Env, Rand, Debug, AI
Standard typesOption, Result, List, Tuple, Array
Strings"hello", 'c'
Numbers42, 3.14, 0xFF
Lambdas\x. x + 1
Operators->, =>, ::, ++, !, |
ADTstype Option[a] = Some(a) | None
Modulesmodule examples/hello
Importsimport std/io (println)
Exportsexport func main()

Managing Installations

# Check what's installed
ailang editor status

# Uninstall from an editor
ailang editor uninstall vscode
ailang editor uninstall vim
ailang editor uninstall neovim

Updating

When you update AILANG, the embedded editor files are updated too. Simply re-run:

ailang editor install vscode

This will replace the old extension with the new version.

AILANG uses operators like =>, ->, ::, and \ (lambda). Programming fonts with ligatures render these as beautiful single glyphs:

CharactersLigatureAILANG Usage
=>Match arms
->Function types
::Cons, type annotations
++Append
\λLambda
!=Not equal
<= >=≤ ≥Comparisons
FontInstallNotes
Fira Codebrew install --cask font-fira-codeMost popular
JetBrains Monobrew install --cask font-jetbrains-monoExcellent readability
Cascadia Codebrew install --cask font-cascadia-codeMicrosoft's font

VS Code Settings

Add to your settings.json:

{
"editor.fontFamily": "Fira Code, Menlo, Monaco, monospace",
"editor.fontLigatures": true
}

Vim/Neovim

Set in your terminal emulator (iTerm2, Alacritty, etc.) - Vim uses the terminal's font.