GithubHelp home page GithubHelp logo

padsel's Introduction

padSel

Column Helper for vsCode


Because vsCodes lack of a real column edit function some typework is needed to pretty up comments
This easy to adapt Python script may save some time

  • install multi-command and command-runner extensions in vsCode
  • add extension settings to settings.json and adapt paths for your system
    optionally bind a key to invoke the script in keybindings.json
  • Python has to be installed on your system

  • select some code lines, be careful to select complete lines
  • the line in the selection with the right most comment is used as position template
    if no existing comments are found a default position is used
    already commented or longer lines are ignored
  • press your binded key or run multiCommand.padSel (with command palette)
  • the selection will be processed and replaced

  • see script for adding programming languages
  • for debugging and error messages change in settings.json
    "command-runner.terminal.autoFocus": true
  • if terminal.autoFocus is true or on slow machines try
    "interval": 500
  • adapt paths to python interpreter and script for your system
    "padSel": "..\\python.exe ..\\padSel.py ${fileExtname}"


settings.json

{
    "multiCommand.commands": [
        {
            "command": "multiCommand.padSel",
            "interval": 250,                                    // higher for slow machines
            "sequence": [
                "editor.action.clipboardCopyAction",
                {
                    "command": "command-runner.run",
                    "args": {
                        "command": "padSel"
                    }
                },
                "workbench.action.focusActiveEditorGroup",
                "editor.action.clipboardPasteAction"
            ]
        }
    ],

    "command-runner.terminal.name": "runCommand",
    "command-runner.terminal.autoClear": true,
    "command-runner.terminal.autoFocus": false,                 // if true, interval in multiCommand may be higher
    "command-runner.commands": {
        "padSel": "..\\python.exe ..\\padSel.py ${fileExtname}" // adapt your paths to python.exe and padSel.py
    }
}

keybindings.json

optional

[
    {
        "key": "ctrl+alt+p",
        "command": "multiCommand.padSel",
        "when": "editorTextFocus"
    }
]

prerequisites

https://marketplace.visualstudio.com/items?itemName=ryuta46.multi-command
https://marketplace.visualstudio.com/items?itemName=edonet.vscode-command-runner
https://www.python.org/


V0.5 220711


contact

[email protected]

padsel's People

Contributors

qrti avatar

Watchers

 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.