Adapting Leo's settings for leoInteg

23 views
Skip to first unread message

Edward K. Ream

unread,
Sep 17, 2020, 9:45:18 AM9/17/20
to leo-editor
vs code saves most user settings in code/user/settings.json. Overrides of key bindings appear in code/user/keybindings.json. Just where the "code" directory resides depends on platform.

Here is my settings.json:
{
   
// For Custom CSS & JS Loader
   
"vscode_custom_css.imports": ["file:///C:/Users/edreamleo/.vscode/ekr_custom.css"],
   
"vscode_custom_css.policy": true,

   
// General settings
   
"breadcrumbs.enabled": true,
   
"debug.console.closeOnEnd": true,
   
"debug.openExplorerOnEnd": true,
   
"editor.minimap.enabled": false,
   
"editor.renderControlCharacters": false,
   
"editor.renderWhitespace": "none",
   
"editor.suggestSelection": "first",
   
"liveshare.allowInvites": "all",
   
"python.languageServer": "Microsoft",
   
"timeline.excludeSources": [],
   
"vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
   
"window.zoomLevel": 2,
   
"workbench.activityBar.visible": true,
   
"workbench.colorTheme": "Default High Contrast",
   
"workbench.sideBar.location": "left",
   
"workbench.startupEditor": "newUntitledFile",
   
// "workbench.editor.revealIfOpen": true

   
// leoInteg settings.
   
"leoIntegration.connectToServerAutomatically": true,
   
"leoIntegration.invertNodeContrast": true,
   
"leoIntegration.leoPythonCommand": "python",
   
"leoIntegration.leoTreeBrowse": true,
   
"leoIntegration.showMarkOnNodes": true,
   
"leoIntegration.startServerAutomatically": true,
   
// "leoIntegration.connectToServerAutomatically": true,
   
// "leoIntegration.startServerAutomatically": true,
}

leoInteg defines its options in package.json.  A typical entry is:

        "leoIntegration.leoTreeBrowse": {
          "scope""application",
          "default"true,
          "type""boolean",
          "description""Specifies whether to use Leo's style of tree browsing with the arrow keys"
        },

In leoSettings.leo, this corresponds to @bool leoIntegration.leoTreeBrowse = True, with the description in the body pane. However, Leo has no analog to the "scope" field.

Some ideas

When using leoInteg, Leo's bridge access Leo's settings as always, with settings allowed in the local .leo file, myLeoSettings.leo and leoSettings.leo. That's fine for now, but I'm thinking that vs code's view of settings is more natural. So eventually the leoInteg project might use vs code settings for all of Leo's settings. To do that, we need the following:

1. A script to convert settings in leoSettings to entries in package.json. myLeoSettings.leo would correspond to code/user/settings.json, except for key bindings, which would reside in code/user/keybindings.json.

2. Leo's bridge would patch Leo's configuration machinery to get settings and bindings from the vs code .json files, not Leo's settings files.

Summary

Using vs code settings is a low priority project at present, but I think it's worth mentioning.

All comments welcome.

Edward
Reply all
Reply to author
Forward
0 new messages