Rahul Sathe
Starting Member
USA
1 Posts |
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* |
Edited by - feline on Feb 15 2010 1:17:46 PM |
|
feline
Whole Tomato Software
United Kingdom
19021 Posts |
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. |
zen is the art of being at one with the two'ness |
|
|