What's the purpose of this arrow icon in the left margin / breakpoint bar in Visual Studio? [duplicate] - visual-studio

What does the following arrow icon mean in the Visual Studio 2012 gutter window? I've never seen it before.
This particular line of code has nothing special about it, nor do I recall doing anything to this line that would cause an arrow to appear. It's definately attached to this line of code. Moving the line of code down causes the arrow to follow.
I have no add-ons installed in Visual Studio.

It marks a Task List shortcut. You add them with Edit > Bookmarks > Add Task List Shortcut, [Ctrl+E,T] keystroke. That adds an entry to the task list, use View > Task List to display it. Select "Shortcuts" in the combobox. You'll see a list of all the shortcuts you added. Double-click an entry to jump to the line.
Remove it again with Edit > Bookmarks > Remove Task List Shortcut, [Ctrl+E,T] again.
NOTE: In visual studio 2015 and above, its [Ctrl+K,Ctrl+H]

Related

Is there a way to set a keyboard shortcut to open containing folder of a selected file in Solution Explorer in Visual Studio?

When I click on a C++ project in Visual Studio, I get this menu:
And so I can quickly press Alt+F,F(Command ProjectandSolutionContextMenus.Project.OpenFolderinFileExplorer) to open the folder of the project.
I also found that I can open containing folder if I open the file in the Text Editor in Visual Studio:
I bound it to Alt+F,F as well. I set it to only be active in Text Editor, it's the File.OpenContainingFolder command.
But when I click on files inside the project in the Solution Explorer, there is no context menu:
I tried to make the File.OpenContainingFolder command global, but it still doesn't work in the Solution Explorer when I just click on a file once. If I double click it and open it in the text editor, it works.
And I can't find a command in the Keyboard section in options of Visual Studio to open containing folder of a file selected in the Solution Explorer.
Maybe someone knows how to do it?
You can create an external tool menu item, and then bind a shortcut to that item.
Go to Tools > External Tools.
Click Add.
In Title edit box type Show in Explorer.
In Command edit box type explorer.exe.
In Arguments edit box type /select, $(ItemPath). There is a space between a comma and a dollar sign.
Click OK.
Make note at the position of the new command in the list. It could be first, it could be fifth, or something else. Let's assume it's the fifth one.
Assign a shortcut to the command Tools.ExternalCommand5. Restrict the shortcut to Solution Explorer.
That's it.

Visual Studio adds :1 to title

Today I updated to Visual Studio 2019 16.7.6 now I saw, that on the tab riders of code files there is the name and a ":1" added to it, like "Skaarhoj.vb:1". Does anybody know what that is?
It's visible when you have multiple views/windows (tabs) open for the same file.
Note that this is not the same thing as the split-view you can activate by dragging the handle at the top of the vertical scrollbar.
This is not a new feature - I can remember using it in VS2013, possibly VS2010.
The first window/tab has :1, the second has :2 and so on.
You can open new windows for most (but not all) files and file-types via (VS Main Menu) > Window > New Window
Note that not all editors/file-types support having multiple windows open simultaneously, so that menu item may appear disabled for some files.

Shortcut to change which statement is executed next

When debugging in Visual Studio, I can change the line of next execution by dragging the yellow arrow to the desired line.
Is it possible to put the cursor on a line and use a shortcut to do this instead of dragging?
I'm using Visual Studio 2008 at the moment, but this can be done by right-clicking on the source and selecting "Set Next Statement" from the popup menu. I would be surprised if this has been removed from VS2010.
If that's not short enough for you, you can go into "Tools" -> "Customise" and set up a keyboard shortcut to the "Debug.SetNextStatement" command. On my current setup (perhaps not the default), you can press CTRL+SHIFT+F10.

Adding a Visual Studio toolbar button for a command that is only available as a keyboard shortcut

This question relates to this ReSharper YouTrack issue.
In Visual Studio 2010 with ReSharper 7.1.1 installed, if I go to Tools > Options > Environment > Keyboard, there is a command called ReSharper_SilentCleanupCode.
I would like to bind this command to a toolbar button.
This seems to be impossible using Tools > Customize > Commands because the only commands available within this dialog are for actions that already have an associated menu item. The particular ReSharper command I'm interested in (Silent Code Cleanup) doesn't appear in any menu, so it cannot be assigned to a toolbar button using the "GUI".
Is there any other way to bind a keyboard-only command to a toolbar button? (One of ReSharper's programmers thought the "VS script editor" could be used, but I'm not having any luck finding info on this.)
Edit
I should have mentioned this in the first place. While azhrei's macro solution is great for Visual Studio 2010, it will break once I upgrade to VS 2012, because macros are no longer supported. If someone has a solution that will continue to work in VS 2012, that would be preferable. (Or perhaps VS 2012 toolbars don't have the same limitation in the first place?)
Add a macro that executes the command, then add the macro to a toolbar.
This works because it makes the keyboard-only command appear in the Macros menu in the Customize Commands dialog.
Details
Add a macro which does this:
Sub _ReSharper_SilentCleanupCode()
DTE.ExecuteCommand("ReSharper_SilentCleanupCode")
End Sub
Put this macro in a module which appears in Customize..Commands..AddCommand..Categories..Macros, such as Samples or MyMacros.RecordingModule, but not MyMacros.Module1 (the default when using the macro IDE).
Go to Tools..Customize..Command and select the Toolbar you want.
Now Add Command... and select the Macros category.
Select your Macros.Samples._ReSharper_SilentCleanupCode macro.
Click Modify Selection and change the name to #-) or whatever text makes you think ReSharper Silent Code Cleanup without being too long for your toolbar. :-)
I tried this with Visual Studio 2010 and ReSharper 7.1.2.
Edit
Visual Commander is a apparently way to get this going on VS2012 as well - see comments below for more.

Indentation - XAML

Does anybody know how to do an auto-indent a XAML file in Visual Studio 2010?
With the document open, press
CONTROL+K CONTROL+D
Menu - Edit:Advanced:Format Document (Your keyboard shortcut will be to the right of the menu item)
I find that if I just close the current object using the auto-complete functionality Visual Studio will indent everything in-between.
So you could just delete the last line of your XAML and then just start retyping the start of the line, hit tab and get your XAML indented.
Or you could just select Edit > Advanced > Format Document.

Resources