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 16K
  • Win 10K
  • OS X 3K
  • Linux 3K
Feb 25 Feb 24 Feb 23 Feb 22 Feb 21 Feb 20 Feb 19 Feb 18 Feb 17 Feb 16 Feb 15 Feb 14 Feb 13 Feb 12 Feb 11 Feb 10 Feb 9 Feb 8 Feb 7 Feb 6 Feb 5 Feb 4 Feb 3 Feb 2 Feb 1 Jan 31 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
Windows 25 25 35 33 29 27 32 23 17 23 22 24 28 24 18 22 32 31 31 50 29 19 23 53 33 29 31 39 35 41 56 54 43 47 21 3 4 5 4 7 6 2 7 11 5 6
OS X 0 2 4 8 2 2 4 6 3 3 4 1 5 3 3 3 3 2 8 6 8 4 4 5 7 6 3 8 4 5 8 22 7 13 1 0 0 1 1 1 1 3 0 1 2 1
Linux 4 5 5 7 10 3 6 6 4 7 7 8 7 3 4 5 6 9 10 4 15 4 1 6 6 3 5 10 9 7 9 16 13 21 2 3 1 3 2 2 1 3 3 1 0 3

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.