Syntax highlighting or syntax coloring
In 0.84 you could switch between styles in View -> Styles ->
Starting from 0.85 the option moved to Tools -> Preferences -> Appearance -> Style ->
You can also create your own style:
To set up a custom syntax highlighting scheme, you create a .yml file that defines a mapping from syntactic elements to colors. The easiest way to create your own scheme is probably to copy an existing style file (for instance, default.yml) from the share/styles/ folder of Padre. Put it in styles subdirectory of your padre configuration directory, and then modify it. Padre checks this folder on start-up and adds any styles in the YAML files there to the list of available styles.
You can find out where is the Padre configuration directory on your computer by looking at Help -> About -> System Info -> Config
=head2 Syntax highlighting
Padre is using L<Wx> (aka wxPerl), wxWidgets for GUI and Scintilla for the editor. Scintilla provides very good syntax highlighting for many languages but Padre is still bound by the version of Scintilla included.
The F<share/styles/default.yml> file is the mapping between the Scintilla defined constants for various syntactical elements of each language and the C<RGB> values of the color to be used to highlight them.
Adding new syntax highlighting
TO DO does this stuff below really belong here?
Need to define constants in Padre::Util to be in the Padre::Constant namespace.
Need to add the color mapping to share/styles/default.yml
Need to implement the Padre::Document::Language class.
Need to define the MIME type mapping in Padre::Document
For examples see Padre::Document::PASM, Padre::Document::PIR and Padre::Document::Perl.
- SyntaxHighlightingTable -draft
- In Tools/Preferences/Files? and Colors Select File Type: Perl 5 Select Highlighter: Scintilla
- Using File/Open? open the file t/files/no_strict.pl
- The status bar at the bottom should now show: the name of the file | Scintilla | Perl 5 | (and some more)
- In Tools/Preferences/Files? and Colors Select File Type: Perl 5 Select Highlighter: PPI Experimental
- Viewing the already open no_strict.pl file the status bar at the bottom should now show: the name of the file | PPI Experimental | Perl 5 | (and some more) The coloring of the code has changed.
- In Tools/Preferences/Files? and Colors Select File Type: Perl 5 Select Highlighter: PPI Standard
- Viewing the already open no_strict.pl file the status bar at the bottom should now show: the name of the file | PPI Standard | Perl 5 | (and some more)
Who Padre version system status szabgab r13895 Ubuntu 10.10 OK
- add screenshots with default highlighting of the various syntax highlighers
- other programming languages
- syntax highlighting (coloring):
- HTML export #112
- for many languages