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 907
  • Win 571
  • OS X 166
  • Linux 170
Apr 20 Apr 19 Apr 18 Apr 17 Apr 16 Apr 15 Apr 14 Apr 13 Apr 12 Apr 11 Apr 10 Apr 9 Apr 8 Apr 7 Apr 6 Apr 5 Apr 4 Apr 3 Apr 2 Apr 1 Mar 31 Mar 30 Mar 29 Mar 28 Mar 27 Mar 26 Mar 25 Mar 24 Mar 23 Mar 22 Mar 21 Mar 20 Mar 19 Mar 18 Mar 17 Mar 16 Mar 15 Mar 14 Mar 13 Mar 12 Mar 11 Mar 10 Mar 9 Mar 8 Mar 7
Windows 0 0 2 0 0 0 0 0 1 0 1 0 0 1 0 0 0 1 0 0 0 0 1 1 1 0 0 1 2 0 1 0 2 1 0 0 0 0 0 2 1 0 0 0 1
OS X 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 1 0 0 0 1 1 0 0 0 0 0 0 0
Linux 0 0 0 1 1 0 0 0 0 0 0 2 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0

Readme

Source
raw.​githubusercontent.​com

Sublime-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.

Why This Plugin?

Do you ever consider $, ->, *, &, etc to be uncomfortable to type? Typing them usually requires you to move your fingers farther.

screenshot

Take the screenshot above as an example, you can set fj🔥 (🔥 represents a space here just for visibility) as a placeholder for $ in PHP. This plugin will automatically replace fj🔥 with $ in PHP whenever you type it. Although fj🔥 is 3-char, it could be typed faster than a $ due to the normal keyboard layout. You could also set dk🔥 as a placeholder for -> as well for the same reason.

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 does not have any default binding since it is very personal. To add a binding, edit settings from the menu Preferences » Package Settings » TypeShort » Settings.

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"]
        }
    ]
}

Supporters

Thank you guys for sending me some cups of coffee.