The title says it all.
"zenMode.hideLineNumbers": false[default] || true
We can consider adding this if more users ask
Would also be nice to have a similar option to hide minimap, those 2 would make zen mode look the same as atom's. Maybe they could be added together?
I too came here looking for a way to disable minimap in zen mode only.
As a workaround: using 2 extensions macros & Settings Cycler:
settings.json
"settings.cycle": [{
"id": "zen",
"values": [{
"editor.minimap.enabled": true,
"editor.lineNumbers": "on"
}, {
"editor.minimap.enabled": false,
"editor.lineNumbers": "off"
}]
}],
"macros": {
"zenMode": [
"settings.cycle.zen",
"workbench.action.toggleZenMode"
]
}
keybindings.json
{
"key": "ctrl+shift+f11",
"command": "macros.zenMode"
}
There are a number of feature requests that are "add/allow X in zen mode"
Would it make more sense to allow zen-mode specific settings in the same way that you can do language specific settings?
Ones like these:
"[markdown]": {
"editor.wordWrapColumn": 120,
"editor.wordWrap": "bounded"
},
"[javascript]": {
"editor.tabSize": 2
},
For example:
zenModeSettings: {
"editor.lineNumbers": "off"
}
I would also like to see this feature added.
I would also like to see this feature added.
This would be nice to have, to change zenmode to each own zen preference.
Adding support to hide minimap, line numbers and other gimmicks seems like a given thing to support.
I would also like to see this feature added.
It will be great if it could be configurable to look like Goyo for vim https://github.com/junegunn/goyo.vim
Making it configurable the way saborrie mentioned would be the best decision. That would close most of the "allow x in zen mode" issues.
Some other useful inclusions would be:
@isidorn fyi I am adding a new workbench-zen level to free up some issues from workbench-layout. I will assign zen and centered editor layout related issues.
@ikouchiha47 If I could have Goyo + Limelight in vscode! 馃槏
What is the status on that issue ?
This is a subset of this feature request https://github.com/Microsoft/vscode/issues/45617
However since this is the most highly requested zen mode configuration which I missing I am considering to add it without the other issue.
@bpasero in order to implement this I would need to go over all editors and update the configuration to hide line numbers. However the editor service and the editor group service only give me the IEditorInput to work with. How do I get the IEditor on which I can change options from the IEditorInput?
I can not put this setting into editor land since it belongs to the workbench.
@isidorn there is no API to get all editors that are opened because there is always just one editor open per group that is visible. A tab that is not visible does not allocate any editor widget. The only thing that does exist in memory is the associated model of the editor if it was opened during the session.
@bpasero thanks. But I would just need to get all the editor widgets (so at most 3). Is there some way to get them? Since hidding line number is an editor thing, not a model thing.
@isidorn IEditorService.visibleControls
@bpasero thanks, I got this working.
The only ugly thing is that I am listening on onDidVisibleEditorsChange which might be a bit too much.
I decided to go with the default value of true for this. Since I like hiding line numbers and I think it goes perfectly with zen. Also most other zen mode hide options are on by default.
To verify:
"zenMode.hideLineNumbers": false@isidorn yeah this is a bit ugly. ideally we could change zen settings to just be a special mode the workbench is in and all settings are derived from there (this would also prevent us from having to duplicate each setting name with a prefix for zen mode).
We could also think about adding this into the textEditor itself when the editor configuration is computed: https://github.com/Microsoft/vscode/blob/f886dd4fb84bb82478bfab4a68cd3f31b32f5eb5/src/vs/workbench/browser/parts/editor/textEditor.ts#L92
@bpasero as for your first point, that would be covered by this https://github.com/Microsoft/vscode/issues/45617 as I mentioned above.
I want ahead with this feature request because it seems like it is the only one left for zen mode configurations that are highly requested.
Regarding adding it in the textEditor, I can do it. But that would require that I add a dependency on the partService, that I expose in partService something like isZenModeActive and the textEditor would have to respect the zenMode.hideLineNumbers setting. Or alternativly the partService would have something like areLineNumberHidden which the textEditor would read out.
Let me know what you think
@isidorn yeah I would not add the partservice dependency, but isn't it just a setting if zen mode is on or not that you could also check?
@bpasero we do not store that in settings, but in local storage. Getting it direct from local storage is ugly, so a dependency to partService would be needed.
Anyways the current solution migth be better even though it is a bit ugly.
Most helpful comment
There are a number of feature requests that are "add/allow X in zen mode"
Would it make more sense to allow zen-mode specific settings in the same way that you can do language specific settings?
Ones like these:
For example: