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

Auto​PHPDollar

by graarh ST2

Type the variable name without "$", and this plugin add it.

Details

  • 2015.06.08.19.21.06
  • github.​com
  • github.​com
  • 10 years ago
  • 2 hours ago
  • 13 years ago

Installs

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

Readme

Source
raw.​githubusercontent.​com

Synopsis

This is a Sublime Text 2 plugin.

Add “$” symbol before PHP variable name

AutoPHPDollar automatically insters “$” character before variables. Type the variable name without “$”, and this plugin add it.

Installation

Go to your Packages subdirectory under ST2's data directory:

  • Windows: %APPDATA%\Sublime Text 2
  • OS X: ~/Library/Application Support/Sublime Text 2/Packages
  • Linux: ~/.config/sublime-text-2
  • Portable Installation: Sublime Text 2/Data

Then clone this repository:

git clone git://github.com/graarh/sublime-AutoPHPDollar.git

That's it!

Options

Several options are available to customize the plugin behavior.

Add rules for detecting variables

You can add custom rules, that improves variables detection. The rule contains regular expression to find a variable without dollar character, and the replacement of found text.

"rules": [
    {
        "search":  "(?<![\\$\\w\\d\\>])(\\w[\\w\\d]*)(?=\\s*=)",
        "replace": "$\\1"
    }
]

Add keywords or buildin function names to ignore names list

You can add words, that should be ignored by plugin. It can be buildin function name, like array_walk, or PHP keyword. In PHP, you can use variable name like $private, but you dont want to add the $ sign to each “private” you typed. So, add this name to this list. “ js "ignore names”: [ “private”, “public”, “protected” ]

### Add keywords, that never followed by variable

You can add words, that never has variable name after it. For example, this is the function keyword.
You can not use constructions like function $myfuncname($args) in PHP, so you do not want to add $ sign to the function name. Or constant name.

``` js
"ignore after": [
    "class",
    "function",
    "const"
]

Roadmap and TODO:

  • improve variables detection