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

  • 2.0.0
    1.5.2
  • github.​com
  • github.​com
  • 3 years ago
  • 3 hours ago
  • 10 years ago

Installs

  • Total 2K
  • Win 1K
  • Mac 313
  • Linux 261
Jun 10 Jun 9 Jun 8 Jun 7 Jun 6 Jun 5 Jun 4 Jun 3 Jun 2 Jun 1 May 31 May 30 May 29 May 28 May 27 May 26 May 25 May 24 May 23 May 22 May 21 May 20 May 19 May 18 May 17 May 16 May 15 May 14 May 13 May 12 May 11 May 10 May 9 May 8 May 7 May 6 May 5 May 4 May 3 May 2 May 1 Apr 30 Apr 29 Apr 28 Apr 27
Windows 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0
Mac 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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 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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
01234Jun 10Jun 7Jun 4Jun 1May 29May 26May 23May 20May 17May 14May 11May 8May 5May 2Apr 29Jun 10 Linux: 0 Mac: 0 Windows: 0Jun 9 Linux: 1 Mac: 0 Windows: 0Jun 8 Linux: 0 Mac: 0 Windows: 0Jun 7 Linux: 0 Mac: 0 Windows: 0Jun 6 Linux: 0 Mac: 0 Windows: 0Jun 5 Linux: 0 Mac: 0 Windows: 0Jun 4 Linux: 0 Mac: 0 Windows: 0Jun 3 Linux: 0 Mac: 0 Windows: 0Jun 2 Linux: 0 Mac: 0 Windows: 0Jun 1 Linux: 0 Mac: 0 Windows: 0May 31 Linux: 0 Mac: 0 Windows: 0May 30 Linux: 0 Mac: 0 Windows: 0May 29 Linux: 0 Mac: 0 Windows: 0May 28 Linux: 0 Mac: 0 Windows: 0May 27 Linux: 0 Mac: 0 Windows: 0May 26 Linux: 0 Mac: 0 Windows: 0May 25 Linux: 0 Mac: 0 Windows: 0May 24 Linux: 0 Mac: 0 Windows: 1May 23 Linux: 0 Mac: 0 Windows: 0May 22 Linux: 0 Mac: 0 Windows: 0May 21 Linux: 0 Mac: 0 Windows: 0May 20 Linux: 0 Mac: 0 Windows: 0May 19 Linux: 0 Mac: 0 Windows: 0May 18 Linux: 0 Mac: 0 Windows: 0May 17 Linux: 0 Mac: 0 Windows: 0May 16 Linux: 0 Mac: 0 Windows: 0May 15 Linux: 0 Mac: 0 Windows: 0May 14 Linux: 0 Mac: 0 Windows: 0May 13 Linux: 0 Mac: 0 Windows: 1May 12 Linux: 0 Mac: 0 Windows: 0May 11 Linux: 0 Mac: 0 Windows: 0May 10 Linux: 0 Mac: 0 Windows: 0May 9 Linux: 0 Mac: 0 Windows: 0May 8 Linux: 0 Mac: 0 Windows: 0May 7 Linux: 0 Mac: 0 Windows: 0May 6 Linux: 0 Mac: 0 Windows: 0May 5 Linux: 0 Mac: 0 Windows: 0May 4 Linux: 0 Mac: 0 Windows: 1May 3 Linux: 0 Mac: 0 Windows: 0May 2 Linux: 0 Mac: 0 Windows: 0May 1 Linux: 0 Mac: 0 Windows: 0Apr 30 Linux: 0 Mac: 0 Windows: 1Apr 29 Linux: 0 Mac: 0 Windows: 0Apr 28 Linux: 0 Mac: 0 Windows: 0Apr 27 Linux: 0 Mac: 0 Windows: 0Jun 10 Linux: 0 Mac: 0 Windows: 0Jun 9 Linux: 1 Mac: 0 Windows: 0Jun 8 Linux: 0 Mac: 0 Windows: 0Jun 7 Linux: 0 Mac: 0 Windows: 0Jun 6 Linux: 0 Mac: 0 Windows: 0Jun 5 Linux: 0 Mac: 0 Windows: 0Jun 4 Linux: 0 Mac: 0 Windows: 0Jun 3 Linux: 0 Mac: 0 Windows: 0Jun 2 Linux: 0 Mac: 0 Windows: 0Jun 1 Linux: 0 Mac: 0 Windows: 0May 31 Linux: 0 Mac: 0 Windows: 0May 30 Linux: 0 Mac: 0 Windows: 0May 29 Linux: 0 Mac: 0 Windows: 0May 28 Linux: 0 Mac: 0 Windows: 0May 27 Linux: 0 Mac: 0 Windows: 0May 26 Linux: 0 Mac: 0 Windows: 0May 25 Linux: 0 Mac: 0 Windows: 0May 24 Linux: 0 Mac: 0 Windows: 1May 23 Linux: 0 Mac: 0 Windows: 0May 22 Linux: 0 Mac: 0 Windows: 0May 21 Linux: 0 Mac: 0 Windows: 0May 20 Linux: 0 Mac: 0 Windows: 0May 19 Linux: 0 Mac: 0 Windows: 0May 18 Linux: 0 Mac: 0 Windows: 0May 17 Linux: 0 Mac: 0 Windows: 0May 16 Linux: 0 Mac: 0 Windows: 0May 15 Linux: 0 Mac: 0 Windows: 0May 14 Linux: 0 Mac: 0 Windows: 0May 13 Linux: 0 Mac: 0 Windows: 1May 12 Linux: 0 Mac: 0 Windows: 0May 11 Linux: 0 Mac: 0 Windows: 0May 10 Linux: 0 Mac: 0 Windows: 0May 9 Linux: 0 Mac: 0 Windows: 0May 8 Linux: 0 Mac: 0 Windows: 0May 7 Linux: 0 Mac: 0 Windows: 0May 6 Linux: 0 Mac: 0 Windows: 0May 5 Linux: 0 Mac: 0 Windows: 0May 4 Linux: 0 Mac: 0 Windows: 1May 3 Linux: 0 Mac: 0 Windows: 0May 2 Linux: 0 Mac: 0 Windows: 0May 1 Linux: 0 Mac: 0 Windows: 0Apr 30 Linux: 0 Mac: 0 Windows: 1Apr 29 Linux: 0 Mac: 0 Windows: 0Apr 28 Linux: 0 Mac: 0 Windows: 0Apr 27 Linux: 0 Mac: 0 Windows: 0Jun 10 Linux: 0 Mac: 0 Windows: 0Jun 9 Linux: 1 Mac: 0 Windows: 0Jun 8 Linux: 0 Mac: 0 Windows: 0Jun 7 Linux: 0 Mac: 0 Windows: 0Jun 6 Linux: 0 Mac: 0 Windows: 0Jun 5 Linux: 0 Mac: 0 Windows: 0Jun 4 Linux: 0 Mac: 0 Windows: 0Jun 3 Linux: 0 Mac: 0 Windows: 0Jun 2 Linux: 0 Mac: 0 Windows: 0Jun 1 Linux: 0 Mac: 0 Windows: 0May 31 Linux: 0 Mac: 0 Windows: 0May 30 Linux: 0 Mac: 0 Windows: 0May 29 Linux: 0 Mac: 0 Windows: 0May 28 Linux: 0 Mac: 0 Windows: 0May 27 Linux: 0 Mac: 0 Windows: 0May 26 Linux: 0 Mac: 0 Windows: 0May 25 Linux: 0 Mac: 0 Windows: 0May 24 Linux: 0 Mac: 0 Windows: 1May 23 Linux: 0 Mac: 0 Windows: 0May 22 Linux: 0 Mac: 0 Windows: 0May 21 Linux: 0 Mac: 0 Windows: 0May 20 Linux: 0 Mac: 0 Windows: 0May 19 Linux: 0 Mac: 0 Windows: 0May 18 Linux: 0 Mac: 0 Windows: 0May 17 Linux: 0 Mac: 0 Windows: 0May 16 Linux: 0 Mac: 0 Windows: 0May 15 Linux: 0 Mac: 0 Windows: 0May 14 Linux: 0 Mac: 0 Windows: 0May 13 Linux: 0 Mac: 0 Windows: 1May 12 Linux: 0 Mac: 0 Windows: 0May 11 Linux: 0 Mac: 0 Windows: 0May 10 Linux: 0 Mac: 0 Windows: 0May 9 Linux: 0 Mac: 0 Windows: 0May 8 Linux: 0 Mac: 0 Windows: 0May 7 Linux: 0 Mac: 0 Windows: 0May 6 Linux: 0 Mac: 0 Windows: 0May 5 Linux: 0 Mac: 0 Windows: 0May 4 Linux: 0 Mac: 0 Windows: 1May 3 Linux: 0 Mac: 0 Windows: 0May 2 Linux: 0 Mac: 0 Windows: 0May 1 Linux: 0 Mac: 0 Windows: 0Apr 30 Linux: 0 Mac: 0 Windows: 1Apr 29 Linux: 0 Mac: 0 Windows: 0Apr 28 Linux: 0 Mac: 0 Windows: 0Apr 27 Linux: 0 Mac: 0 Windows: 0

