144

When editing C# code in Visual Studio 2010, the ENTER key makes IntelliSense complete the current suggestion, without adding a new line.

In VB.NET, the default IntelliSense behavior for the ENTER key is to add a new line after completing the current suggestion.

How can I configure IntelliSense to change the VB.NET behavior to the C# one?

I already know that I could press TAB or SPACE, but out of habit I always end up hitting ENTER (and changing line).

Chris Mukherjee
  • 841
  • 9
  • 25

2 Answers2

124

UPDATE VISUAL STUDIO 2017:

Now with Visual Studio 2017 you can change it. Tools -> Options -> Text Editor -> Basic -> IntelliSense. In Enter key behavior select Never add new line on enter

ANSWER FOR VISUAL STUDIO 2015 AND PREVIOUS:

If you want to avoid inserting new line on enter with autocomplete suggestion, just don't press enter. Instead of Enter press Space bar which completes your autofill and just inserts a space.

Or you may use this third party app:

Resharper makes it possible overriding Visual Studio intellisense and using its own intellisense. It is the only way I've found. It has a 30 days free trial if you want to test it.

Community
  • 1
  • 1
Abdelilah El Aissaoui
  • 4,204
  • 2
  • 27
  • 47
  • 2
    Probably the answer most are looking for but for me it only sort of works as wanted. It doesn't allow for Enter to act just like the Tab to complete inline (like I'm used to from other editors). It allows Enter to act as a completion selector only after down-arrowing into the list. Now adapting to Tab instead. – juanitogan Dec 21 '17 at 19:27
  • @juanitogan I don't work with visual studio anymore but I think that there was an option to fix your problem. I am afraid I can't remember which options is. – Abdelilah El Aissaoui May 11 '18 at 08:25
  • 1
    Thanks, this has been a real annoyance, especially when moving between IDEs (Android Studio for example) – Benno Jul 17 '19 at 08:53
63

Unfortunately the set of trigger keys for intellisense completion is not a configurable item for VB.Net. There is no way in the default Visual Studio environment to change this behavior.

It would be possible to develop a plugin of sorts to accomplish this. However that's a pretty extreme measure.

EDIT As of Visual Studio 2017, it is now possible to change this. See the answer below

Riot Goes Woof
  • 3,504
  • 5
  • 20
  • 35
JaredPar
  • 733,204
  • 149
  • 1,241
  • 1,454