All Projects → gerardroche → Sublime Php Snippets

gerardroche / Sublime Php Snippets

Licence: bsd-3-clause
PHP snippets for Sublime Text.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Sublime Php Snippets

Devskim Sublime Plugin
DEPRECATED -- DevSkim plugin for Sublime Text 3.
Stars: ✭ 16 (-68%)
Mutual labels:  sublime-text
Zenscript Highlighter
Sublime Text highlighting for ZenScript used in MineTweaker, CraftTweaker and ModTweaker
Stars: ✭ 15 (-70%)
Mutual labels:  sublime-text
Sublime Ava
Snippets for AVA
Stars: ✭ 41 (-18%)
Mutual labels:  sublime-text
Sublime Text
Personal Sublime Text setup
Stars: ✭ 19 (-62%)
Mutual labels:  sublime-text
Dugong
Minimal State Store Manager for React Apps using RxJS
Stars: ✭ 10 (-80%)
Mutual labels:  sublime-text
Vscode Material Theme
Port of the sublime text Material theme for Visual Studio Code in light and dark.
Stars: ✭ 21 (-58%)
Mutual labels:  sublime-text
Sublime Phpcs
🔍 PHP CodeSniffer, PHP Coding Standard Fixer, Linter and Mess Detector Support for Sublime Text
Stars: ✭ 805 (+1510%)
Mutual labels:  sublime-text
Codeatlassublime
Code relationship graph visualization plugin of sublime editor
Stars: ✭ 44 (-12%)
Mutual labels:  sublime-text
Sublime Bookmarks
Sublime Text essential plugins and resources
Stars: ✭ 878 (+1656%)
Mutual labels:  sublime-text
Sublime Text Imfix
Fix Sublime Text 3 Input method problem (CJK words) under Ubuntu
Stars: ✭ 969 (+1838%)
Mutual labels:  sublime-text
Sublimeallautocomplete
Extend Sublime autocompletion to find matches in all open files of the current window
Stars: ✭ 906 (+1712%)
Mutual labels:  sublime-text
Squib
A Ruby DSL for prototyping card games.
Stars: ✭ 850 (+1600%)
Mutual labels:  sublime-text
Vhdl Mode
A package for Sublime Text that aids coding in the VHDL language.
Stars: ✭ 31 (-38%)
Mutual labels:  sublime-text
Sublimetext
Caddyfile syntax highlighting for Sublime Text 3
Stars: ✭ 17 (-66%)
Mutual labels:  sublime-text
Sublimall Server
Server behind Sublimall SublimeText plugin
Stars: ✭ 43 (-14%)
Mutual labels:  sublime-text
Rmate
Remote TextMate 2 implemented as shell script
Stars: ✭ 807 (+1514%)
Mutual labels:  sublime-text
Easysettings
Sublime Settings made easy through auto-completion!
Stars: ✭ 20 (-60%)
Mutual labels:  sublime-text
Sublime Text 2 User Settings
💾 2011–2013 — My user settings for Sublime Text 2
Stars: ✭ 45 (-10%)
Mutual labels:  sublime-text
Lsp
Client implementation of the Language Server Protocol for Sublime Text
Stars: ✭ 1,018 (+1936%)
Mutual labels:  sublime-text
Terminus
Bring a real terminal to Sublime Text
Stars: ✭ 967 (+1834%)
Mutual labels:  sublime-text

WHAT PHP SNIPPETS IS

PHP snippets for Sublime Text.

Minimum Sublime Version Latest Version GitHub stars Downloads

  • PSR compliant
  • Scoped to minimise auto-complete noise

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 PHPSnippets in the Sublime Text Packages directory for your platform:

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

USAGE

OS X Windows Linux Description
Command+Space Ctrl+Space Alt+/ Activate completions

Enable tab-completions.

Menu > Preferences > Settings

