Vim-like coloring

Discussion about the Aptana Studio PHP plug-in and PHP coding experience inside of Studio.

Moderator: Aptana Staff

Vim-like coloring

Postby kjordan2001 » Wed Aug 29, 2007 2:56 pm

Image

Download: VIM Colors

Based on a XTerm with an Xdefaults of: Xdefaults

Figured out all below, now posting schemes.

Would it be possible to split the $ out for separate coloring? I'm making a vim type color scheme and vim colors the $ in a different color from the rest of the identifier.

Also, which is the color for "<?php" and "?>"? They seem to be a completely different color from anything I currently have in my scheme.

Edit: Figured out the $.
Code: Select all
<category name="IDENTIFIER" style="IDENTIFIER">
<token style="IDENTIFIER_IDENTIFIER" type="IDENTIFIER"/>
<token style="IDENTIFIER_VARIABLE" type="VARIABLE">
<region length="1" name="VARIABLE_dollar" offset="0" style="IDENTIFIER_VARIABLE_VARIABLE_dollar"/>
</token>
</category>
<style foreground="rgb(229,229,229)" id="IDENTIFIER"/>
<style foreground="rgb(255,255,240)" id="IDENTIFIER_IDENTIFIER"/>
<style font-weight="bold" foreground="rgb(255,247,150)" id="IDENTIFIER_VARIABLE_VARIABLE_dollar"/>
<style font-weight="bold" foreground="rgb(135,206,250)" id="IDENTIFIER_VARIABLE"/>


Still haven't figured out "<?php" and "?>" though.

Another thing I've noticed is that it doesn't highlight a variable in a string like:
echo "{$blah}\n";

Is there something I can add to my .col file to make it highlight in a string?
Last edited by kjordan2001 on Thu Aug 30, 2007 8:34 pm, edited 1 time in total.
kjordan2001
 
Posts: 22
Joined: Sun Aug 05, 2007 6:05 pm

Postby k1awicki » Wed Aug 29, 2007 4:12 pm

Hi,

The <?php and ?> are actually HTML tokens and can be colorized from the HTML colorization pref page.

The <?php is Punctuator->Pi Open

The ?> is Punctuator->Question Greater Than

These tokens are in the HTML since the way our parsers work these tokens in HTML can signal a transition to PHP.
Sincerely,
Kevin Sawicki
k1awicki
 
Posts: 738
Joined: Mon Dec 11, 2006 10:19 pm
Location: San Mateo, CA

Postby kjordan2001 » Wed Aug 29, 2007 4:54 pm

KSawicki_Aptana wrote:Hi,

The <?php and ?> are actually HTML tokens and can be colorized from the HTML colorization pref page.

The <?php is Punctuator->Pi Open

The ?> is Punctuator->Question Greater Than

These tokens are in the HTML since the way our parsers work these tokens in HTML can signal a transition to PHP.

Thanks, although it actually takes saving it to a file and changing
Code: Select all
<style foreground="rgb(255,128,128)" id="PUNCTUATOR_PI_OPEN_NAME_PART"/>
<style foreground="rgb(255,128,128)" id="PUNCTUATOR_PI_OPEN_TAG_PART"/>
to get the opening to change.

Any idea how to get a variable to be highlighted in a string?
kjordan2001
 
Posts: 22
Joined: Sun Aug 05, 2007 6:05 pm

Postby k1awicki » Wed Aug 29, 2007 5:27 pm

Currently we don't have colorization options for content inside PHP strings.

Do you know any other PHP editors that colorize variables inside a string?

I added a trac entry here:
http://www.aptana.com/trac/ticket/5756

Please feel free to add any comments if I missed anything or if you have any ideas for that workflow.
Sincerely,
Kevin Sawicki
k1awicki
 
Posts: 738
Joined: Mon Dec 11, 2006 10:19 pm
Location: San Mateo, CA

Postby kjordan2001 » Wed Aug 29, 2007 8:27 pm

KSawicki_Aptana wrote:Currently we don't have colorization options for content inside PHP strings.

Do you know any other PHP editors that colorize variables inside a string?

I added a trac entry here:
http://www.aptana.com/trac/ticket/5756

Please feel free to add any comments if I missed anything or if you have any ideas for that workflow.

Vim does.

Hmm, and while my color file works for non-internal PHP variables, it doesn't work for $this and $_* variables. Any idea how to get the first character in those to change?

I tried something like
Code: Select all
      <token style="KEYWORD_VARIABLE" type="VARIABLE">
         <region length="1" name="VARIABLE_dollar" offset="0" style="KEYWORD_VARIABLE_VARIABLE_dollar"/>
      </token>

in the KEYWORD category to see if that would work, but it didn't.
kjordan2001
 
Posts: 22
Joined: Sun Aug 05, 2007 6:05 pm

Postby hpfx » Wed Aug 29, 2007 9:38 pm

KSawicki_Aptana wrote:Do you know any other PHP editors that colorize variables inside a string?

I found a printscreen of an IDE that colorize variables inside string. (See at line 429, 430 and 432)
Image
hpfx
 
Posts: 22
Joined: Tue Aug 21, 2007 8:13 am

Postby k1awicki » Wed Aug 29, 2007 11:51 pm

Thanks for the input/screenshots.

I'll take a look at these products when working on it for our PHP editor.
Sincerely,
Kevin Sawicki
k1awicki
 
Posts: 738
Joined: Mon Dec 11, 2006 10:19 pm
Location: San Mateo, CA

Postby sounds » Thu Dec 13, 2007 11:28 pm

Sorry to bump a thread that's several months old but this is one of the few features I hope Aptana will support soon. It makes work much easier! I've been using EclipsePDT for php development for a while now but its bugs (even in the latest version) require me to restart it once or multiple times per day which is very frustrating and I recently discovered Aptana. So, I just wanted to note here that EclipsePDT supports highlighting php variables inside of strings. As does scite.

If this is a feature that's working in the latest version and I've missed it somewhere then I apologize, but would someone kindly point me in the right direction?
sounds
 
Posts: 1
Joined: Thu Dec 13, 2007 10:55 pm

Postby mpetersen » Fri Dec 14, 2007 6:46 pm

Hi sounds,

Add your comments to the following related ticket:

http://support.aptana.com/asap/browse/PHP-13

When we go to implement this, it'll be helpful to have your feedback.

Thanks,
Michelle
mpetersen
 
Posts: 1800
Joined: Thu Jul 13, 2006 6:43 pm


Return to PHP plug-in