ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Modern​Perl

by Blaizer ALL

Perl syntax highlighting for Sublime Text that isn't outdated

Details

  • 2016.07.07.04.05.59
  • github.​com
  • github.​com
  • 8 years ago
  • 46 minutes ago
  • 11 years ago

Installs

  • Total 17K
  • Win 7K
  • Mac 5K
  • Linux 5K
Jul 26 Jul 25 Jul 24 Jul 23 Jul 22 Jul 21 Jul 20 Jul 19 Jul 18 Jul 17 Jul 16 Jul 15 Jul 14 Jul 13 Jul 12 Jul 11 Jul 10 Jul 9 Jul 8 Jul 7 Jul 6 Jul 5 Jul 4 Jul 3 Jul 2 Jul 1 Jun 30 Jun 29 Jun 28 Jun 27 Jun 26 Jun 25 Jun 24 Jun 23 Jun 22 Jun 21 Jun 20 Jun 19 Jun 18 Jun 17 Jun 16 Jun 15 Jun 14 Jun 13 Jun 12
Windows 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 2
Mac 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 2 0 0 0 0 0 0
Linux 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 1 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 2 1 1 0 0 0

Readme

Source
raw.​githubusercontent.​com

ModernPerl

Perl syntax highlighter for Sublime Text that isn't outdated

Description

ModernPerl is an updated Perl syntax highlighter for Sublime Text. It's a drop-in replacement for the outdated Perl.tmLanguage that comes default with Sublime Text. The name “ModernPerl” was mostly just chosen as a joke to follow the Modern::Perl buzzword thing. Well… it is a modern syntax definition for Perl, and among many bug fixes, it does implement some of Perl's new syntax.

It may be a bit tricky to get all your Perl files to open with the ModernPerl syntax. Make sure you read the Install section for the steps that might be required. In any case check that your files are opened with ModernPerl once it is installed. This information is shown on the far right of the status bar.

ModernPerl uses only the standard highlighting colors, so it should be compatible with your favorite theme. It was, however, designed and tested with the default Monokai theme, so it's most optimal with that.

Features

Compared to the original Perl.tmLanguage:

  • Huge update to //, s{}{}. See messages/2014.01.05.pl for details
  • Highlights functions as best as it can, so less stuff is white
  • Many different kinds of barewords are recognized so that they're not highlighted as functions
  • New Perl keywords such as say and state are recognized
  • Angle bracket readline/globs are recognized (<foo/* bar/*>)

As well as many other highlighting fixes and nuances.

Install

  1. Install this package with Package Control (or otherwise).
  2. In Sublime, use View > Syntax > Open all with current extension as… to reopen all current Perl files with ModernPerl.
  3. Fresh Perl files should automatically open with ModernPerl, while Perl files that have previously been opened with Sublime will tend to keep the syntax they were last opened with.

    To check this, open a Perl file that has never been opened with Sublime before (create a new .pl file if necessary), and check that it opens with ModernPerl.

  4. If fresh files do not open with ModernPerl, use Preferences > Settings – Syntax Specific – User on a file opened with ModernPerl to open up ModernPerl.sublime-settings and put the following into it:

    { "extensions": ["pl", "PL", "pm", "pod", "t"] }

  5. Whenever you open a Perl file that has previously been opened with Sublime, check which syntax it opens with, and manually switch it to ModernPerl if necessary.

Todo

  • Recognize interpolated characters in double quoted strings
  • Recognize metacharacters in regexes
  • Split up interpolation in repository more for better interpolation of tr, format, etc.
  • Support for multiple heredocs on one line
  • Further optimization and polish

Issues

If you find any bugs or want to suggest any improvements feel free to open an issue or send a pull request. You can also email me at blaizer@cpan.org. Before doing any of this, let me just repeat that you should check that your files are opened with ModernPerl.

License

© 2013-2014 Blaise Roth blaizer@cpan.org.

This is free software. It is licensed under the Creative Commons Attribution-ShareAlike 3.0 Unported License. Feel free to use this package in your own work. However, if you modify and/or redistribute it, please attribute me in some way, and distribute your work under this or a similar license.