poly-gams is an Emacs package that provides polymode support for GAMS (General Algebraic Modeling System), allowing for embedded Python and YAML code blocks within GAMS files. This package leverages polymode to enable seamless multi-mode editing.
- GAMS Mode: Syntax highlighting and editing support for GAMS code, inherited from gams-mode.
- Embedded Python: Syntax highlighting and editing support for Python code blocks embedded within GAMS files.
- Embedded YAML: Syntax highlighting and editing support for YAML code blocks embedded within GAMS files and used by GAMS Connect.
This package is available on MELPA. Using use-package, installation can be done by adding the following to your init.el
(use-package poly-gams
:ensure t)Once installed, poly-gams will automatically activate for files with the .gms extension.
With poly-gams | Without poly-gams | |
| Connect block | ![]() | ![]() |
| Python block | ![]() | ![]() |
poly-gams inherits keybindings from polymode, gams-mode, python-mode, and yaml-mode. Refer to the respective mode documentation for more information.
Currently, poly-gams does not expose customizable variables. The package is designed to work out of the box for most use cases. Refer to polymode, gams-mode, python-mode, and yaml-mode for customization.
Contributions are welcome! If you find a bug or have a feature request, please open an issue on the GitHub repository. Pull requests are also appreciated.
This project is licensed under the GNU General Public License v3.0. See the LICENSE file for details.



