I've a project on Visual Studio 2019 (with Resharper Ultimate enable) and has been a terrible experience because I can't read the entire line of the code (I've myopia so my font size is 15~18)
But I see that this margin occupies so much space.
Is there any way to change this? I want to keep the number of lines.
For vs 2022 you must set this:
Disable the "Inheritance Margin": Options -> Text Editor -> C# -> Advanced -> Inheritance Margin -> Uncheck "Show inheritance margin"
config
source
Just go to the menu Tools and select the Options submenu.
Then go to the Text Editor node, expand it and go to All Languages node.
Here you will find the Line Numbers option.
Just remove the check to hide the line numbers
Turn off glyph margin in Settings. (I'm currently using VS Code in ubuntu 18.04... should be similar in other OS I think
In settings
It will remove the excess space used for adding breakpoints,etc
Before:
Before
After:
After
I have Visual Studio 2017 for C# (Express and Community) and I am trying to add some inline comments to my class attributes for Doxygen. Between my declaration and my comment I wish to have tabs to align my comments properly. VS however replaces those tabs with spaces every time I hit the autoformat keys Ctrl-K Ctrl-D. It doesn't help to set "Keep tabs" under "Tools/Options/Text Editor/C#/Tabs". VS doesn't keep those tabs anyway. I didn't find anything under "C#/Code Style/Formatting" either.
Is there anyway to prevent autoformat from replacing my tabs?
I already tried asking on MSDN, but everything they told my to try out didn't help, see here.
I recently switched to Visual Studio Code and I love it! It starts so quickly andI just enjoy the open source environment more than Visual Studio. But there's one problem that I have encountered that bothers me more than it should.
Before I could if I wanted to autocomplete the syntax for an if statement I'd just be able to type in "if" and touble tap tab, but now the autocompletion IntelliSense things pop up in the wrong order:
The red box is the wrong one that gets displayed first and the green box is the one I want at the top. My question is if there's a way to configure it so that I get that statement at the top. It's the same with for-loops, foreach-loops and pretty much every other autocompletion that I want to use.
Create snippet (or edit) ctrl+shift+p Preferences: Configure User Snippets
settings (ctrl+,)
"editor.snippetSuggestions": "top",
NOTE The keyword here is "default". I know I can hit escape and the default behavior gets aborted. I don't want to hit the escape key every time the IDE thinks it knows what I want. I didn't have to do this in 2013.
ADDENDUM 2 It seems I'm still having difficulty communicating what I'm after here. What I want to happen is nothing when I press the space bar... I just want a space character to show up on my screen. The only time I want the IDE to actually insert a suggestion is when I hit the tab bar. I hope that's clearer?
This is driving me nuts. 2013 and before allowed you to set completion characters (maybe that was resharper?) But in 2015 I see no way to stop the default behavior of autocomplete.
For example, say I have a class Foo, but I don't have the namespace specified already, yet I have a class FooBar in one of the specified namespaces, if I type:
public void DoSomething(Foo// <-- then a space)
...it automatically puts FooBar. How the heck do I turn off this behavior?
I should mention that I still want Autocomplete, just on tab though.
Edit -> Intellisense -> Toggle Completion Mode
From : https://msdn.microsoft.com/en-us/library/hcw1s69b.aspx
"You can also change to suggestion mode, in which only the text you type is inserted into the code. For example, if you enter an identifier that is not in the list and press TAB, in completion mode the entry would replace the typed identifier. To toggle between completion mode and suggestion mode, press CTRL+ALT+SPACEBAR or click Edit/IntelliSense/Toggle Completion Mode."
For all who have the same problem in Visual Studio Code, add this line to the User Settings:
"editor.acceptSuggestionOnCommitCharacter": false
change the setting for Editor: Accept Suggestion On Enter to off
If you're using Resharper and Visual studio 2017, you may need to use a combination of the existing answers to stop getting the autocomplete behaviour when pressing space. This is too long for a comment so added an answer.
Make sure in Visual studio that intellisense Toggle Complete Mode is off/unselected (as noted in other answers). Note: If you turn on the "Text editor" icons in the VS toolbar at the top, you'll see an extra icon that gets highlighted on and off showing you whether intellisense is toggled on or off.
AND
In the resharper dropdown on the toolbar (Resharper > Options...), Go to IntelliSense > Completing Charactes > and then uncheck the "Complete on space" box for C#.
Now autocomplete doesn't occur when pressing space (can still use tab, etc to autocomplete).
(Related aside: This autocomplete on space is really bad if you use VSVim, because you can't by default use the typically vim ESC key to 'get out' of the autocomplete mode. e.g. it's very difficult to even type in the static modifier for a variable/function without it changing to some other autocomplete choice.)
If you use Vs2017 and the setting resets everytime you launch Vs, i created a small script that automatically disables space completion at launch using Visual Commander Extension:
enter link description here
Visual Studio 2019 Pro -> Options -> Text Editor -> Advanced -> disable "Responsive code completion"
This disables Completion Mode, but doesn't take effect when VS is restarted.
You have to enable & disable it again after each restart, which is worse than using the Toggle Completion Mode menu option.
Since it is in Options, it is probably supposed to be a permanent setting.
Since Visual Studio is constantly changing, I imagine there will constantly be new answers for this. None of the other answers worked for me on Visual Studio 2019 Community Edition. What did work (as of January 2022) was:
Edit > IntelliSense > Switch between automatic and tab-only
IntelliSense completion
Alternatively, you can just toggle it with Ctrl+Alt+Space. Hopefully this helps someone else. Also, I've noticed Visual Studio doesn't seem to remember this setting, and I've had to toggle it again the next time I used VS.
For those looking for the same thing in VSCode (2022)
File -> Preferences -> Settings and search for Accept Suggestion On Commit Character.
Make sure this setting is unchecked:
For the current version of Visual Studio Code (2020), you can change to suggestion mode by going to File > Preferences > Settings and then going to Extensions > TypeScript and then checking TypeScript: Disable Automatic Type Acquisition. Or, after going to Settings, you can search for "Type Acquisition" in "Search Settings" and then check TypeScript: Disable Automatic Type Acquisition.
Default IntelliSense completion mode
Another option for VS19 Enterprise:
Visual Studio 2019 Enterprise -> Options -> Text Editor -> Advanced -> Default IntelliSense completion mode -> Dropdown -> Tab-only
I just did this in Visual Studio by going to:
File > Preferences > Settings > toggle "Suggest on Trigger Characters"
I also toggled off "Auto Suggestion on Commit Character" and "Accept Suggestion on Enter"
- however you may want those settings.
I am trying to put line numbers in Visual Studio.
Usually I go for
Tools -> Options -> Text Editor -> C#
A new machine was assigned to me with preinstalled VS 2008. I am unable to find the C# option.
Any solution ? Thanks in Advance
First, you need to check the box labeled "Show all settings" in the lower left-hand corner.
Then, you can expand "Text Editor", select "C#", and check "Line numbers". (You can also enable this setting for all languages, rather than individual ones, if you prefer.)
And while you're at it, you probably want to crank up "Animate environment tools" to the max. No point in waiting around on the IDE to show pretty animations when you have code to write!
Check the "Show All Settings" checkbox at the bottom of the dialog. It should then show all supported languages, although you may be better setting "All Languages" rather than setting it for each individual language..