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 735
  • Win 453
  • OS X 138
  • Linux 144
Aug 17 Aug 16 Aug 15 Aug 14 Aug 13 Aug 12 Aug 11 Aug 10 Aug 9 Aug 8 Aug 7 Aug 6 Aug 5 Aug 4 Aug 3 Aug 2 Aug 1 Jul 31 Jul 30 Jul 29 Jul 28 Jul 27 Jul 26 Jul 25 Jul 24 Jul 23 Jul 22 Jul 21 Jul 20 Jul 19 Jul 18 Jul 17 Jul 16 Jul 15 Jul 14 Jul 13 Jul 12 Jul 11 Jul 10 Jul 9 Jul 8 Jul 7 Jul 6 Jul 5 Jul 4
Windows 0 0 0 2 0 1 0 0 0 0 2 1 1 1 2 0 1 1 0 0 0 0 0 1 1 1 0 0 0 1 0 1 1 0 1 1 0 0 0 0 1 0 0 0 1
OS X 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0
Linux 0 0 1 0 1 1 1 0 0 0 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 1 0 1 0 1 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"]
        }
    ]
}

Supporters

Thank you guys for sending me some cups of coffee.