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

PHPGrammar

by gerardroche ST3

An smart macro PHP plugin for Sublime Text.

Details

Installs

  • Total 20K
  • Win 13K
  • OS X 3K
  • Linux 4K
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 Apr 26 Apr 25 Apr 24 Apr 23 Apr 22 Apr 21 Apr 20 Apr 19 Apr 18 Apr 17 Apr 16 Apr 15 Apr 14 Apr 13 Apr 12 Apr 11
Windows 20 23 30 32 27 38 24 22 31 32 37 33 36 20 22 30 39 39 32 30 23 17 36 43 32 27 38 9 26 24 31 50 34 43 30 26 30 43 37 30 33 22 18 33 30 50
OS X 2 4 6 1 5 3 1 0 3 4 5 5 6 1 2 6 4 4 2 8 0 2 5 6 6 5 5 2 0 4 7 3 2 4 3 1 3 6 2 5 4 1 3 4 3 5
Linux 2 1 6 6 3 7 3 9 11 6 7 7 6 4 7 8 8 6 12 6 4 2 7 14 11 8 7 3 4 5 8 6 4 6 6 5 5 5 10 6 7 3 2 8 6 5

Readme

Source
raw.​githubusercontent.​com

WHAT PHPGRAMMAR IS

An improved PHP syntax, good indentation rules, smart macros, and more.

Build Status Build status Coverage Status Minimum Sublime Version Latest Stable Version GitHub stars Downloads Author

Completions and snippets are provided separately by PHP Completions Kit and PHP Snippets.

PHPGrammar has been renamed in v.2.0.0 (previously known as php-grammar)

INSTALLATION

Package Control installation

The preferred method of installation is Package Control.

Manual installation

Close Sublime Text, then download or clone this repository to a directory named PHPGrammar in the Sublime Text Packages directory for your platform:

  • Linux: git clone https://github.com/gerardroche/sublime-php-grammar.git ~/.config/sublime-text-3/Packages/PHPGrammar
  • OSX: git clone https://github.com/gerardroche/sublime-php-grammar.git ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/PHPGrammar
  • Windows: git clone https://github.com/gerardroche/sublime-php-grammar.git %APPDATA%\Sublime/ Text/ 3/Packages/PHPGrammar

USAGE

Smart macros

To insert any literal character add Shift e.g. in a case where Enter runs a macro, to insert a newline on Enter (instead of running the macro) press Shift+Enter.

On Ctrl+Enter

<?php

array(                      //    array(
    'str|'                  //        'str',
)                           //        |
                            //    )
<?php

'str|ing'                   //    'string';
                            //    |
<?php

function_call(|)            //    function_call();
                            //    |
<?php

if ($condition|)            //    if ($condition) {
                            //        |
                            //    }
<?php

foreach ($x => $y|)         //    foreach ($x => $y) {
                            //        |
                            //    }
<?php

while ($condition|)         //    while ($condition) {
                            //        |
                            //    }
<?php

for ($i = 0; $i < ; $i++|)  //    for ($i = 0; $i < ; $i++) {
                            //        |
                            //    }
<?php

switch ($condition|)        //    switch ($condition|) {
                            //        |
                            //    }
<?php

function x(|)               //    function x()
                            //    {
                            //        |
                            //    }
<?php

class x                     //    class x
{                           //    {
    public function y(|)    //        public function y()
}                           //        {
                            //            |
                            //        }
                            //    }

On Ctrl+;

'str|ing'                   //    'string';|
<?php

function_call(|)            //    function_call();|

On Enter

array(|)                    //    array(
                            //        |
                            //    )
<?php

function_call(|)            //    function_call(
                            //        |
                            //    )
<?php

new class_name(|)           //    new class_name(
                            //        |
                            //    )

On Tab

$arr = array(               //    $arr = array(
    'str|'                  //        'str' => |
)                           //    )
<?php

$arr = array(               //    $arr = array(
    'str'|                  //        'str' => |
)                           //    )

On [

$arr = |                    //    $arr = [|];

On ]

$arr = [|                   //    $arr = [|];

CONTRIBUTING

See CONTRIBUTING.md.

LICENSE

Released under the BSD 3-Clause License.