now i am using vs2010 trail version.
i want to see the matching braces if there are multiple braces. the opening brace and the closing brace must be highlight.. how to achieve this?
Thank you,
Mihir
The link above should give you all default key mappings.
Another useful link is: Pre-defined keyboard shortcuts
I'd just like to mention a couple that I find very useful:
To jump back and forth between matching braces, you can put your cursor on either brace, and then push Ctrl-]
And also Ctrl-M Ctrl-L toggles all outlining in the current file, and Ctrl-M Ctrl-M toggles the current region
from msdn: http://msdn.microsoft.com/en-us/library/be94e8aw%28v=vs.80%29.aspx
outlines all the options and how to set them up
for javascript: Brace highlighting in Visual Studio for Javascript?
Related
In Xcode, if the cursor is on one brace (or bracket or parenthesis) of a matched pair, what keyboard shortcut will jump to the matching brace? Or how can I create such a shortcut?
An example of the feature I'm after is the "goto brace" shortcut in Visual Studio.
There is a Balance Delimiters menu command. So simply assign it any keyboard shortcut you prefer (all commands have customizable key bindings). You can also double-click the first delimiter to perform the same action.
A partial solution is to use code folding. For example, to jump from the opening brace to the closing brace:
Put the cursor just after the opening brace.
Fold with ⌥⌘←.
Arrow the cursor right to just before the closing brace.
Unfold with ⌥⌘←.
Since Xcode now has Vim mode you can use that and just hit %.
(Adding this answer for completeness - I understand it kind of amounts to "just use Vim".)
I just started using Visual Studio 2013. I liked the auto brace completion feature. But in C#, when I press enter after entering {, no extra line to write our code is formed, like in eclipse. Instead the cursor will be at the left side of the }. Did anybody notice that? Is there a way to fix it.
When I press Enter key after putting brace, the editor is like this:
class Example {
|}
(The cursor is where the pipeline character is..)
EDIT:
I just found that in Visual C++ 2013, the braces work as expected.
class Example {
|
}
(The cursor is where the pipeline character is..)
Check within Options on the Text Editor/All Langauges/General page. Select "Automatic brace completion."
By the way in 2013 you can search for words like "brace" at the top of the treeview control in Options to find all the pages were "brace" is found.
Answer taken from here.
Try typing
class
then press Tab.
Same goes for interface, if blocks, etc.
If you want to write a property, type
prop
then press Tab.
You can press Ctrl-Enter and it will reposition the closing brace as you expected. Because Ctrl-Enter makes a new line above the current line.
I'm editing a hugh Javascript file. For better orientation, it would be cool if I could change the style of all function keywords (not changing the style of all other keywords).
Can this be done in VS 2012 with Resharper?
Actually you can do this without ReSharper. Press ctrl+f, type "function", press enter and don't close find window. All occurences of word
"function" will be highlighted and you can continue your editing. When you close find windows, highlighting will be gone.
It's acutally not so hard to write a VS extension that does that or similar things. See templates etc. here: http://msdn.microsoft.com/en-us/library/dd885242.aspx
I'll mark this as the accepted answer as soon as I can.
Say you have a large amount of C# code in an if statement. If you place your carat next to the opening bracket, is there a hotkey or something in ReSharper that will automatically take you to the closing bracket?
VS offers this shortcut, regardless of whether you have R# installed.
Ctrl + ] will take you to the opening brace. Subsequent presses will jump between the RHS/LHS of the scope.
See Go to Matching Brace in Visual Studio? (now as an answer as requested!)
ReSharper assigns the shortcut (Control + ´ - I have german keyboard) to a different command. In order to restore it go to Tools - Options - Environment - Keyboard, search for Edit.GotoBrace and enter the desired shortcut key.
See to what command it is currently assigned and then remove it for this command first by searching this command and clicking Remove. Then again search for Edit.GotoBrace and assign the shortcut.
Directly assigning without Removing it first didn´t work.
Visual Studio's shortcut is (under the IntelliJ shortcut set): Control + ] when your cursor is on the opening brace goes to the ending brace. The inverse is also true.
I need to change the highlight color for the matched braces in VS2010.
I have tried the following setting but it doesn't work at all.
Any suggestion is welcome.
Thank you
From Microsoft
...There are two Fonts and Colors options for brace matching: "Brace
matching (Highlight)" and "Brace matching (Rectangle)". Not all
languages use both settings. Each language implements its own brace
matching functionality, which can lead to inconsistencies in which
options are used in which language. For example, C#, HTML, CSS, and a
few others do not use the "Brace matching (Highlight)" option at all,
which is why it doesn't do anything when you change it in those file
types. However, "Brace matching (Rectangle)" should still work for C#,
HTML, and CSS, which it sounds like is consistent with your
experience. Some other languages will have the reverse behavior, i.e.
"Brace matching (Rectangle)" will do nothing but "Brace matching
(Highlight)" will work...
Not a good answer, but that's where VS2010 stands right now. Incidentally, when I changed
"Brace Matching (Rectangle)" Background color, it works for me in C++ and C#, if I have my cursor immediately left of an open brace or immediately right of a closing brace.
Good luck.
(tools) (options)
under (environment) (fonts and colors)
show settings for (text editor)
under (display options) there are two brace matching entires
(Brace Matching Highlight) is the one that you want.
Change it, maybe restart vs 2010 for good luck.
I use Visual Assist X for that task. After setting up visual assist for Visual Studio, you can change the bracer match and mismatch color under the display tab in the Visual Assist options menu.
Change Highlighted Reference in Item background dropdown
Watch it, if you use ReSharper, these settings will have no effect.
You first have to enable the Fonts and Colors in the newest ReSharper version.