Git Product home page Git Product logo

vscode-setting-toggle's Introduction

Setting Toggle

Easily toggle any VS code setting

This extension lets you toggle up to 3 custom settings defined in the settings.json file.

  • The primary setting can be toggled using the T button.
  • Status bar can be use to show the 3 settings and can be clicked to toggle.
  • Boolean fields will be toggled by default. However, one pair of two preset values can be toggled (string and ints).

setting-toggle-image1


setting-toggle-status-bar


The commands to toggle the three settings are:

  • Setting Toggle - Toggle Primary Setting
  • Setting Toggle - Toggle S1 Setting
  • Setting Toggle - Toggle S2 Setting

Settings

  • "toggle.settingTitle": Title of the primary setting, can be toggled using the button. Default is "editor.codeLens".
  • "toggle.setting1Title": Title of setting 1 for toggle.
  • "toggle.setting2Title": Title of setting 2 for toggle.
  • "toggle.settingState1": Custom value of state 1 for toggle, eg. "on".
  • "toggle.settingState2": Custom value of state 2 for toggle, eg. "off".
  • "toggle.iconEnabled": Show or hide the button icon. Default is true.
  • "toggle.showStatusbarPrimary": Show Primary toggle in status bar. Default is true.
  • "toggle.showStatusbarS1": Show S1 toggle in status bar. Default is false.
  • "toggle.showStatusbarS2": Show S2 toggle in status bar. Default is false.

  • The toggled setting gets automatically updated in your settings.json file.
  • CodeLens is toggled by default.
  • To toggle a custom setting, update your settings.json file with "toggle.settingTitle": to the name of the custom setting in the user settings, eg.
    "toggle.settingTitle": "workbench.activityBar.visible",
  • To use the Setting 1 and 2, assign the setting name to setting1Title and setting2Title.
    "toggle.setting1Title": "editor.codeLens",
    "toggle.setting2Title": "editor.parameterHints",

Language specific settings

Language specific (nested) settings are supported by using the following syntax:

    "toggle.settingTitle": "[terraform]editor.codeLens",

Will toggle the following:

    "[terraform]": {
        "editor.codeLens": false
    },

setting-toggle-demo.gif


  • To toggle a non-boolean setting, assign State1 and State2 the values you want to toggle between. The setting is only toggled if the current value matches either State1 or State2.
    "editor.wordWrap": "off",
    "toggle.settingTitle": "editor.wordWrap",
    "toggle.settingState1": "off",
    "toggle.settingState2": "wordWrapColumn",

Toggle font size using ints.

setting-toggle-demo-states_ints.gif


Toggle word wrap using custom strings.

setting-toggle-demo-states_strings.gif


Known Issues

  • If "settings.json" is open with unsaved changes, the setting will not be toggled.

vscode-setting-toggle's People

Contributors

ho-wan avatar ho-wan-arb avatar aarkue avatar howant avatar dreamfliper avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.