Page 1 of 1
PHP high function lighting
Posted: Fri Aug 14, 2009 4:16 am
by waitman
hi,
i'm new to zeus, evaluating. i like it so far, especially since i can turn
off the auto indent, brackets, completion, etc and stuff that drives me
bonkers.
BUT, i need function highlighting. basically i type fast and mispell every
so often and it's so blatantly obvious when it's not the color it's
supposed to be. example: mysqlnum_rows vs
mysql_num_rows
is this possible in zeus? the help file doesn't seem to function properly
in vista.
thanks,
Waitman
Posted: Fri Aug 14, 2009 4:46 am
by jussij
Hi Waitman,
i like it so far, especially since i can turn off the auto indent, brackets, completion, etc and stuff that drives me bonkers.
The Zeus philosophy has always been that where ever possible, let the users have the final say as to how things should work.
This does make the process of configuring the software a bit more complex, but it's better than having the IDE getting in way of the user.
BUT, i need function highlighting. basically i type fast and misspell every so often and it's so blatantly obvious when it's not the color it's supposed to be. is this possible in zeus?
Provided you have a list of valid function names then yes this is possible
What you need to do is this:
- Use the Options, Document Types menu
- Select and edit the PHP document type from the list of document types
- Go to the Keywords section
- Click the Export button and export the keyword details to the c:\temp\my_php.zki temp file.
- Hit the Cancel button to cancel out of the configuration dialog
Now open the newly create
c:\temp\my_php.zki temp file.
In this file you will find the following keyword sections (use the
Find menu to locate these sections):
Code: Select all
[ReservedWords]
[UserWords1]
[UserWords2]
[UserWords3]
[UserWords4]
[UserWords5]
Each section can be allocated a different color.
So all that needs to be done is to pick a section and add the list of function names to that section, for example:
Code: Select all
[UserWords5]
mysql_num_rows
mysql_num_columns
mysql_some_function
mysql_some_other_function
To complete the configuration just re-edit the
PHP document type as described earlier but this time use the
Import button to re-import the
c:\temp\my_document.zki temp file.
Now when you open your PHP file the words added above will be colored using the color defined for that section.
the help file doesn't seem to function properly in vista.
This link might help with this issue:
http://www.zeusedit.com/forum/viewtopic.php?t=2683
Cheers Jussi
Posted: Fri Aug 14, 2009 5:10 am
by waitman
oh, ok. that was pretty darn simple.
with php, i see there are already a few in there.. but i wanted more!
just pull the words right off the php site.
Code: Select all
<?php
$f=explode("\n",strip_tags(implode(file('quickref.php'))));
foreach ($f as $v) {
$v=trim($v);
if (($v!='')&&(is_callable($v))) echo $v."\n";
}
?>
thanks for your help.
it seems like a pretty darn good editor, only a few minor quirks. i use a text editor every day so any little thing is amplifed, lol. i don't much like how the "file types" changes to whatever file I'm looking at (well maybe whatever file type i just "saved"), i have to keep switching it back to *.*, which can be tedious on mounted remote storage, and when i copy the selection area becomes unselected.
waitman
Posted: Fri Aug 14, 2009 5:34 am
by jussij
only a few minor quirks.
Feel free to report these quirks to this forum.
i don't much like how the "file types" changes to whatever file I'm looking at (well maybe whatever file type i just "saved")
The way it works is the file filter will be automatically selected based on the file extension of the currently active document.
FYI you can also add/remove file types from this filter list using the
Display these files in the file open dialog files list found in the
General section of the
Document Type
i have to keep switching it back to *.* which can be tedious on mounted remote storage
Typing in
*.* followed by the enter key should also work. But I'll look to add an editor option to turn on/off this behaviour
and when i copy the selection area becomes unselected.
This simple Lua macro will copy the marked area to clipboard and also keep the marked area selected
Code: Select all
function key_macro()
screen_update_disable()
-- macro only works for documents
local document = is_document()
if document == 1 then
-- macro only works for marked documents
local marked = is_marked()
if marked == 1 then
cursor_save()
MarkCopy()
cursor_restore()
else
message("No area has been marked!")
beep()
end
else
message("This macro only works for document files!")
beep()
end
end
key_macro() -- run the macro
To use this macro just save the code above to a file in the
zScript folder with the
Lua file extension.
Then you can use the
Options, Editor Optons menu
Keyboard Mapping panel to bind the macro to the keyboard (using the
Category dropdown list).
Cheers Jussi
PS: Since you code in PHP this link might be of some use:
http://www.zeusedit.com/forum/viewtopic.php?t=9
Posted: Fri Aug 14, 2009 5:47 am
by waitman
ok cool, thanks again!
i like the idea of turning the filter list off! really i think it should only change if i specifically want it to change, i start feeling weird when my files have suddenly vanished and it takes me a moment to recover from disorientation and remember that the filter selection changed! but really, the slowness of refresh on remote storage makes it ugggh.
a couple more, i don't see 'close all' and ctrl-shift-s 'save as' makes wierd track thingings at the caret pos but doesn't save-as.
thanks for the link to the php help thingy, i appreciate it. every once in a while i'm trying to remember if it's haystack or needle parameter first, and sometimes i gotta pull up the php.net site and look it up. maybe i'll use that chm instead, i'll think about it awhile.
Posted: Fri Aug 14, 2009 6:01 am
by jussij
i don't see 'close all'
There is a
Windows, Close All menu. Is that what you mean
ctrl-shift-s 'save as' makes wierd track thingings at the caret pos but doesn't save-as.
Which keyboard mapping are you using
every once in a while i'm trying to remember if it's haystack or needle parameter first, and sometimes i gotta pull up the php.net site and look it up. maybe i'll use that chm instead
This is where the Zeus Quick Help feature might help:
http://www.zeusedit.com/forum/viewtopic.php?t=6
What this feature does is index the CHM help file.
This lets you place the cursor on a word or partial word and use the
Help, Quick Help Current Word menu to search the help file index for the word.
If anything is found then the CHM file gets display at the correct page.
The feature doesn't work for all CHM files as it depends on the index information in the help file itself, but when it does I find it to be very useful
Cheers Jussi
Posted: Fri Aug 14, 2009 6:14 am
by waitman
There is a Windows, Close All menu. Is that what you mean
OH! it's under "Window". i was looking under "File". Now i know where it is.!
Which keyboard mapping are you using
hmmmm ok i see that option there now, it was very easy to assign. sorry i'm new to zeus.
thanks again for your help!
listview
Posted: Tue Aug 18, 2009 3:29 am
by waitman
hi again,
is there a listview avail somewhere for the files list? i guess the 'mod' way is the treeview, but i think it's more convenient to have a listview and drive combox, i'm not sure how to sort by size, name, modified date, etc.
thanks
waitman
Posted: Tue Aug 18, 2009 3:48 am
by jussij
is there a listview avail somewhere for the files list?
Unfortunately not
The best there is, is the
Tools, Explorer menu which will take you to the correct
Explorer folder location based on the
currently active document.
Cheers Jussi