NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
code autocomlete (formelly "code templates")


Joined: 05 May 2008
Posts: 36
Reply with quote
In EditPlus autocompletition works as follow:

I type "if", then space and get the whole struktur:

if (|) {
-tab-
}

very useful, but I cannot get the same behavior in PhpED. First of all, i cannot get my own language added. I copied <php5> section in all configs i found, but after App. starts all my changes are overwritten. Are available languages hardcoded?

Second, i set space as hotkey and all works fine if I type something like "if" or "for", but if I type "gkldfjgh", window with suggestions appears Sad Is there any setting I can change to get rid of this autosuggestion window?

In fact, i should use "autocorrect" feature, but I cannot put multiline values into "Correct to:" line...

Sorry about my terrible english, i'm not native speaker Smile

Thanks in advance Smile
View user's profileFind all posts by VodochnikSend private messageICQ Number


Joined: 10 Feb 2004
Posts: 93
Reply with quote
You can easily get the same behaviour in PhpEd. You need to create a "code template". To get to the code templates, go to the Tools menu, Settings. Then on the left hand side of the Settings dialog box, look for Editor->Code Templates. Click on Add to add a new one for you. The "Name" is what you will use as the shortcut. I've changed mine so much I dont remember what PhpEd ships with, but one I have that I use alot is for if else statements. I have the name set to 'ifel' and the Template body to

Code:

if(|){

} else {

}


Then in the editor, I type in 'ifel' and then press Ctrl+j to activate the code template.
View user's profileFind all posts by gilzowSend private messageAIM Address


Joined: 05 May 2008
Posts: 36
Reply with quote
2 gilzow: I know how to create and use code templates Smile I just want to add my custom language (i.e. MyPHP) with custom set of templates. And assign SPACE in place of Ctrl+J. That's it.
View user's profileFind all posts by VodochnikSend private messageICQ Number
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
Quote:
And assign SPACE in place of Ctrl+J

You can't assign space for it, otherwise you'll not be able to enter spaces at all. IT will show you popup with templates each time you press space.
I'd recommend you to think about different shortcut if you don't like Ctrl+J.

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 10 Feb 2004
Posts: 93
Reply with quote
Vodochnik wrote:
2 gilzow: I know how to create and use code templates Smile I just want to add my custom language (i.e. MyPHP) with custom set of templates. And assign SPACE in place of Ctrl+J. That's it.


OH. My apologies. I misunderstood. I dont think you would want to assign the space as your shortcut though.... How would you be able to enter the space character in your code? The IDE would continuously think you were activating the shortcut.

The templates are stored in a file though I have forgotten which one. I can look later. Though I bet dmitri would know which one off the top of his head.
View user's profileFind all posts by gilzowSend private messageAIM Address


Joined: 05 May 2008
Posts: 36
Reply with quote
gilzow wrote:

How would you be able to enter the space character in your code? The IDE would continuously think you were activating the shortcut.


That's why I described how EditPlus works. Maybe it "trigger" first word in a line + space, maybe it works like autocorrection in PhpED. Closed source, i don't know Smile

Ok, is it possible to enter multiline string in autocorrection feature in PhpED?
View user's profileFind all posts by VodochnikSend private messageICQ Number
Guru master

Joined: 05 Jul 2004
Posts: 659
Location: Belgium
Reply with quote
+1 for multi-line autocorrection.
View user's profileFind all posts by BlizzSend private messageVisit poster's website
code autocomlete (formelly "code templates")
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic