How to highlight current line number in Visual Studio Code / VS Code

Viewed 15046

I am in the process of migrating from Atom to VS Code, as it seems to be what all the cool kids use these days.

In atom I was able to highlight the current line number as pictured (the blue highlight in the gutter).

Is there a way to do this in VS Code? With a setting or extension? Can't find a way to do it, and really missing that obvious at-a-glance indication of where I'm working.

(I know that I can add a background to the current line itself, but this is too intrusive to the code, especially working with a variety of languages in different colours.)

Thanks!

line number highlight in Atom

2 Answers

You could try

"editor.renderLineHighlight": "gutter"

UPDATE

In an ideal world I'd want both the gutter and the line itself highlighted, but in 2 very different colours - sadly that one doesn't seem possible, but this option is better than nothing!

Well, you may try something like settings below, liner number in different color as well as box for the line

"editor.renderLineHighlight": "all",
"workbench.colorCustomizations": {
    "editor.lineHighlightBackground": "#00000000",
    "editor.lineHighlightBorder": "#0000ff"
}

To address dark and light themes

In the settings.json file add something like:

    "workbench.colorCustomizations": {
        "[Default Dark+]": {
            "editor.lineHighlightBackground": "#00000071",
        },
        "[Default Light+]": {
            "editor.lineHighlightBackground": "#0000003f",
        }
    },

Related