How do I add a margin between the gutter and code editor?

I have a editor setup, and would like to add some space between the gutter and the code. I would like the yellow in the following example to be white space.

A good example would be a screenshot from Visual Studo Code where the numbers are farther away from the code.

You want a style like .CodeMirror-lines { padding-left: 10px }

2 Likes

When I do this, the numbers in the gutter also move to left! Is there a way to avoid that?

1 Like

On my environment, I could achieve this by setting negative position for -linenumber:

  .CodeMirror-lines {
    padding-left: 0.5rem;
  }

  .CodeMirror-linenumber {
    left: -0.5rem !important;
  }