How to enable word wrap in Visual Studio for Mac? - visual-studio-mac

I found a lot of examples and methods to word wrap in Visual Studio Code but not for VS for Mac. Currently, I'm using the Enterprise edition with the latest updates.

As of VS Mac 8.1, Word Wrap is available via Visual Studio -> Preferences -> Text Editor -> General. You should see a checkbox option for Word wrap.
8.1 Release Notes:
https://learn.microsoft.com/en-us/visualstudio/releasenotes/vs2019-mac-relnotes-v8.1

Thanks to Matt Ward for let me know that this isn't implemented yet, but I managed to play around with the preferences. It's not perfect as VS for Windows, but it's close enough.
(Sorry that the VS for Mac is in spanish)
1) I made a few modifications in text files: 120 columns and remove the whitespaces at the end of the line.
2) Since I'm using a Macbook pro mid 2012 my screen resolution it's limited to 1280x80, so in XML files I set only 3 attributes per line, adjust the attributes and align the attributes.
3) I made modifications in C# but was only to set the system's using at the end of the block.
4) Finally, I made a keyboard shortcut for "Format the document"
Before format
After format

Related

Change syntax highlight for Javascript in visual studio 2019

Can you customise colors of javascript editor in visual studio 2019 to have the same has in vscode, I already look into the police and fonts editor of vs2019 + extensions for more User Tags but none of them change the colors settings.
What I want
What I have
I having same problem, Javascript sytnax color in Visual Studio 2019 seems broken for now:
https://developercommunity.visualstudio.com/content/problem/1127320/lost-typescript-intellisense-and-sytnax-coloring-i.html
The only solution for me is using VSCode..
VS ReShaper extension supports VSCode-like syntax highlighting:
https://www.jetbrains.com/help/resharper/Coding_Assistance__Syntax_Highlighting.html
Example: https://i.imgur.com/Atw4yBP.png
The only caveat being ReShaper is not free and causes lag. However, there are many extensions claiming to replace (parts of) ReShaper and chances are one of these also enables similar syntax highlighting.

What’s “tabs are not allowed in f# code unless the #indent off option is used” Error?

what’s “tabs are not allowed in f# code unless the #indent off option is used” Error?
I use the last version .netcore and vs 2019. I want to use the lightweight syntax
When using lightweight syntax, you must use spaces, not tabs, for indentation.
Most editors have an option (including Visual Studio, by default) will turn a tab into spaces automatically when you type. I suspect this was written in a different editor and opened in VS.
In Visual Studio 2019, if you select everything in your document, and do Edit->Advanced->Untabify Selected Lines, it will correct it for you, as well.

How to Reset Window Layout in Visual Studio for Mac

Is it possible to reset window layout in Visual Studio for Mac? I am able to do this for Visual Studios on Windows, but not on Mac version.
After piecing together various posts I found only a non-UI way to reset the layout. Starting with this doc: http://www.monodevelop.com/developers/articles/user-profiles/ but instead of using the path "MonoDevelop" use "VisualStudio". So in the case of a Mac the folder to visit is at "~/Library/Preferences/VisualStudio".
Once there I found the "7.0" subfolder had a file named "EditingLayout.xml"... With VS for Mac not running, I deleted that file and started it again. This restored all pads to their default state from what I can tell. In my case the "Application Output" window was still not available as a Pad until I actually did a Debug on a project, and then it was visible again in the View | Pads list (and no longer lost in the UI somewhere).
You can press the view tab to change the different layouts or create one of your own.
Additional informations can be found here:
https://learn.microsoft.com/en-us/visualstudio/mac/customizing-the-ide?view=vsmac-2019
I met this problem also, Visual Studio for Mac can't reset Window Layout in UI. But you can easily customize the Window Layout. Just select "View->Pads/Debug Pads" to decide what window you want to show on the dashboard.
enter image description here
Just to have a more up-to-date answer: when you quit Visual Studio Mac 2019, any changes made to the active layout will be reset to how the layout was saved.
From the Visual Studio Website:"There is always one active layout and any change you make in a layout, such as adding or repositioning a pad, will only change the active layout. Once you close Visual Studio for Mac, the changes you have made will not be saved." Visual Studio Website - Customising The IDE
I've tested it out for Visual Studio Community 2019 for Mac Version 8.7.8 (build 4), and now it really does just reset when you quit the app, unless you have specifically saved any changes as a new layout.