{
    "tab_completion": true
}
Trigger Description
<? PHP: Script start tag
<?= PHP: Script short echo tag
/** PHP: Start Docblock
?= PHP: Script short echo tag
_C PHP: COOKIE['...']
_E PHP: ENV['...']
_F PHP: FILES['...']
_G PHP: GET['...']
_P PHP: POST['...']
_R PHP: REQUEST['...']
_S PHP: SERVER['...']
_SS PHP: SESSION['...']
am PHP: array map a closure
array PHP: Initialise a variable with an array
c PHP: class declaration
case PHP: case statement
class PHP: class declaration
closure PHP: Closure declaration
con PHP: class constructor definition
def PHP: define(..., ...)
def? PHP: defined(...)
do PHP: do-while statement
doc_c PHP: Documented class
doc_d PHP: Documented constant definition
doc_f PHP: Documented function
doc_i PHP: Documented interface
doc_s PHP: Documented function signature
doc_v PHP: Documented class variable
dst PHP: declare strict_types statement
echo PHP: echo '...'
echo PHTML: <?php echo ... ?>
echoh PHTML: echo htmlentities(...)
else PHP: else statement
else PHTML: else statement
elseif PHP: elseif statement
elseif PHTML: elseif statement
endfor PHTML: endfor statement
endforeach PHTML: endforeach statement
endif PHTML: endif statement
endswitch PHTML: endswitch statement
endwhile PHTML: endwhile statement
ethis PHP: echo $this->
ethis PHTML: <?php echo $this->... ?>
ev PHP: echo '...'
f PHP: function definition
flatten PHP: Flatten an array
for PHP: for statement
foreach PHP: foreach {value} statement
foreach PHTML: foreach {value} statement
foreachk PHP: foreach {key} {value} statement
foreachk PHTML: foreach {key} {value} statement
fpri PHP: final private class method declaration
fpris PHP: final private static class method declaration
fpro PHP: final protected class method declaration
fpub PHP: final public class method declaration
fpubs PHP: final public static class method declaration
fun PHP: function definition
getter PHP: getter
globals PHP: $GLOBALS['...']
gm PHP: getter
i PHP: interface definition
if PHP: if statement
if PHTML: if statement
if? PHP: $... = ( ... ) ? ... : ...
ifelse PHP: if-else statement
ifelse PHTML: if-else statement
inc PHP: include expression
inc1 PHP: include_once expression
is PHP: $... = ( ... ) ? ... : ...
kv PHP: Array key value
m PHP: class method declaration
met PHP: function definition
n PHP: namespace definition
namespace PHP: namespace definition
p PHP: class property declaration
php PHTML: <?php ... ?>
pr PHP: Print human readable information about a variable
pre PHP: Print human readable information about a variable and exit
pri PHP: private class method declaration
pro PHP: protected class method declaration
pub PHP: public class method declaration
pubs PHP: public static class method declaration
r PHP: return statement
req PHP: require expression
req1 PHP: require_once expression
reqd PHP: require dirname expression
ret PHP: return
ret0 PHP: return false statement
ret1 PHP: return true statement
retf PHP: return false statement
rett PHP: return true statement
rt PHP: return $this statement
rv PHP: return variable statement
self PHP: self::
setter PHP: setter
sm PHP: setter
switch PHP: switch statement
t PHP: $this->
this PHP: $this->
this PHTML: <?php $this->... ?>
throw PHP: throw exception statement
trait PHP: trait definition
try PHP: Wrap in try { ... } catch (...) { ... }
use PHP: namespace use declaration
vd PHP: Dump information about a variable
vde PHP: Dump information about a variable and exit
while PHP: while statement

CONFIGURATION

Create a file named php-snippets-phtml-settings.tmPreferences in your User packages directory (Menu > Preferences > Browse Packages...) with the following (modified to meet your needs):

<?xml version="1.0" encoding="UTF-8"?>
<plist version="1.0">
<dict>
    <key>name</key>
    <string>php-snippets phtml settings</string>
    <key>scope</key>
    <string>text.html.basic</string>
    <key>settings</key>
    <dict>
        <key>shellVariables</key>
        <array>


            <!--
                If you prefer HTML echo statement snippets to use long-form echo
                statements: <?php echo | ?>. Comment out the following section:
            -->

            <dict>
                <key>name</key>
                <string>TM_PHP_OPEN_TAG_WITH_ECHO</string>
                <key>value</key>
                <string>=</string>
            </dict>


            <!--
                If you prefer opening braces to be formatted on the same line,
                uncomment the following section:
            -->

            <!--
            <dict>
                <key>name</key>
                <string>TM_PHP_SNIPPET_OPENING_BRACE</string>
                <key>value</key>
                <string> {</string>
            </dict>
            -->

        </array>
    </dict>
</dict>
</plist>

LICENSE

Released under the BSD 3-Clause License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].