Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to make vscode line number field smaller width?

The vertical column that contains the code line number is VSC is too wide. Is there a way to narrow it down?

vsc view of line numbers

like image 938
CJ Jean Avatar asked Jul 04 '17 18:07

CJ Jean


People also ask

How do I change the line spacing in Visual Studio code?

For VS 2022 There's a built-in setting for that, just open the Tools menu > Options > Text Editor > General and look for a setting called Line Spacing, change its value to one of your liking.

How do you make a VS Code smaller?

You can adjust the Zoom level in VS Code with the View > Appearance > Zoom commands. The zoom level increases or decreases by 20% each time a Zoom command is executed.

How do I change line numbers in Visual Studio?

On the menu bar, choose Tools > Options. Expand the Text Editor node, and then select either the language you're using or All Languages to turn on line numbers in all supported programming languages. You can also type line number in the Search box, and then choose Turn line numbers on or off from the results.

What is Zen mode in VS Code?

Zen mode is a feature in a VS Code that hides all UI (Status Bar, Activity Bar, Panel, and Sidebar) and displays only the editor on a full screen. Zen Mode.


1 Answers

You can't change the size of this column.

Actually there are three columns:

enter image description here

  • left of the linenumber is the column called glyphMargin, the place to set debugging breakpoints (red dot). (When you edit settings, the column displays a pen when you point on the line as seen in the screenshots below)
  • the line number itself
  • right of it you can fold/unfold your code.

If all three are active, it looks like this (settings) or a like above (code)

enter image description here

To save space you can

  • switch off the display of line numbers:

    "editor.lineNumbers": "off" 

    enter image description here

  • switch off the code folding feature:

    "editor.folding": false 

    enter image description here

  • if you don't use the debugger, disable the glyphMargin:

    "editor.glyphMargin": false 

    enter image description here

This is probably not what you want, but if you don't use code folding or the debugger or don't need linenumbers, you can at least save a little bit of space. To change these settings press ctrl, or click on the menu file/preferences/settings.

like image 160
jps Avatar answered Sep 19 '22 18:09

jps