jEdit Community - Resources for users of the jEdit Text Editor
Custom File Extensions: Enabling syntax highlighting and abbreviations for
Submitted by navin on Sunday, 4 October, 2009 - 18:34
Hello all,
Please forgive me for this newbie question. I have been using jEdit successfully for a while now to create PHP scripts. I have recently started using the CakePHP framework and intend to keep using jEdit as my primary editor. However, CakePHP requires PHP/HTML code in certain files that don't have names that end in the familiar .php extension. I'd like to enable PHP syntax highlighting and abbreviation support for such files. My question is: How do I get jEdit to use PHP mode for files that don't have names that end with the .php extension?

Thanks,
Navin
Comment viewing options
Select your preferred way to display the comments and click 'Save settings' to activate your changes.
Two Ways
by Robert Schwenn on Sun, 04/10/2009 - 20:45
There are two ways:

1. per buffer
You can insert a string like ":mode=php:" into the first and last 10 lines of every file that should be opened in php mode (see User's Guide - Buffer-Local Properties .

2. general
In the "catalog" file is defined, witch mode is set automatically for a buffer without buffer-local property. There You can define not only a glob pattern for the filename but also a glob pattern for the first line inside the file (see User's Guide - Installing Edit Modes).

Robert

 
Thanks!
by navin on Mon, 05/10/2009 - 03:26
The first method is perfect for me and it works great. Thank you, Robert.

Regards,
Navin
User login
Browse archives
« April 2024  
MoTuWeThFrSaSu
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
 
Poll
Are you interested in language packs for jEdit?
Yes, and I could help maintain translations
26%
Yes, I'd like to have translations
32%
Indifferent
35%
No, that'd be bad (please comment)
7%
Total votes: 1093
Syndication
file   ver   dls
German Localization light   4.4.2.1   82348
Context Free Art (*.cfdg)   0.31   46055
JBuilder scheme   .001   18495
BBEdit scheme   1.0   18116
ColdFusion scheme   1.0   18024
R Edit Mode - extensive version   0.1   17473
Advanced HTML edit mode   1.0   16206
Matlab Edit Mode   1.0   16068
jEdit XP icons   1.0   15229
XP icons for jEdit   1.1   14293