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 26K
  • Win 18K
  • OS X 4K
  • Linux 5K
Nov 18 Nov 17 Nov 16 Nov 15 Nov 14 Nov 13 Nov 12 Nov 11 Nov 10 Nov 9 Nov 8 Nov 7 Nov 6 Nov 5 Nov 4 Nov 3 Nov 2 Nov 1 Oct 31 Oct 30 Oct 29 Oct 28 Oct 27 Oct 26 Oct 25 Oct 24 Oct 23 Oct 22 Oct 21 Oct 20 Oct 19 Oct 18 Oct 17 Oct 16 Oct 15 Oct 14 Oct 13 Oct 12 Oct 11 Oct 10 Oct 9 Oct 8 Oct 7 Oct 6 Oct 5 Oct 4
Windows 7 23 39 29 34 35 29 25 37 32 38 34 28 39 18 32 32 42 34 40 30 20 25 43 35 36 34 34 16 25 38 22 38 48 36 23 28 31 41 30 32 40 28 36 27 41
OS X 2 1 1 4 4 2 2 2 4 2 2 5 4 6 2 3 4 3 5 4 1 5 2 7 5 3 3 2 1 0 5 4 3 3 1 1 4 2 2 5 6 8 2 0 4 6
Linux 2 6 8 7 6 2 5 6 6 5 7 8 11 6 3 4 6 12 3 5 5 4 7 7 5 4 7 8 3 5 6 5 10 2 5 5 5 2 4 8 7 6 3 7 4 4

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.