Giter Site home page Giter Site logo

stephensli / toggler Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 1.0 120 KB

Toggle words and symbols in VSCode using a user defined configuration.

Home Page: https://marketplace.visualstudio.com/items?itemName=tehstun.toggler

License: MIT License

TypeScript 100.00%
formatter vscode vscode-extension toggler

toggler's Introduction

VSCode Toggler

OS X Build Status Dependency Status


THIS IS NO LONGER MAINTAINED, USE THE VSCODE VERSION OF THE BELOW ATOM EXTENSION HERE

Toggle words and symbols in VSCODE allowing for user defined configuration (This is a ported version from here for Atom).

Usage

Highlight the selected word or words* and press the associated keybinding to switch between commonly used opposites of its value (Ctrl+r by default on macOS and Linux, Alt+r on Windows).

You can also set your own custom shortcut key by going to the key binding settings File -> Preferences -> Keyboard Shortcuts. setting the when to: editorTextFocus and the command to : extension.toggler.

Configuration.

The core configuration can not be changed but can be updated within the settings.json file for VSCode. You can find this setting under File -> Preferences -> Settings. The custom changes will take priority over the existing default, this will allow you to overwrite the existing if you want too.

Default

[
  ["0", "1"],
  ["enable", "disable"],
  ["enabled", "disabled"],
  ["on", "off"],
  ["true", "false"],
  ["yes", "no"],

  ["(", ")"],
  ["[", "]"],
  ["[]", "{}"],
  ["{", "}"],
  ["'", "\"", "`"],

  ["*", "/"],
  ["*=", "/="],
  ["&", "|"],
  ["&&", "||"],
  ["+", "-"],
  ["++", "--"],
  ["+=", "-="],
  ["<", ">"],
  ["<<", ">>"],
  ["<=", ">="],
  ["==", "!="],
  ["===", "!=="],

  ["absolute", "relative"],
  ["high", "low"],
  ["horizontal", "vertical"],
  ["in", "out"],
  ["inner", "outer"],
  ["left", "right"],
  ["top", "bottom"],
  ["up", "down"],

  ["black", "white"],
  ["gray", "maroon", "red", "purple", "fuchsia", "green", "yellow", "blue", "aqua"],

  ["const", "let", "var"],
  ["import", "export"],
  ["join", "split"],
  ["JSON.parse", "JSON.stringify"],
  ["parse", "stringify"],
  ["pop", "push"],
  ["shift", "unshift"],
  ["test", "test.only"],

  ["atan", "tan"],
  ["ceil", "floor"],
  ["cos", "sin"],
  ["Math.atan", "Math.tan"],
  ["Math.ceil", "Math.floor"],
  ["Math.cos", "Math.sin"],
  ["Math.min", "Math.max"],
  ["min", "max"],

  ["addEventListener", "removeEventListener"],
  ["animationstart", "animationend"],
  ["change", "input", "submit"],
  ["click", "dblclick"],
  ["compositionstart", "compositionend"],
  ["copy", "cut", "paste"],
  ["dragenter", "dragleave"],
  ["dragstart", "dragend"],
  ["focus", "blur"],
  ["keydown", "keyup"],
  ["mousedown", "mouseup"],
  ["mouseenter", "mouseleave"],
  ["onAnimationStart", "onAnimationEnd"],
  ["onChange", "onInput", "onSubmit"],
  ["onClick", "onDoubleClick"],
  ["onCompositionStart", "onCompositionEnd"],
  ["onCopy", "onCut", "onPaste"],
  ["onDragEnter", "onDragLeave"],
  ["onDragStart", "onDragEnd"],
  ["onFocus", "onBlur"],
  ["onKeyDown", "onKeyUp"],
  ["onMouseDown", "onMouseUp"],
  ["onMouseEnter", "onMouseLeave"],
  ["onTouchStart", "onTouchEnd"],
  ["touchstart", "touchend"],

  ["div", "span"],
  ["head", "body"],
  ["header", "footer"],
  ["ol", "ul"],
  ["tr", "td"],

  ["componentDidMount", "componentWillUnmount"],
  ["getState", "setState"],

  ["activate", "deactivate"],
  ["add", "remove"],
  ["address", "port"],
  ["available", "unavailable"],
  ["background", "foreground"],
  ["before", "after"],
  ["client", "server"],
  ["connect", "disconnect"],
  ["connected", "disconnected"],
  ["drag", "drop"],
  ["file", "folder"],
  ["first", "last"],
  ["from", "to"],
  ["get", "set"],
  ["input", "output"],
  ["install", "uninstall"],
  ["key", "value"],
  ["load", "unload"],
  ["minor", "major"],
  ["online", "offline"],
  ["open", "close"],
  ["parent", "child"],
  ["positive", "negative"],
  ["prefix", "suffix"],
  ["previous", "next"],
  ["public", "private"],
  ["req", "res"],
  ["request", "response"],
  ["row", "column"],
  ["short", "long"],
  ["show", "hide"],
  ["source", "destination"],
  ["start", "stop"],
  ["valid", "invalid"],
  ["visible", "hidden"],
  ["width", "height"],
  ["x", "y"]
]

To add your own, add to the core setting toggler.words array by adding another array inside this array with your words.

"toggler.words": [
  ["true", "false"],
  ["cats", "dogs"]
]

License

© 2017 Stephen Lineker-Miller [email protected]

This is free software. It is licensed under the MIT License. Feel free to use this in your own work. However, if you modify and/or redistribute it, please attribute me in some way, and distribute your work under this or a similar license. A shout-out or a beer would be appreciated.

Donate

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.