NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
Can I drag a code template to the toolbar?


Joined: 20 Sep 2006
Posts: 59
Reply with quote
Hi,

I can never figure out how code templates work, nor can I remember the text I have to type for each one.

Is there any way to drag them to the tool bar? So they become buttons that I can click on.

I have done this with the 'Toggle line comment' which works like a beaut! I select lines of text, then click on the button. Instant comment joy.

I want to be able to click on a button called 'sql' and it dumps my SQL snippet. Is there a way to do this? Please? Pretty please?

I hate learning new languages, I already need Python, PHP, SMARTY, HTML, JavaScript (and AJAX) and SQL just to make a web page, I don't want to learn some 'code template' language as well Shocked Shocked

Thanks,

monk.e.boy
View user's profileFind all posts by monkiesSend private message


Joined: 20 Sep 2006
Posts: 59
Reply with quote
Oh, I forgot to say that I am a paying customer. If that helps Smile Smile And I advocate PhpEd all the time in the PHP Freaks forums Very Happy

monk.e.boy
View user's profileFind all posts by monkiesSend private message


Joined: 08 Feb 2007
Posts: 67
Reply with quote
I don't think there's a way to add a "Trigger X code template" button to the toolbar, but honestly it would take longer for me to switch back to my mouse, click a button and switch back than using the code template trigger (CTRL-J by default).

The beauty of the code templates is that you're the one setting up the 'language', so you can make the shortcuts whatever you want. For example, I have all my PHPDocumentor code blocks set up in templates, so when I need to do a new block for a new file I just type "pagedoc", press CTRL-J and it prints my code block for me. You could do the same thing with your SQL code by creating a template with a trigger word like "sql" or maybe "ssql" for selects, "isql" for inserts, etc. It's up to you so make it fit your coding style Smile
View user's profileFind all posts by nothsaSend private message


Joined: 20 Sep 2006
Posts: 59
Reply with quote
nothsa wrote:
It's up to you so make it fit your coding style Smile


Yes. I understand that, thanks. I actually knew everything you pointed out, I'm not that challenged.

But what I want is to have a visual reminder of the templates I have set up. Let me repeat - visual reminder.

As I said I don't want to have to remember to type 'sqlins' when I could just click a button. And I'm not so anal as to set a timer and try to see which is faster, searching my memory for that half remembered template language or moving my hand and using the mouse to click on a button. So I think the "it's quicker argument" is a bunch of arse.

And who the hell is typing code 100% of the time? 50-60% of my coding time is spent pondering the best way to do something. I don't feel it is a race and who ever is quickest wins.

Anyway, after all that justification, I feel I have the time to click a button Wink Wink

monk.e.boy
View user's profileFind all posts by monkiesSend private message


Joined: 08 Feb 2007
Posts: 67
Reply with quote
monkies wrote:
Yes. I understand that, thanks. I actually knew everything you pointed out, I'm not that challenged.

I did not imply that you were challenged. Not knowing something doesn't prove an inability to learn. I didn't even know about code templates until someone suggested it on the forums.

monkies wrote:
And who the hell is typing code 100% of the time? 50-60% of my coding time is spent pondering the best way to do something. I don't feel it is a race and who ever is quickest wins.

Coding isn't a race, it just appears that your coding process is different from mine. My planning/refinement stages are done away from the computer and then, when I'm at my computer, I spend 90-95% of the time typing code (I find that I can finish projects faster when I do it this way), so I find it annoying to switch to my mouse and then click back on the spot where I want to start typing again.

Now, back to your question Smile

As I'm sure you're aware, pressing the code template trigger (without typing any text before it) will bring up a list of all of your code templates, if you need a reminder. Also, partially typing the word will bring up a partial list. I think this is the best you can hope for right now.

This is in the Feature Request forum, so hopefully they'll take note of it for a future release Smile
View user's profileFind all posts by nothsaSend private message
All I needed...


Joined: 23 Mar 2006
Posts: 2
Reply with quote
Actually nothsa, all I needed was HOW to activate the code templates... just finding out that I needed to use "CTRL J" was enough to make the magic happen!

Thanks,
Bradley
View user's profileFind all posts by deanzabradSend private message
Can I drag a code template to the toolbar?
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