Author Topic: even better aliases  (Read 4681 times)

afflictedd2

  • Guest
even better aliases
« on: May 21, 2010, 05:19:54 PM »
Hi everyone,

I was wondering, is it possible to make the aliases that expand write in more than one field.. It's kind of difficult to explain:

Basically in IDEs like eclipse, or editor textmate, one can create a snippet in which as you fill in the name of the fields
you specify it is filled out everywhere you need to fill it out, thus saving typing. So for example, if I were to create a snippet
for the for loop, I would have to type the index variable only once, and it would be filled out everywhere that it is needed.
Can you achieve this same effect in SE?

Ted

davehohl

  • Senior Community Member
  • Posts: 271
  • Hero Points: 27
Re: even better aliases
« Reply #1 on: May 21, 2010, 06:01:28 PM »
You can use parameter prompting to achieve this.  For example, here is an alias I use to create a wrapper for include files:

#ifndef __%(NAME)_H
#define __%(NAME)_H

#endif  // __%(NAME)_H

A dialog box prompts you to enter the value for the NAME parameter, and fills it in 3 different places.

You can find more info in the online help.  Enter "alias" on the index tab and then select "parameter prompting".

afflictedd2

  • Guest
Re: even better aliases
« Reply #2 on: May 21, 2010, 06:14:16 PM »
cool thanks.