192

The Visual Studio editor highlights the current line by changing the background color of the current line. Is there a simple way to disable this highlighting? Otherwise, which parameter in Fonts and Colors dialog controls the background color of the currently selected line in the editor?

Sc0tTy
  • 636
  • 5
  • 12
Paul Dixon
  • 4,201
  • 7
  • 28
  • 27
  • The Beta version changes how the line highlighting is done—now it's a colored border around the current line—but I still don't like it! Great question; I spent way too long hunting around in the settings window but coming up empty handed. – Cody Gray - on strike Apr 18 '12 at 19:52
  • 1
    Is there a setting for changing the color as well? – Richard Ev Aug 16 '12 at 16:34
  • 3
    The colored bar is so annoying – jao Aug 23 '12 at 09:31
  • What was old is new again. – user942620 Oct 03 '19 at 13:57
  • Commentary is the best way for code organization; in visual studio it fails due to line gaps, cause a forwarded perception for having it with background color set; result the code visualization broken on better seeing it as a solid logical instructions when looking at the code; – H3sDW11e Feb 05 '20 at 16:02

9 Answers9

308

Is there a simple way to disable this highlighting?

Tools -> Options -> Text Editor, in the Display group, uncheck "Highlight current line"

Which parameter in Fonts and Colors dialog controls the background color of the currently selected line in the editor?

The colors are named "Highlight Current Line (Active)" and "Highlight Current Line (Inactive)"

James McNellis
  • 348,265
  • 75
  • 913
  • 977
  • 10
    My problem is that the small border around the "line highlight" obscures the squiggly warnings that R# puts underneath text. I don't suppose we can set the transparency of the border... – PandaWood Aug 24 '12 at 04:28
  • 1
    for me with R# 7.1 it works simply setting foreground color of Highlight Current Line (Active) as same as background color (in my case black) – Stefano.net Nov 22 '12 at 08:35
  • 1
    @Stefano.net wouldn't that make the highlight not visible, which is the same as turning it off? – joshua.ewer Nov 29 '12 at 20:12
  • 13
    The border was driving me nuts too! To get rid of it change the foreground color to "Automatic". This means you'll only be able to customise the background colour, but was good enough for me. – Doctor Jones Aug 06 '13 at 10:50
  • At least on my machine (VS2013), turning off the annoying highlight bar significantly sped up the scrolling speed - or at least changed from snail-speed to only slow. Changing the color of the bar probably wouldn't do that. – Wade Hatler Jun 18 '14 at 05:53
  • If you want remove the border, set background and forceground with same color. – Wolf Jan 13 '15 at 03:15
  • Got here for color names. – Joshua Jun 29 '16 at 15:29
  • In Visual Studio 2015 its under Tools > Options > Text Editor > General - last option - Highlight Current Line. – user2728841 Sep 07 '17 at 13:41
  • In Visual Studio 2017, the color settings (Active) and (Inactive) were combined into a single "Highlight Current Line" setting. – mbomb007 Jan 31 '18 at 14:37
34

To disable the border around the current line

In VS 2019

Go to : Environment -> Fonts and Colors:

Find the display item: Highlight Current Line

Set the item foreground color to: Automatic

In VS 2017 and earlier

Go to : Tools -> Options -> Text Editor:

Find the display items:

  • Highlight Current Line (Active)
  • Highlight Current Line (Inactive)

Set the item foreground color to: Automatic

Sc0tTy
  • 636
  • 5
  • 12
  • It's like a great weight has been lifted. The essence of this answer is that the border is controlled by the 'Item foreground" property, which can be used to set the border to any other selectable color as well as disabling it. I've avoided this setting in the past expecting that it would change the text color of the current line (like 'foreground' settings typically do). This is not the case - it only controls the border. I only wish I'd found Sc0tTy's answer years ago. – StarTrekRedneck Apr 30 '19 at 16:48
17

if its visual code make

"editor.renderLineHighlight": "none"
Imran Khan
  • 171
  • 1
  • 2
  • 2
    (mac) command + shift + p -> 'Preferences: Open Settings (JSON)' Drop the above code within the outermost bracket. – KazaJhodo Nov 05 '20 at 17:24
  • I couldn't find the 'Tools' or 'environment' mentioned on the above answers. This just worked. – uber Feb 21 '21 at 15:43
7

The Visual Studio editor highlights the current line by changing the background color of the current line.

The only time I've seen this is when "Use Windows High Contrast settings" is enabled (Options > Environment > General)

enter image description here

enter image description here

With this setting disabled, I just get a subtle grey box to indicate the current line (this may depend on your Color Theme):

enter image description here

Dunc
  • 18,404
  • 6
  • 86
  • 103
3

If you're using Resharper, it's:

Tools -> Options -> Text Editor:

  ReSharper Current Line Highlight
demoncodemonkey
  • 11,730
  • 10
  • 61
  • 103
2

press -> Ctrl + comma

Search => Render Line Highlight

select none from the options

Humayun Naseer
  • 440
  • 7
  • 18
2

For VsCode 2021 version users

Workspace > Text-Editor > Render Line Highlight > none

Piccolo
  • 31
  • 2
0

In addition to the previous answer, I'd like to mention that Visual Assist (the tomato icon) also have an highlight current line feature, that can still be active while your Visual Studio highlight option is turned off. This drove me crazy! Find it in Visual Assist Option panel, Display category.

So don't forget to also uncheck the VisualAssist highlight option.

edit my settings:

  • Visual Assist option turned off
  • Visual Studio option turned on (in the Text Editors part)
  • In the font color settings, for Highlight current line (active and inactive), set the foreground to Automatic
  • Finally you can set your highlight color as you want with the background color.

Last point, sometimes Visual Studio mess things up even more, you may have to restart it, or close/open your tabs... sadly, YMMV.

johan d
  • 2,798
  • 18
  • 26
-1

Visual assist and vsvim extensions were conflicting. So I disabled it within the visual assist options.

Uncheck the option: Highlighting->Highlight results of Quick Find and Find in Files. For some reason "esc" doesn't work .