dreamweaver has an option to automatically scan a directory and index all the user defined functions so you can then easily reference and auto complete when writing code. I am using notepad++ to right PHP and would like a similar feature without the need of manually updating an API or config file or anything for notepad++.
Does anyone know of a plugin/addon etc or maybe a better open source program which allows this feature?
Did you try Sublime Text 2? It's a really cool text editor, that implements natively what are you asking for.
Related
does anyone know if there is a key combination for importing classes in Netbeans?
By pressing enter when I get the suggestions, the namespace is imported in the method like this:
public function index(\Illuminate\Http\Request){
What I want to achieve instead, is to add a line use Illuminate\Http\Request in the top of the file. How can I do this in netbeans? I have seen it in Phpstorm.
Also, another question a little off the topic, but I have seen people generating html5 code by typing html5 and with some key combination they generate a doctype, html, head and body. How can I do this?
For the first part
In newer versions of Netbeans , you can press Ctrl+Shift+I (Alt+Shift+I won't work as expected, though).
First, it searches for any smart or fully qualified instances in your file and then asks you of what types the found ones should be. It then adds fully qualified use statements to the top of your file and changes existing instances in the source to unqualified.
For the second part
You have to use a plugin called Emmet
In net beans you can quickly create templates for things like classes and assigned chunks of text to short cuts etc.
How can I do this in Sublime Text. I have looked around the net and can't find a simple example.
1) First of all make sure you have the correct syntax defined for the file you are working on (usually in the bottom right corner in sublime text).
2) Then be sure to have the cursor inside the <?php ?> tags.
3) Using your example of creating a class, simply start typing the keyword class and hit the tab or enter key to execute the existing, built-in snippet of sublime text.
4) You should see a basic code structure in your code now. Using the tab key again, you can jump through the snippet and adjust the parameters to your needs.
If you need more customized snippets, there is also the possibility of creating your own.
Go to Tools -> New Snippet... in the sublime menu. The syntax is difficult to describe, that's why I would recommend reading on about sublime snippets here:
http://docs.sublimetext.info/en/latest/reference/snippets.html
There are also many packages available for sublime that add extra snippets to your editor. Have a look here (be aware that you need Package Control installed):
https://sublime.wbond.net/browse
Cheers! Hope this helps!
After enabling "Function parameters hint on input" in Preferences->Backup/Auto-Completion, I get helpful tips for native PHP functions like this:
string|false substr (string str, int start, [int length])
Is there a plugin or something that would make Notepad++ do this for my own functions, much like Dreamweaver does?
Settings -> Preferences -> Backup/Auto-Completion -> Function
parameters hint on input [CHECK]
Is this what you're talking about? Works for me.
I have accomplished this by doing the following:
Edit API XML file used by Notepad++ for the desired language.
Add custom names in Settings > Style Configurator to get highlighting you desire.
Editing the API XML file
The API XML files are located in your installation directory \plugins\APIs. I believe there is a file for each language that has a parser. That parser will determine which pieces of the XML file are required or ignored.
These files are very fragile so here are some tips:
All entries MUST be in alphabetically order by KeyWord or it will silently fail.
Watch out for text that makes your XML invalid in descriptions. From what I can tell Notepad++ doesn't have a schema to tell it that attributes are of type string so all kinds of characters will break the XML and your tips.
Any problems with the XML file will silently fail the tips.
I have used this technique to support a custom API used by a game engine I am working with and it works great. I have an excel spreadsheet to manage entries and create properly formatted XML to be pasted into the correct section of the file, but obviously there are many ways that managing that could be done.
I figured all this out based on these sources:
http://sourceforge.net/apps/mediawiki/notepad-plus/index.php?title=Editing_Configuration_Files#API_files
http://retroaffect.com/blog/190/A_Lua_Language_File_for_Notepad__/#b
(The API file here you can download has the Environment tag in the wrong place, it should be within the AutoComplete tag instead, but it helped me understand the usage.)
Editing the Style Configurator
Screen adding new key word: myNewKeyword
Final result after adding math.tanh with highlighting
I'm not too familiar with Notepad++, however I think unless there is some sort of IDE plugin it would not be possible.
In my opinion, you should use Aptana Studio, it's based off of the Eclipse IDE, and is specifically made for web development/PHP. Although there are plenty of other IDEs out there, here's a few.
Here's a link to Aptana: http://www.aptana.com
I need a configureable and extendable in browser code editor using JS and/or PHP (no python or flash etc).
Something like code.google.com editor (it rocks!) and I really like the diff capability it provides. It would be cool but I can't find info on what editor it is employing.
Anyone know something like that? Or if code.google.com's code is open Source? If yes, where can I get it?
I think this has been previously answered with CodeMirror being the preferred choice and it is apparently used by Googles code playground. See Is there a good in-browser code editor? for more information.
I've been using HomeSite since Allaire owned it. I started with plain HTML, then classic asp, now I've been using it for PHP development for quite a while but there's a feature I really want and Homesite only seems to do it sometimes. Most IDEs will show a list of functions on a page. Homesite will sort of doing this with the Tag Inspector feature. If I have a file that is nothing but PHP user-defined functions (ex. require('functions.php')) then all the functions show up just fine. However, if my page is mainly an HTML page with PHP functions added in they don't show up in the outline.
I guess I could have all my functions be part of a 'required' file but I was wondering if any homesite jocks might know of a more reliable way of creating an outline profile that would display user-defined functions
I used Homesite myself. Topstyle kinda took over from it (it was by the same guy), and now TS itself has now been sold on, for version 4 - http://www.topstyle4.com/ - (now in beta).
Code insight for the files/classes/functions isn't particularly unique anymore though - I think the various Eclipse based IDEs and the Komodo IDE can also do it now.
I don't use homesite, but it sounds like perhaps it could be keying off the file extension. Try saving your file with a different extension, for example: save "yourfile.html" as "yourfile.phtml".