This repository provides a Sublime Text syntax highlighting file for Nearley, a simple, fast, and powerful parsing toolkit. The Nearley.sublime-syntax
file enables Sublime Text to recognize and highlight the syntax of Nearley grammar files (*.ne
) effectively.
The purpose of this syntax highlighting file is to enhance the readability and editability of Nearley grammar files by providing clear, context-aware highlighting rules tailored specifically for Nearley syntax and embedded JavaScript code.
To install the Nearley syntax highlighting for Sublime Text on macOS, follow these steps:
-
Clone or Download the Repository
- If you have git installed, you can clone this repository directly into your Sublime Text Packages directory using the following command:
cd ~/Library/Application\ Support/Sublime\ Text/Packages/ git clone https://github.com/yourusername/nearley-syntax-highlighting.git Nearley
- Alternatively, you can download the ZIP file of this repository, extract it, and move the contents to the appropriate directory.
- If you have git installed, you can clone this repository directly into your Sublime Text Packages directory using the following command:
-
Manual Installation
- If you prefer to install the syntax file manually, navigate to the following directory:
~/Library/Application Support/Sublime Text/Packages/
- Create a new folder named
Nearley
if it doesn't already exist. - Copy the
Nearley.sublime-syntax
file into theNearley
folder.
- If you prefer to install the syntax file manually, navigate to the following directory:
-
Activating the Syntax
- You may need to restart Sublime Text after installing the syntax file.
- Open a Nearley grammar file (with the
.ne
extension). - Sublime Text should automatically detect and apply the Nearley syntax highlighting. If it does not, you can manually select it from the bottom right corner of the window by clicking on the current syntax name (e.g., "Plain Text") and selecting
Nearley
from the list.
Contributions to improve the Nearley syntax highlighting are welcome. Please feel free to fork this repository, make your changes, and submit a pull request. Report any issues in the GitHub repository.
- Author: Andrea Alberti
- GitHub Profile: alberti42
- Donations: