Skip to content
Syntax Highlighting for the AMPL modelling language
Branch: master
Clone or download
Latest commit 5a5d749 Mar 10, 2015
Type Name Latest commit message Commit time
Failed to load latest commit information.
AMPL.json-tmLanguage Fix bad match on s.t. Mar 10, 2015
AMPL.sublime-build Typo .lim changed to .ilm Sep 3, 2013
AMPL.tmLanguage Fix bad match on s.t. Mar 10, 2015
Comments.tmPreferences Add register comment keys so Toggle Line/Block Comment works Mar 10, 2015
LICENSE Initial commit Aug 14, 2013 Typo Sep 3, 2013

AMPL package for Sublime Text 2

Provides syntax highlighting for the AMPL modelling language (.mod, .dat and .run files).


Using Sublime Package Control (recommended): If you have installed Sublime Package Control, you can easily install the AMPL Language package via the Package Control: Install Package menu item (shortcut: CTRL+SHIFT+P). Search for AMPL Highlighting in the list.

Without Git: Download the latest source zip from github and extract the files to your Sublime Text "Packages" directory, into a new directory named AMPL.

With Git: Clone the repository in your Sublime Text "Packages" directory:

git clone git:// AMPL

The "Packages" directory is located at:

  • OS X: ~/Library/Application Support/Sublime Text 2/Packages/
  • Linux: ~/.Sublime Text 2/Packages/
  • Windows: %APPDATA%/Sublime Text 2/Packages/

You can access it through the menu in Preferences > Browse Packages...


On OS X, further configuration is needed in order for license files to be found (the environment variables need to be added manually to the sublime-build file). Create a file in Packages/User named AMPL.sublime-build with the following content:

            "ILOG_LICENSE_FILE": "path/to/access.ilm"

Replace path/to/access.ilm with the actual path to your ILOG license file.

AMPL language

AMPL, an acronym for "A Mathematical Programming Language", is an algebraic modelling language for describing and solving high-complexity problems for large-scale mathematical computation (i.e. large-scale optimization and scheduling-type problems).

AMPL is available from


This package adds syntax highlighting for all built-in functions, as well as strings, numeric values (including Infinity), and function arguments.

Comments are also highlighted. In AMPL, line comments are started by #, and block comments are delineated by /* */.

To solve an AMPL model, ctrl+B (Build) will invoke AMPL on the .run file for the model. This can be done from any of the files for the model, provided that the .run script shares the same name as the current file e.g. building example.mod would invoke AMPL on


This package is a port of the AMPL highlighting scheme for VIM. If there are any issues or suggestions to do with the highlighting, please let me know.

You can’t perform that action at this time.