Coder Social home page Coder Social logo

sublime_selector's Introduction

Selector - Sublime Text 2 plugin providing extra text selection options.

Features

  • Google: search the selected text on Google (opens in default browser)

  • Stack Overflow: search the selected text on SO (opens in default browser)

  • URL Encode: URL Encode the selected text (also known as percent encoding)

  • URL Decode: URL Decode the selected string

  • Slugify: slugify the selected text

  • Wrap: wrap selected text in whatever tags with a couple of clicks, you can add tags yourself in the settings (decribed below)

  • Alphanumeric: Strip non alphanumeric characters from the selected text

  • Title: Convert selected text to title case

  • Class: Convert selected text to a class name (strip non alphanumerics and convert to camelcase)

Installation

Install 'Selector' via package control or download this repo and save it to your Packages directory.

Adding your own wrapper tags

Create a file in your Packages directory named Context.sublime-menu the content of the file should be in the structure below:

[
    {
        "id": "Wrapper",
        "children":
        [
            {
                "caption": "%%",
                "command": "selector",
                "args": {
                    "command": "wrap",
                    "open_tag": "%",
                    "close_tag": "%"
                }
            }
        ]
    }
]

Above is the example for the percent wrap function. The caption option is what you would like this to display as in the right-click menu, open_tag and close_tag are what they sound like. Everything else should remain the same.

To add multiple it would look like this:

[
    {
        "id": "Wrapper",
        "children":
        [
            {
                "caption": "%%",
                "command": "selector",
                "args": {
                    "command": "wrap",
                    "open_tag": "%",
                    "close_tag": "%"
                }
            },
            {
                "caption": "Foo tags",
                "command": "selector",
                "args": {
                    "command": "wrap",
                    "open_tag": "<foo>",
                    "close_tag": "</foo>"
                }
            }
        ]
    }
]

and so on.

Contribution

Any contribution is welcome. If you are adding commands, make sure they are covered by tests.

Make sure to write your code as if it is going to be read by humans. Pretty much every programmer I have met so far has been human, so it is a pretty good rule of thumb.

sublime_selector's People

Contributors

manterfield avatar

Stargazers

 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.