This is a mode for syntax highlighting for Nextflow based on snakemake-mode. More features such as a popup runner, and better script editing planned in the future! Support for DSL2 is in the works also.
Two modes are provided:
nextflow-ts-mode— tree-sitter based mode for Emacs 29+ (recommended)nextflow-mode— regex-based fallback for older Emacs, built ongroovy-mode
nextflow-ts-mode uses the built-in treesit support with the tree-sitter-nextflow grammar. Install the grammar once (requires a C compiler):
M-x treesit-install-language-grammar RET nextflow RETLoading nextflow-ts-mode registers the grammar source automatically. When the grammar is installed, buffers in nextflow-mode are remapped to nextflow-ts-mode via major-mode-remap-alist.
In order to use the fallback nextflow-mode you’ll need to install these packages first:
This package is currently not on melpa yet. If you’re using Doom Emacs you can use this snippet to install the package.
(package! nextflow-mode :recipe (:host github :repo "emiller88/nextflow-mode"))- [X] Bash highlighting inside
script:blocks via tree-sitter language injection (script_contentnodes + an embedded bash parser) - [ ] Standalone
auto-mode-alistentries fornextflow-ts-modeso it activates without =nextflow-mode=/groovy-mode installed - [ ] Validate highlighting against real nf-core modules; feed parse failures back to tree-sitter-nextflow
- [ ] Decide
nextflow.confighandling for the tree-sitter mode - [ ] Emacs 30
treesit-thing-settings(sexp/sentence navigation) andwhich-funcintegration - [ ] MELPA packaging