Compare files shows unchanged files TFS - visual-studio

I am trying to compare two branches on TFS and TFS is showing files which do not have any differences.
I tried taking latest and resolving conflicts but that did not help. I don't know what's the problem.
What else can I do to make it go away?

You probably need to turn off the option to trim whitespace, which can be found on the Compare Files toolbar:
You can also toggle Edit -> Advanced -> View Whitespace to see which ones are spaces vs. tabs, which on my machine has 3 separate keyboard mappings:
Ctrl+E, S
Ctrl+E, Ctrl+S
Ctrl+R, Ctrl+W
(You can remap this if you want by going to Tools -> Options -> Environment -> Keyboard.)

Related

Is it possible to force the opening `sln`-file with particular `vssettings`-file always?

I use Git for my Visual Studio solutions. Also I use my individual settings for this IDE text editors. But other programmers have their preferences for the same settings. Therefore often if they press the Ctrl + K + D keys in the Visual Studio text editor then the text formatting will be changed and when they push the changes back to Git then I'll see many changes which contradict to my formatting settings. Git will highlight it as change in code. Later, if I will press the Ctrl + K + D keys then that programmers will get the same problem when they pull the repository to their local machines...
I.e. it is a vicious circle...
So, the problem is what we use different settings of IDE text editors. I can export my settings to the vssettings-file and place it in my solution directory (and to include this file into my Git-repository, of course).
Is it possible to force Visual Studio that each time, when IDE opens my sln-file (i.e. the solution) then it is necessary to use the vssettings-file from the same directory if such vssettings-file exists?
I think it cannot be done without an extension.
A quick web search revealed this extension:
https://visualstudiogallery.msdn.microsoft.com/410e9b9f-65f3-4495-b68e-15567e543c58
You would have to force the other developers to use it, too.

Make all opened document tabs visible

I would like to see all files or documents I've opened in Visual Studio. I do not want them to be auto hidden or hidden on overflow.
How can I achieve it?
One of the built-in option to do so: use pinned tabs.
http://dailydotnettips.com/2016/01/21/persevering-and-separating-the-pinned-tabs-in-visual-studio/
If you don't want to read a external page just for setting:
Tools -> Options -> Environment -> Tabs and Windows -> Show pinned tabs in a seperate row
It's not completely what you want, but it's free and may be useful.
Maybe it's not exactly what you search, but here is a way to at least get a second row for pinned tabs.
Effectively get you more space for opened files:
Tools -> Options -> Environment -> Tabs and Windows -> Show pinned tabs in a seperate row
Visual Studio has this extension taken from msdn.microsoft.com tested and worked
Simple installation: download, doubleclick to install, restart VS IDE. Then open all the tabs you want they all will be displayed and No hidden.
https://visualstudiogallery.msdn.microsoft.com/EBF6137E-AA2D-4DC9-860A-F04168F11CD7
Dung Le.
It's worth noting that starting in VS 2019 v16.4, you can now have "vertical tabs" which will list all open tabs vertically, making it easy to see all open files.
https://learn.microsoft.com/en-us/visualstudio/ide/customizing-window-layouts-in-visual-studio?view=vs-2019#vertical-document-tabs
In Visual Studio 2022, this issue now has a native solution. Go to Tools -> Options -> Environment -> Tabs and Windows -> Show tabs in multiple rows. Excess tabs will be shown on additional rows. There doesn't seem to be a limit on how many rows this can use.
Another relevant option that some may find useful; you can choose "Show invisible tabs in italic in tab dropdown menu". The dropdown button is only visible when you hover your mouse near the end of the row of tabs. Showing invisible windows in italics makes it easier to identify windows that are only visible in the overflow menu.
For those using Visual Studio 2022, check the "Show tabs in multiple rows" setting in Tools > Options > Environment > Tabs and Windows section.
For Visual Studio Code
If you want to see all the opened tabs,
you can simply on wrap tabs option in the VS Code settings
settings > User > Workbench > Editor > Wrap Tabs

How do I strip trailing whitespace before each save in Cloud9?

Cloud9 has a command under Tools called "Strip Trailing Space". I want to automatically run this command before every time I save a file, so I can be sure my files never contain trailing spaces. How is that done?
After frustratedly Googling for quite a while, I can find no documentation on how to achieve stuff like this. They claim Cloud9 is the most hackable IDE in the world though, so it ought to be possible.
Well this is embarrassing, but I combed through the preferences again and found the option On Save, Strip Whitespace under Cloud9 -> Preferences -> Code Editor (Ace).
As of July 2015 it is under Cloud9 > "Open your Project Settings" in the top menu bar.
"general": {
"#stripws": false
},
AWS Cloud9 has changed the option On Save, Strip Whitespace location to under Cloud9 -> Preferences -> Project Settings -> Code Editor (Ace)