Visual Studio .NET 2003 on Windows 7 hangs on search

So I have Visual Studio 2003 running on Windows 7 - yeah I am aware it isn't officially supported - and no, unfortunately I can't change that situation :-(
For the most part it works OK but I have a specific problem, that I can't figure out. The application hangs if you do a project wide search (Ctrl - Shift - F) for a string.
I have a reasonably powerful machine and all the other heavy tasks like compiling and debugging all work fine. It also works if I restrict the search to the current document (Ctrl - F). I am running it as administrator and VS.NET 2003 SP1 has been applied.
The size of the project does not seem to be a problem since a colleague is also experiencing this issue for a single project solution containing 5 pages.
I am currently using Windows Search as a work-around and I was wondering if there is something I missed that I should try.
Try disabling the Aero theme in compatibility. Yeah seriously...
You can do this by right clicking the shortcut to launch VS.NET 2003 and selecting properties, choosing the “Compatibility” sub-tab and then checking “Disable Desktop Compositing” as well as “Disable Visual Themes”
I use Windows 8.1, and the path
[HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers]
is invisible and could not be created manually inside regedit.exe.
So I wrote a registry file "abc.reg" with text:
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers]
"C:\\Program Files (x86)\\Microsoft Visual Studio .NET 2003\\Common7\\IDE\\devenv.exe"="^ RUNASADMIN DISABLEDWM DISABLETHEMES"
Execute it by double click icon of "abc.reg" (may be Run As "Administrator").
It works.
(The post is for your convenience in this certain case)
I am running Windows 10 Enterprise 1909 and found global search also causes VS2003 to freeze and stop responding.
The advised registry edit did not work for me - VS2003 refuses to start up when run as admin:
A referral was returned from the server.
This is the same error I get if allowing the compatibility trouble-shooter to apply Windows XP (Service Pack 3).
I can get global search working if I remove RUNASADMIN and DISABLEDWM from the registry value (I.E. leave only DISABLETHEMES in place).
Create a registry key as follows:
Location: HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers
New: String Value
Name: C:\Program Files (x86)\Microsoft Visual Studio .NET 2003\Common7\IDE\devenv.exe
Value: ^ DISABLETHEMES
You will end up with an even uglier UI (quite an achievement in itself!) but at least global search will now work.

Stand-alone text editor with Visual Studio editor functionality

Is anyone aware of any text editors with Visual Studio editor functionality? Specifically, I'm looking for the following features:
CTRL+C anywhere on the line, no text selected -> the whole line is copied
CTRL+X or SHIFT+DEL anywhere on the line, no text selected -> the whole line cut
Thanks!
Komodo Edit does the two things you specified.
I use it all the time as a secondary editor, for various scripting and other programming tasks. Tons of features, free, open source.
Zeus can emulate the Visual Studio keyboard.
To change the keyboard mapping just use the Options, Editor Option menu and in the Keyboard panel and select the MSVC as the active keyboard mapping.
(source: zeusedit.com)
Notepad++, UltraEdit and TextPad are good ones.
EditPad Pro will cut or copy the line the cursor is on when no text is selected. People sometimes report that as a bug.
Twistpad looks something like Visual Studio 2005/2008 editor and seems has the same key bindings, including Ctrl-X to cut whole line if no text was marked.
Slickedit
Not to steal Chris' thunder for his suggestions on Notepad++, UltraEdit, and TextPad, but I would like to point out that there is a version of UltraEdit which can be run from a thumb drive (for those people who lack Admin rights at work and can not install programs).

Resources