Skip to content

oxidecomputer/p4-ts-mode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

p4-ts-mode: An Emacs Major Mode for P4 Using Tree-sitter

P4 (P4_16) mode for emacs using tree-sitter.

This mode uses tree-sitter, requiring Emacs 29+'s treesit package for syntax highlighting and code navigation.

If you're running an Emacs that's older than 29 or a version compiled without treesit, we'll eventually provide a fallback mode.

gif of files

Installation

Currently this project is not yet on MELPA, but you can fetch and install it directly through this repository, depending on your package manager/builder of choice.

quelpa

(quelpa '(p4-ts-mode :repo "oxidecomputer/p4-ts-mode" :fetcher github))

Doom Emacs

(package! p4-ts-mode :recipe (:host github :repo "oxidecomputer/p4-ts-mode"))

straight.el

(straight-use-package
 '(p4-ts-mode :type git :host github :repo "oxidecomputer/p4-ts-mode"))

Setup

Once installed, you can we recommend use-package to load the package and setup any configuration.

(use-package p4-ts-mode
  :mode (rx ".p4" eos)

;; If you're using Doom Emacs, you can add the following to your `config.el` file:
;; (use-package! p4-ts-mode)

Tree-sitter Grammar

Unless you have the P4 tree-sitter grammar installed and treesit knows what path to find it, you'll want to run:

M-x p4-ts-install-grammar

This will download the grammar and compile it for you.

Note: This requires a C compiler to be installed on your system.

Contributing

p4-ts-mode is still a work in progress.

To contribute, just open a pull request!

Useful links

About

P4_16 mode for emacs using treesitter

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published