Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 How to customize surround selected

You must be registered to post a reply.
Click here to register.

Screensize:
UserName:
Password:
Format: BoldItalicizeUnderlineStrikethrough Align leftCenterAlign right Insert horizontal ruleUpload and insert imageInsert hyperlinkInsert email addressInsert codeInsert quoted textInsert listInsert Emoji
   
Message:

Forum code is on.
Html is off.

 
Check to subscribe to this topic.
   

T O P I C    R E V I E W
Rahul Sathe Posted - Feb 05 2010 : 10:39:31 AM
I want to be able to select a block of code and assign a short-cut to surround it with #if 0 or #if 1.

It seems like there is a short cut for #if 0, but I can't select a block and assign a key, say '@', so that it'll surround it with
#if 0
#endif

May be this is an easy question, but I've started using VA heavily now and this would just make my productivity go up a notch.

*moved to correct section by feline*
1   L A T E S T    R E P L I E S    (Newest First)
feline Posted - Feb 15 2010 : 1:24:52 PM
When you select some code and press # you are using the VA Snippet with the shortcut "#r" and the title "#region (VA X)"

Unfortunately you cannot bind a single key press to a second VA snippet quite like this. Surrounding code is a special case. But what you could do was setup the snippet:

#if 1
$selected$
#endif


and assign a keyboard shortcut to the command VAssistX.VaSnippetInsert. When you select some code and press the keyboard shortcut VA will show you a list of all of the snippets that use $selected$. These will be in the same order as they are in the tree in the VA Snippet Editor dialog. So if you put your #if 1 snippet at the top of the C++ items it will be the first item in the list, so it will be selected by default.

So you can get it down to two key presses.

© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000