key bindings visual studio 2013 to switch tabs

I was wondering if there are any hotkeys by default key bindings I can add to Visual Studio 2013 to switch tabs. I know you can ctrl+tab and shift+ctrl+tab to go forward and backwards in VS13's list of open tabs, but I prefer i Xcode or sublime text where you can just cmd+shift+] or cmd+shift+[ to go to the right tab or left tab respectively. Does anyone know if there is a way for this? I can't seem to find one. Thanks.
I guess you can do it. I don't know why I couldn't find this before:
http://www.jetbrains.com/resharper/webhelp/Configuring_Keyboard_Shortcuts.html
Keyboard shortcuts in VS can be configured in Tools -> Options -> Environment -> Keyboard. You can find commands either by searching for their name ("Show commands containing:") or by pressing a known shortcut and seeing which commands it's mapped to ("Press shortcut keys:").
It looks like you need to set Window.NextDocumentNav and Window.PreviousDocumentNav.

Disabling single line copy in Visual Studio

Is there anyway to disable the rather annoying feature that Visual Studio (2008 in my case) has of copying the line (with text on it) the cursor is on when CTRL-C is pressed and no selection is made?
I know of the option to disable copying blank lines. But this is driving me crazy as well.
ETA: I'm not looking to customize the keyboard shortcut.
ETA-II: I am NOT looking for "Tools->Options->Text Editor->All Languages->Apply cut or copy to blank lines...".
The real problem you probably experience is that you go to paste, with CTRL+V. And you accidentally type CTRL+C, and end up overwriting the stuff that's on your clipboard. You can't disable this as far as I know, however, the work around for this, is that you can press CTRL+SHIFT+V multiple times to go back up the stack of things you have copied in visual studio. Not only does this allow you to recover what you originally copied, but you'll also find that CTRL+SHIFT+V very useful in a lot of other situations.
If you aren't willing to customize the keyboard settings, then Ctrl+C will always be Edit.Copy, which will copy the current line if nothing is selected. If you aren't willing to use the tools VS provides to customize the interface, then you can't do it.
However, the following works:
Assign this macro to Ctrl+C:
Sub CopyOnlyIfSelection()
Dim s As String = DTE.ActiveDocument.Selection.Text
Dim n As Integer = Len(s)
If n > 0 Then
DTE.ActiveDocument.Selection.Copy()
End If
End Sub
There's an extension called CopyOnlySelection for visual studio 2019 and 2017:
https://marketplace.visualstudio.com/items?itemName=KiwiProductions.CopyOnlySelection
This won't solve it immediately, but will add another command called Edit.CopyOnlySelection, which you can bind to Ctrl+C (and remove Ctrl+C from the normal Edit.Copy).
I'm pretty sure the way to do it in 2008 is the same as the way in 2005... check out this tutorial on 'customizing keyboard shortcuts' (about 1/3 of the way down)
http://msdn.microsoft.com/en-us/library/bb245788(VS.80).aspx
I don't believe it is possible to do this without some type of 3rd party clip board manager that would prevent you from overwriting the clipboard content with the empty string.
I've the free SlickEdit add-in installed, and its CommandSpy feature shows that Ctrl+C executes Edit.Copy whether you've got text highlighted or not. Therefore I guess the answer to your question is No.
However, I do remember this feature annoying the hell out of me when I first encountered it; now I rely on it and get annoyed when I try the same trick in other programs and nothing happens.
I have the same problem, but I found a workaround of it.
When I click one time on word in text editor, all occurrences of it are highlighted.
Then I think I will copy this word. But double-click will select text to copy only.
I copy then whole line instead wanted text.
Problem Is: Color of highlighted text parts are very similar to selected text.
I changed these colors to make it easy to distinguish between the situations.
Tools -> Options -> Environment -> Font and colors -> Selected Text
Tools -> Options -> Environment ->Font and colors -> Highlighted references
This is fixed in the latest preview of VS2022 (17.4.0 Preview 3.0)
It now has the option: 'Cut or Copy the current line without selection' and I can confirm that it works.
As for the original question, I don't think it will be fixed in VS2008 :-)

Resources