Author Topic: Alias Expansion  (Read 7069 times)

asipe

  • Senior Community Member
  • Posts: 113
  • Hero Points: 4
Alias Expansion
« on: October 03, 2006, 06:28:52 pm »
I'm new to SE, in fact I'm still using the evaluation version.     One of the features in my old editor that I rely on heavily is the the alias feature.   I've been able to reproduce most of the behavior that I'm looking for (and some new things that are very cool).

However, one problem I'm having is this:

Say I have an alias named:  mce
This alias expands to:  MyCoolExpansion

If I'm on a new, blank line in the editor then it works as expected.  However if I'm in the middle of a line I can't get the alias to expand.

For example:

private void Blah(mce

The mce there doesn't expand.   I've looked around and tried various things, but I can't seem to get it to work -- am I missing something?

Thanks -andy

hs2

  • Senior Community Member
  • Posts: 2754
  • Hero Points: 291
Re: Alias Expansion
« Reply #1 on: October 03, 2006, 07:10:15 pm »
There is one restriction know to me:
The alias to expand has to be a seperated 'token'.
example:
BLAmce will not expand
but:
BLA(mce will do since '(' is not a word char

Strange - I do similar things w/o any trouble...
Maybe it's a problem in the Slick version you use...
I'm on v11.02 and it's working fine (and there are no hidden options to setup).

So the only advise I could give is: Just buy v11 and install the v11.02 patch ;)

Sorry,

HS2

asipe

  • Senior Community Member
  • Posts: 113
  • Hero Points: 4
Re: Alias Expansion
« Reply #2 on: October 03, 2006, 07:27:00 pm »

So the only advise I could give is: Just buy v11 and install the v11.02 patch ;)

Sorry,

HS2

I'm already using the latest version with the patch, so I don't think that is the problem.    Even if I have spaces between them:

Blah( mce

It doesn't work...

--andy

alex

  • Community Member
  • Posts: 64
  • Hero Points: 6
Re: Alias Expansion
« Reply #3 on: October 03, 2006, 07:48:19 pm »
I have faced the same problem in Vim emulation mode.  I'm not sure if that's relevant, but your emulation mode might matter.

I eventually gave up and started managing most of my one-line aliases using AutoHotKey (the mulitline aliases generally want to start on a single line, so they're fine).  This might not be the best solution for you for a variety of reasons, but I like it because it means that even if I'm working in another editor (like Vim), I keep all of my aliases.

hs2

  • Senior Community Member
  • Posts: 2754
  • Hero Points: 291
Re: Alias Expansion
« Reply #4 on: October 03, 2006, 08:39:34 pm »
@Alex: What would we do without Autohotkey ... ;)

HS2

hs2

  • Senior Community Member
  • Posts: 2754
  • Hero Points: 291
Re: Alias Expansion
« Reply #5 on: October 03, 2006, 09:27:06 pm »
Erm ... if it's really related to the emulation you could try:
1. type 'BLA(mce' -> activate cmdline (click on it or press 'ESC') -> type expand-alias<ENTER>
This should be emulation independent (I think).

2. let the Auto-Completion' feature try it's best
-> 'Tools->Options->File Extension Setup-> Auto-Complete tab' -> check 'Alias expansion'
and see what happens (or again directly on cmdline -> 'autocomplete' command)
I assume that 'Auto-Complete' is enabled.

If e.g. 1) works add another key binding to 'expand-alias'

HS2
« Last Edit: October 03, 2006, 10:25:46 pm by hs2 »

asipe

  • Senior Community Member
  • Posts: 113
  • Hero Points: 4
Re: Alias Expansion
« Reply #6 on: October 04, 2006, 12:04:24 pm »
Erm ... if it's really related to the emulation you could try:
1. type 'BLA(mce' -> activate cmdline (click on it or press 'ESC') -> type expand-alias<ENTER>
This should be emulation independent (I think).

......

HS2

That worked, and I can easily bind it to a key.   However, it's less than optimal to have to bind an additional key to make it work vs just using spacebar (2 different ways to do the same thing at different place - yuck).

Thanks for the help :)

--andy
« Last Edit: October 04, 2006, 02:44:12 pm by asipe »

Dennis

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 3618
  • Hero Points: 481
Re: Alias Expansion
« Reply #7 on: October 04, 2006, 03:22:42 pm »
Expand alias is probably already bound, depending on your emulation.  Try going to "Help" > "Where is command" to find out what key(s) expand-alias is bound to.