Readme

Source
raw.​githubusercontent.​com

ST-TypeShort

Required ST Build GitHub Actions Package Control GitHub tag (latest by date) Project license GitHub stars Donate to this project using Paypal

TypeShort is a snippet-like plugin for Sublime Text. It replaces placeholders into corresponding replacements in real-time while typing.

Why This Plugin

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

screenshot Oh, OOP PHP uses $this-> so often… How long it takes you to type it?

Take the screenshot above as an example, you can set fj█ ( represents 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 can be typed faster than a single $ and you do not have to move any of your finger due to QWERTY keyboard layout.

The ST Built-in Way

You can kind of having the same results with the following keybinding. So actually nowadays you may not need this plugin any more.

[
  // HTML
  {
      "keys": ["c", "m", "t", " "],
      "command": "insert_snippet",
      "args": { "contents": "" },
      "context": [{
          "key": "selector",
          "operand": "text.html.basic - source.php",
      }],
  },
  // PHP
  {
      "keys": ["f", "j", " "],
      "command": "insert",
      "args": { "characters": "$" },
      "context": [{
          "key": "selector",
          "operand": "source.php",
      }],
  },
  {
      "keys": ["d", "k", " "],
      "command": "insert",
      "args": { "characters": "->" },
      "context": [{
          "key": "selector",
          "operand": "source.php",
      }],
  },
]

Installation

This package is available on Package Control by the name of TypeShort. Note that you have to set your own (placeholder, replacement) pairs to make this plugin work properly.

Settings

This plugin does not have any default binding since obviously they are 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"

    // 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".
    // But scopes are recommended and the use of syntax (file) name may be removed in the future.
    //
    // - 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 usually starts with "source.xxx" or "text.xxx".
    //          You can use any ST selectors here. See https://www.sublimetext.com/docs/3/selectors.html
    "bindings": [
        {
            // only works in HTML
            "syntax_list": ["text.html.basic"],
            // convert 'cmt ' into '' and place the cursor at its mid
            "keymaps": {
                "cmt ": "",
            },
        },
        {
            // 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.objc", "source.objc++",
                "source.c++11", // C++11 package
            ],
            // convert 'fj ' into '*'
            // convert 'dk ' into '->',
            "keymaps": {
                "fj ": "*",
                "dk ": "->",
            },
        },
    ],
}