ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Type​Short

by jfcherng ST3

Replace placeholders into corresponding replacements in real-time while typing.

Details

Installs

  • Total 486
  • Win 290
  • OS X 103
  • Linux 93
Oct 17 Oct 16 Oct 15 Oct 14 Oct 13 Oct 12 Oct 11 Oct 10 Oct 9 Oct 8 Oct 7 Oct 6 Oct 5 Oct 4 Oct 3 Oct 2 Oct 1 Sep 30 Sep 29 Sep 28 Sep 27 Sep 26 Sep 25 Sep 24 Sep 23 Sep 22 Sep 21 Sep 20 Sep 19 Sep 18 Sep 17 Sep 16 Sep 15 Sep 14 Sep 13 Sep 12 Sep 11 Sep 10 Sep 9 Sep 8 Sep 7 Sep 6 Sep 5 Sep 4 Sep 3 Sep 2
Windows 0 0 0 0 1 0 2 1 1 1 0 0 1 0 0 2 0 1 2 2 1 2 0 0 0 2 0 0 0 0 0 0 0 0 2 1 1 0 1 0 0 0 0 0 1 1
OS X 0 0 0 0 2 1 0 1 1 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Linux 0 0 0 0 0 0 0 0 1 0 1 0 0 0 1 0 0 0 0 0 2 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 1 1 0 0 0 0

Readme

Source
raw.​githubusercontent.​com

TypeShort

TypeShort is a snippet-like plugin for Sublime Text 3. The original idea comes from VvPhpDollar by ZhaonanLi. It will replace placeholders into corresponding replacements in real-time while typing.

Usage

For example, typing a $ or a -> in PHP may be just not that comfortable. You can set fj_ (_ represents a space here for better visibility) as a placeholder for $ in PHP. This plugin will automatically replace fj_ with $ in PHP whenever you type it. Although fj_ has three characters, it could be typed faster than a $ due to the keyboard layout.

Installation

Install using Package Control (Recommended), or by cloning this repository into the Packages directory. Note that this plugin need you to set your own (placeholder, replacement) pairs to work properly.

Settings

This plugin do not have any default binding since it is very personal. To add a binding, edit settings from the menu Preferences » Package Settings » TypeShort » Settings - User.

Example settings

{
    // This file is an example settings.
    // You should write your own settings in "Preferences » Package Settings » TypeShort » Settings - User"

    // the symbol used to represent the new cursor position after a replacement
    "cursor_placeholder": "{|}",

    // You can alternatively use either syntax file name, syntax name or scopes in the "syntax_list".
    // - syntax file name: The syntax file name without extension.
    // - syntax name: It's package-dependent and as shown on the bottom-right corner of your ST windows.
    // - scope: ctrl+alt+shift+p shows it which is in the form of "source.xxx/text.xxx".
    "bindings": [
        {
            // convert 'cmt ' into '' and place the cursor at its mid
            "keymaps": {
                "cmt ": ""
            },
            // only works in HTML
            "syntax_list": ["text.html", "text.html.basic"]
        },
        {
            // convert 'fj ' into '$'
            // convert 'dk ' into '->'
            "keymaps": {
                "fj ": "$",
                "dk ": "->"
            },
            // only works in PHP
            "syntax_list": ["source.php"]
        },
        {
            // convert 'fj ' into '*'
            // convert 'dk ' into '->'
            "keymaps": {
                "fj ": "*",
                "dk ": "->"
            },
            // only works in C/C++
            "syntax_list": ["source.c", "source.c++", "source.c++11"]
        }
    ]
}

License

The MIT License (MIT)

Copyright © 2017 Jack Cherng

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Supporters

Thank you guys for sending me some cups of coffee.