Skip to content

Repository files navigation

Emacs Nextflow Mode

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 on groovy-mode

Tree-sitter mode (Emacs 29+)

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 RET

Loading 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.

Installation

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"))

Roadmap

  • [X] Bash highlighting inside script: blocks via tree-sitter language injection (script_content nodes + an embedded bash parser)
  • [ ] Standalone auto-mode-alist entries for nextflow-ts-mode so 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.config handling for the tree-sitter mode
  • [ ] Emacs 30 treesit-thing-settings (sexp/sentence navigation) and which-func integration
  • [ ] MELPA packaging

About

Emacs major mode for Nextflow

Topics

Resources

Stars

25 stars

Watchers

4 watching

Forks

Releases

Packages

Used by

Contributors

Languages