Auto-completing Brackets and Quotations

This forum is user-to-user based and not regularly monitored by IDM.
Please see the note at the top of this page on how to contact IDM.

Auto-completing Brackets and Quotations

Postby Cerpin Taxt » Mon Dec 12, 2005 1:37 am

Hello all.
I'm demoing UEStudio, and I'm having a lot of trouble getting it to do some simple things.

When I type a left bracket, left paren, or single/double quote, I'd like it to type the opposing symbol and put my caret in the center of the two, like this:

Typing
Code: Select all
{

causes
Code: Select all
{|}

to occur. It would seem that the Advanced Configuration setting "Auto Complete One-Symbol List" would do this, but checking it does not cause it to work. Is there something I can place in my configuration file to allow this to work?
Cerpin Taxt
 

Re: Auto-completing Brackets and Quotations

Postby Guest » Wed Jan 04, 2006 12:55 pm

i'd love this too
Guest
 

Re: Auto-completing Brackets and Quotations

Postby Mofi » Fri Jan 06, 2006 10:42 am

Instead of using auto-complete, you can do this with a set of macros saved in a macro file which is automatically loaded during start of UEStudio. For example the macro for {:

Macro property:

Cancel Dialog = FALSE
Find with Replace = FALSE
Hotkey = ALT+CTRL+7

On a German keyboard ALT+CTRL+7 must be entered for {. Simply press the key for { in the macro property dialog to get correct keyboard code for your keyboard.

Macro code:

IfExtIs "c"
"{}"
Key LEFT ARROW
ExitMacro
EndIf
IfExtIs "cpp"
"{}"
Key LEFT ARROW
ExitMacro
EndIf
IfExtIs "h"
"{}"
Key LEFT ARROW
ExitMacro
EndIf
"{"

I mainly use this technique for inserting german umlauts according to extension. For example for Ä:

Cancel Dialog = FALSE
Find with Replace = FALSE
Hotkey = SHIFT+Ä

IfExtIs "html"
"Ä"
ExitMacro
EndIf
IfExtIs "htm"
"Ä"
ExitMacro
EndIf
IfExtIs "asm"
"Ae"
ExitMacro
EndIf
IfExtIs "c"
"Ae"
ExitMacro
EndIf
IfExtIs "h"
"Ae"
ExitMacro
EndIf
IfExtIs "inc"
"Ae"
ExitMacro
EndIf
"Ä"
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4062
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna

Re: Auto-completing Brackets and Quotations

Postby cocentaina » Wed Jan 18, 2006 2:54 pm

this is great. these are my macros for completion of the following chars: ", ', (, [, {
""""
Key LEFT ARROW

"''"
Key LEFT ARROW

"()"
Key LEFT ARROW

"[]"
Key LEFT ARROW

"{}"
Key LEFT ARROW


Hotkeys are ", ', (, [, {. Very simple, very useful.

Now the only thing I need is snippet expansion like in TextMate - expand a keyword+<tab> to a snipper. For example, when you type
inc<tab>

you get:
#include "|.h"
cocentaina
 

Re: Auto-completing Brackets and Quotations

Postby Mofi » Wed Jan 18, 2006 3:57 pm

Similar to "snippet expansion" is Auto Completion which can be by default activated with CTRL+SPACE after entering for example #inc. See help of UEStudio about Auto Completion. But it is not possible to insert a phrase with auto completion and set the cursor automatically anywhere inside the phrase. The cursor will be always at the end of the auto-completed string. Using templates and macros could help here also for certain phrases which are used very often.
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4062
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna


Return to UEStudio General Discussion