•  
      CommentAuthorSpode
    • CommentTimeFeb 4th 2008 edited
     

    When coding PHP, until recently, I've been using a press review copy of Dreamweaver that found its way to me. Although legal, I've been meaning to stop using it for a while, as I use very little of its features and I felt hypocritical using something I wouldn't recommend to other people. The reason I like Dreamweaver, is because it has a good file manager that supports editing remotely via ftp and sftp, it highlights code well, and displays a functions parameters as you type it in, which has saved me a lot of time. None of these features are particularly complex, but finding a multiplatform open source alternative has been pretty tricky.

    I am very picky about what software I choose, as I feel they should be available on both Windows and Linux platforms. Open Source should be about choice, and that includes the choice to run Windows. I don't like the idea of being tied down to one particular platform. Right now, if you stuck me on Mac/Windows/Linux I'd be able to get up and running effectively.

    The final piece in my Jigsaw is a text editor called "SciTE" which uses the Scintilla engine. This is a really simple editor, with a tiny footprint (the Windows version is only a 600k download!). Out of the box it will work with PHP, but it lacks the Calltips feature (the function parameters) and doesn't highlight PHP functions correctly. I had a lot of trouble getting this working, and found it to be poorly documented. But after hours of googling, I came up with a solution, that turned out to be rather simple.

    You can download SciTE from its website. Ubuntu users can install it from Synaptic. Whichever method you choose, you'll also need to pay a visit to the SciTE extras page and grab yourself a copy of the php.api, phpfunctions.properties and html.properties files. Place these in the main SciTE folder – in my case “/usr/share/scite”.

    Then from inside SciTE, find the "Open User Options File" menu option. We're going to put our customisations in there. This protects our settings from being overwritten when we upgrade the SciTE package.

    The following settings set up the PHP Calltips, Autocomplete and also change a few other things that improve the experience - I've commented them all, so you can remove what you don't like. One of the great things about SciTE is that practically everything is customizable and it supports pretty much every language available. At some point I'll add the Javascript API Calltips. Just paste these in, save and reload SciTE.

    /home/spode/.SciTEUser.properties

    # Load the PHP api file

    api.$(file.patterns.php)=$(SciteDefaultHome)/php.api

    # Call Tips settings

    calltip.hypertext.end.definition=)

    calltip.hypertext.word.characters=->_$(chars.alpha)

    calltip.hypertext.ignorecase=1

    # Autocomplete settings

    autocomplete.hypertext.start.characters=$->(chars.alpha)

    autocomplete.hypertext.ignorecase=1

    # File open filters

    open.filter=All Files|*.*|PHP Files|*.php

    #default.file.ext=.php

    # Display line numbers on the left hand side

    line.margin.visible=1

    line.margin.width=3+

    # Shows the currently selected file name in the title bar.

    title.full.path=1

    title.show.buffers=1

    # Saves the session for next time it is open.

    save.recent=1

    save.session=1

    load.on.activate=1

    # Allows up to 25 tabs to be open at once

    buffers=25

    # Move the message pane

    split.vertical=0

    The biggest issue I have found with SciTE is the lack of support for Gnome VFS. I mount my SSH shares on my desktop, and usually edit these files directly. As this didn't work I instead used "sshfs". This works in conjunction with “fuse” to mount the remove ssh filesystem on the drive.

    In Ubuntu, fuse is already installed, so I only had to install the "sshfs" package. By default your user is not part of the fuse group, so you need to add yourself with "sudo usermod -a -G fuse myusername".

    Then mounting my drive was as simple as "sshfs username@ipaddress:/remote/dir /local/mount/dir -o sshfs_sync -o transform_symlinks", naturally putting in your own values. I turned on synchronous writes, as I wanted to be sure the file had transferred rather than delayed. I also turned on transformation of symbolic links, as otherwise many of my remote symbolic links were broken.

    I'm very impressed with SciTE so far, with features like collapsing braces making it very easy to view code as you're editing it. The more I use it, I'll update this post with any new additions I feel are necessary. The only real issue I have at the moment, is the PHP function list is from PHP 4 instead of 5, unless someone produces a new one - I may have to come up with an automatic generation of this list.

    • CommentAuthorGuest
    • CommentTimeOct 20th 2008
     

    I cannot get ScITE to "auto tab" html in a .php file type. Do you know if this actually works?

    •  
      CommentAuthorSpode
    • CommentTimeOct 20th 2008
     

    I imagine that's something to do with it being considered a PHP file and not HTML.

    • CommentAuthorGuest
    • CommentTimeJan 14th 2009
     

    thanks for the scite tips. i like it, but it takes awhile to get it going.

    any idea how to change the default background color for php blocks?

    •  
      CommentAuthorSpode
    • CommentTimeJan 15th 2009
     

    Not off the top of my head, Guest!

  1.  

    I've found a nice extra thing to add simply because I got annoyed at how autocomplete inserts text that (sometimes) I don't want. To prevent it auto-selection the only item on the list insert these line in the properties

    # Prevents autoinserts of Autocomplete
    autocomplete.choose.single=0

    • CommentAuthorGuest
    • CommentTimeNov 9th 2009
     

    I'd be very pleased to see a updated php 5 function list.

    •  
      CommentAuthorSpode
    • CommentTimeDec 2nd 2009
     

    I must admit - I don't use it anymore!

    I found I wasn't really using the autocomplete - and I was moving around machines so much - that I've just been using gEdit - the built in text editor with Gnome!

    • CommentAuthorGuest
    • CommentTimeJan 14th 2010
     

    Hi,

    I cannot compile my PHP code and this message always pops up "the system cannot find the file specified"

    Could you help me fix this problem?

    Thank you very much.

    •  
      CommentAuthorSpode
    • CommentTimeMar 13th 2010
     

    I've recently started using NetBeans IDE - haven't been using it long, but there are some good facilities - even has jQuery autocomplete built in!

    • CommentAuthororionis
    • CommentTimeApr 11th 2011
     

    Hello,
    Sorry, I'm a bit late in this thread, I have a little problem concerning the reserved words in Scite. Although my HTML files open with Scite are OK (all the reserved words are colored), this property does not work with the PHP files.
    I copied the 3 files you mentionned in the wscite directory, but it does not work better.
    Can anybody help me? :cry:

    •  
      CommentAuthorSpode
    • CommentTimeApr 11th 2011
     

    Hi Orionis - unfortunately, I don't use Scite any more so can't be of any use! But hopefully someone else will pick up your plea on Google and post a solution :)

    • CommentAuthororionis
    • CommentTimeApr 11th 2011
     

    I hope so, but I already posted my question on several forums and get no answer yet!

 
Copyright Andrew Miller (Spode), 2008