Bump version
Cleanup
Fixed up lots of signature syntax highlighting
Please send an email to ~pranshu/perl-ts-mode@lists.sr.ht with bug or patch. You can view archives of the mailing list here.
This is a major mode for perl, designed to be similar to cperl-mode. The major difference is that this mode uses a parser(done by treesitter) to provide it's features, instead of it based all on regexps.
If you just, want to see how the colour looks like, go to https://p.bauherren.ovh/stuff/test.pl.html .
Just execute the following code and you should be ready to go.
(add-to-list 'treesit-language-source-alist
'(perl . ("https://github.com/tree-sitter-perl/tree-sitter-perl" "release")))
(add-to-list 'treesit-language-source-alist
'(pod . ("https://github.com/tree-sitter-perl/tree-sitter-pod" "release")))
(treesit-install-language-grammar 'perl)
(treesit-install-language-grammar 'pod)
Should be pretty intutive, you use M-e and M-a to navigate around PODs. This package also provides proper sexp navigation for perl. In the following code:
my $r = join '-', @arr + 2 - 1;
The sexps (circle bracket), and sentence[square bracker] would be:
[((my) ($r)) = ((join) '-', (((@arr) + (2)) - (1)));]
Commands like C-M-b
, C-M-f
, M-e
, M-a
will reflect on this. It
makes moving around seem more fun and cool.
The imenu settings should work as expected, similar to how cperl-mode does it.
The outline-mode (outline-minior-mode) is top notch, better than cperl.
(setq outline-minor-mode-cycle t)
There are 3 ways to make this mode better in order of preference:
As of 2025-01-06, the treesit ranges are unstable. Also being worked on.
Due to some major perfomance issues with the grammer, it is not advisable to use this if you will be working on large files. As of 2025-01-21, these are being worked on rapidly.
list
in perl-ts-thing-settings
.