Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

I want to add PHP support for emmet (sublime). How to make PHP profile? for emmet #307

Closed
picwellwisher12pk opened this Issue Apr 1, 2013 · 30 comments

Comments

Projects
None yet
2 participants

How can I add php profile. I am using Sublime Text 2. Then I can add a full length of snippts ready for it.

Owner

sergeche commented Apr 1, 2013

I don't get it. Why do you need profile for PHP?

i want to add support for php

Owner

sergeche commented Apr 1, 2013

If you want to add PHP snippets, than you should use native ST snippets.

Profiles in Emmet defines how to HTML code, they don't define syntaxes.

http://docs.emmet.io/customization/syntax-profiles/ =>
"But sometimes you’d like to force Emmet to use another profile for specified syntax or use your own profile with specific rules.

In this case, you should create syntaxProfiles.json file in extensions folder and specify profile for a required syntax. "

This is what it says on the site. But i m still not sure what is the complete and proper method.

Owner

sergeche commented Apr 1, 2013

Please read closer the full article, especially the beginning.

"But sometimes you’d like to force Emmet to use another profile for specified syntax or use your own profile with specific rules." means you can define how HTML, XML or XSL should look.

:(

**

*[image: http://www.amirhameed.com/logo.png]

Regards*
*Amir Hameed

Emails:
*me@amirhameed.com
picwellwisher12pk@gmail.com

Skype: picwellwisher12pk

URLs:
www.amirhameed.com

Author at _(Envato) _vector.tutsplus.com
Author at _(Envato) _webdesign.tutsplus.com
Author at (Envato) activeden.net* http://vector.tutsplus.com/
*Author at (Envato) _codecanyon.net
*_Author* at (Envato) themeforest.net

Mobile:
+92 322 422 8530

On Tue, Apr 2, 2013 at 2:19 AM, Sergey Chikuyonok
notifications@github.comwrote:

Please read closer the full article, especially the beginning.

"But sometimes you’d like to force Emmet to use another profile for
specified syntax or use your own profile with specific rules." means you
can define how HTML, XML or XSL should look.


Reply to this email directly or view it on GitHubhttps://github.com/sergeche/emmet-sublime/issues/307#issuecomment-15737973
.

:( It means my work is confined to Zen Coding only.

Owner

sergeche commented Apr 1, 2013

And again, I don't understand what you are trying to do. If you want to create PHP snippets, you have to add them to ST directly, you don't need Emmet or its profiles.

Actually I want those snippets to be available for people. Not for my own use only. I have already written many snippets for PHP and Wordpress for Zen Coding. And I am using it for sometime.

I have seen this link , but this will not work for php , right?

Any way thanks for your time bro.

Owner

sergeche commented Apr 8, 2013

Just pushed update with improved syntax detection, it should handle PHP too.

Note that in PHP abbreviations must be expanded with Ctrl-E shortcut, the Tab expander requires additional config and will likely break native ST snippets.

Oh my God, It's you. So nice of you. Thank you very much. Ill make a good
use of it. Actually i had prepared prepared 100s of snippets for PHP and
wordpress already for Zen Coding. I hope most of them will work with Emmet
just fine.
And hey Nice to see you. I m honored.

**

*[image: http://www.amirhameed.com/logo.png]

Regards*
*Amir Hameed

Emails:
*me@amirhameed.com
picwellwisher12pk@gmail.com

Skype: picwellwisher12pk

URLs:
www.amirhameed.com

Author at _(Envato) _vector.tutsplus.com
Author at _(Envato) _webdesign.tutsplus.com
Author at (Envato) activeden.net* http://vector.tutsplus.com/
*Author at (Envato) _codecanyon.net
*_Author* at (Envato) themeforest.net

Mobile:
+92 322 422 8530

On Mon, Apr 8, 2013 at 3:08 PM, Sergey Chikuyonok
notifications@github.comwrote:

Just pushed update with improved syntax detection, it should handle PHP
too.

Note that in PHP abbreviations must be expanded with Ctrl-E shortcut, the
Tab expander requires additional config and will likely break native ST
snippets.


Reply to this email directly or view it on GitHubhttps://github.com/sergeche/emmet-sublime/issues/307#issuecomment-16042308
.

and one more thing please. i don't know what changes you have made. And I
dont know what i need to do to add those php snippets. I m trying to find
changelog file. Dont know where it is?

**

*[image: http://www.amirhameed.com/logo.png]

Regards*
*Amir Hameed

Emails:
*me@amirhameed.com
picwellwisher12pk@gmail.com

Skype: picwellwisher12pk

URLs:
www.amirhameed.com

Author at _(Envato) _vector.tutsplus.com
Author at _(Envato) _webdesign.tutsplus.com
Author at (Envato) activeden.net* http://vector.tutsplus.com/
*Author at (Envato) _codecanyon.net
*_Author* at (Envato) themeforest.net

Mobile:
+92 322 422 8530

On Mon, Apr 8, 2013 at 3:12 PM, amir hameed picwellwisher12pk@gmail.comwrote:

Oh my God, It's you. So nice of you. Thank you very much. Ill make a good
use of it. Actually i had prepared prepared 100s of snippets for PHP and
wordpress already for Zen Coding. I hope most of them will work with Emmet
just fine.
And hey Nice to see you. I m honored.

**

*[image: http://www.amirhameed.com/logo.png]

Regards*
*Amir Hameed

Emails:
*me@amirhameed.com
picwellwisher12pk@gmail.com

Skype: picwellwisher12pk

URLs:
www.amirhameed.com

Author at _(Envato) _vector.tutsplus.com
Author at _(Envato) _webdesign.tutsplus.com
Author at (Envato) activeden.net* http://vector.tutsplus.com/
*Author at (Envato) _codecanyon.net
*_Author* at (Envato) themeforest.net

Mobile:
+92 322 422 8530

On Mon, Apr 8, 2013 at 3:08 PM, Sergey Chikuyonok <
notifications@github.com> wrote:

Just pushed update with improved syntax detection, it should handle PHP
too.

Note that in PHP abbreviations must be expanded with Ctrl-E shortcut,
the Tab expander requires additional config and will likely break native ST
snippets.


Reply to this email directly or view it on GitHubhttps://github.com/sergeche/emmet-sublime/issues/307#issuecomment-16042308
.

Owner

sergeche commented Apr 8, 2013

You need to create snippets-php.json file (or use any other name, just make sure it starts with snippets: http://docs.emmet.io/customization/snippets/#sharing-snippets) with the following content:

{
    "php": {
        "snippets": {
            // your snippets here
        }
    }
}

Then put in into extensions folder and restart editor.

:(. didn't work.

Owner

sergeche commented Apr 8, 2013

Can you tell me what you did?

  1. made a folder name "php" in "Sublime Text 2\Packages\Emmet"

  2. created a file name "snippets-php.json" in that above php folder.

  3. Content of snippet file is :
    {
    "php": {
    "filters": "php",
    "snippets": {

        "php:Ns":       "<?php\nnamespace |;\n\t\n?>",
        "php:ns":       "namespace |;",
    
        "php:Class":    "<?php\nclass |\n{\n\t\n}\n?>",
        "php:class":    "class |\n{\n\t\n}",
                     ...
                     ...
    }
    

    }
    }

  4. In Editor : Emmet Menu> Settings - User > the added :

{
"extensions_path": "~/php"

}

Owner

sergeche commented Apr 8, 2013

  1. Your extensions_path value resolves to php folder in your home folder, e.g. /Users/%YOUR_NAME%/php. The ~ character refers to user’s HOME folder.
  2. You don’t need "filters": "php" since there’s no such filter.
  1. I removed "filters" line.
  2. Even added the full absolute url : "c:/users/[My username]/AppData/Roaming/Sublime Text 2/Packages/Emmet/php".
    .Still Not working.

Tell me I am not bothering. I don't want to actually.

Owner

sergeche commented Apr 8, 2013

When Emmet starts, it shows Loading Emmet extensions from XXX folder message in console. Make sure it’s the right folder.

this is what i m looking for . some log. that may tell me what is going on.

Last day it was not working. I even checked the extension path in the log of Sublime Text. Path was ok. But the plugin didn't work. Then I tried to restart it the application. But Sublime didn't started. It was there in tasklist but didn't appear on the screen.

Now Today, everything is just fine.

Emmet is working happily with PHP. I just need to change the snippets little bit according to Emmet and escape $ sign and some other characters i guess.

Thank you soooo much Sergeche.

Owner

sergeche commented Apr 9, 2013

Great!

@sergeche sergeche closed this Apr 9, 2013

Owner

sergeche commented May 30, 2013

I think you should check your computer for viruses, it’s the second message with the same content.

what messages are you getting from me

**

*[image: http://www.amirhameed.com/logo.png]

Regards*
*Amir Hameed

Emails:
*me@amirhameed.com
picwellwisher12pk@gmail.com

Skype: picwellwisher12pk

URLs:
www.amirhameed.com

Author at _(Envato) _vector.tutsplus.com
Author at _(Envato) _webdesign.tutsplus.com
Author at (Envato) activeden.net* http://vector.tutsplus.com/
*Author at (Envato) _codecanyon.net
*_Author* at (Envato) themeforest.net

Mobile:
+92 322 422 8530

On Thu, May 30, 2013 at 6:44 PM, Sergey Chikuyonok <notifications@github.com

wrote:

I think you should check your computer for viruses, it’s the second
message with the same content.


Reply to this email directly or view it on GitHubhttps://github.com/sergeche/emmet-sublime/issues/307#issuecomment-18680832
.

that's embarrassing.

<http://www.skillpages.com/i/ftuf/emailinvitelanding?user=af9d120c-62b8-e011-a70c
-fae7741862df&signedParameters=d2UzLI2QLY-a6qEbpCKq6Z_zItK9Bja2D-2R23VU2EU.eyJlbW
FpbCI6InJlcGx5K2ktMTI2NzIzMjctODQxN2JjMzQ4YzcwNTk4YjljZDYxMmI2MzM3ZGRiMjIwZWMyMDU
5MS0xNTA4NjQ2QHJlcGx5LmdpdGh1Yi5jb20iLCJmcm9tIjoiYWY5ZDEyMGMtNjJiOC1lMDExLWE3MGMt
ZmFlNzc0MTg2MmRmIiwidG8iOiI5ZDlhMTE0YS00NmE1LTVkMzMtYWM4OC01YzBlYzRhN2M5NzIiLCJpc
3N1ZWRfYXQiOiIxMzcwNDgyMjc0IiwidmVyIjoiMSIsInAiOiIzIn0&emailMessageId=9e3563aa-3c
ce-e211-884e-85d1397596ad&emailType=InviteSecondReminder&sdate=201306060131&utm_s
ource=EmailInviteSecondReminder&utm_medium=Email&sendercc=PK&emailLinkType=Logo>

Hi,

Amir Hameed is still waiting to connect with you.

<http://www.skillpages.com/i/ftuf/emailinvitelanding?user=af9d120c-62b8-e011-a70c
-fae7741862df&signedParameters=d2UzLI2QLY-a6qEbpCKq6Z_zItK9Bja2D-2R23VU2EU.eyJlbW
FpbCI6InJlcGx5K2ktMTI2NzIzMjctODQxN2JjMzQ4YzcwNTk4YjljZDYxMmI2MzM3ZGRiMjIwZWMyMDU
5MS0xNTA4NjQ2QHJlcGx5LmdpdGh1Yi5jb20iLCJmcm9tIjoiYWY5ZDEyMGMtNjJiOC1lMDExLWE3MGMt
ZmFlNzc0MTg2MmRmIiwidG8iOiI5ZDlhMTE0YS00NmE1LTVkMzMtYWM4OC01YzBlYzRhN2M5NzIiLCJpc
3N1ZWRfYXQiOiIxMzcwNDgyMjc0IiwidmVyIjoiMSIsInAiOiIzIn0&emailMessageId=9e3563aa-3c
ce-e211-884e-85d1397596ad&emailType=InviteSecondReminder&sdate=201306060131&utm_s
ource=EmailInviteSecondReminder&utm_medium=Email&sendercc=PK&emailLinkType=Profil
eThumb>

Amir Hameed
<http://www.skillpages.com/i/ftuf/emailinvitelanding?user=af9d120c-62b8-e011-a70c
-fae7741862df&signedParameters=d2UzLI2QLY-a6qEbpCKq6Z_zItK9Bja2D-2R23VU2EU.eyJlbW
FpbCI6InJlcGx5K2ktMTI2NzIzMjctODQxN2JjMzQ4YzcwNTk4YjljZDYxMmI2MzM3ZGRiMjIwZWMyMDU
5MS0xNTA4NjQ2QHJlcGx5LmdpdGh1Yi5jb20iLCJmcm9tIjoiYWY5ZDEyMGMtNjJiOC1lMDExLWE3MGMt
ZmFlNzc0MTg2MmRmIiwidG8iOiI5ZDlhMTE0YS00NmE1LTVkMzMtYWM4OC01YzBlYzRhN2M5NzIiLCJpc
3N1ZWRfYXQiOiIxMzcwNDgyMjc0IiwidmVyIjoiMSIsInAiOiIzIn0&emailMessageId=9e3563aa-3c
ce-e211-884e-85d1397596ad&emailType=InviteSecondReminder&sdate=201306060131&utm_s
ource=EmailInviteSecondReminder&utm_medium=Email&sendercc=PK&emailLinkType=Profil
eName>

Invite sent: 23 May, 2013

Continue
<http://www.skillpages.com/i/ftuf/emailinvitelanding?user=af9d120c-62b8-e011-a70c
-fae7741862df&signedParameters=d2UzLI2QLY-a6qEbpCKq6Z_zItK9Bja2D-2R23VU2EU.eyJlbW
FpbCI6InJlcGx5K2ktMTI2NzIzMjctODQxN2JjMzQ4YzcwNTk4YjljZDYxMmI2MzM3ZGRiMjIwZWMyMDU
5MS0xNTA4NjQ2QHJlcGx5LmdpdGh1Yi5jb20iLCJmcm9tIjoiYWY5ZDEyMGMtNjJiOC1lMDExLWE3MGMt
ZmFlNzc0MTg2MmRmIiwidG8iOiI5ZDlhMTE0YS00NmE1LTVkMzMtYWM4OC01YzBlYzRhN2M5NzIiLCJpc
3N1ZWRfYXQiOiIxMzcwNDgyMjc0IiwidmVyIjoiMSIsInAiOiIzIn0&cnId=af9d120c-62b8-e011-a7
0c-fae7741862df&emailMessageId=9e3563aa-3cce-e211-884e-85d1397596ad&emailType=Inv
iteSecondReminder&sdate=201306060131&utm_source=EmailInviteSecondReminder&utm_med
ium=Email&sendercc=PK&emailLinkType=MainCallToAction>

reply+i-12672327-8417bc348c70598b9cd612b6337ddb220ec20591-1508646@reply.github.co
m was invited to join SkillPages by Amir Hameed. To stop receiving emails from
SkillPages click here
<http://www.skillpages.com/i/account/unsubscribe?signedParameters=NKubuk0Y8Ax99pf
sd-VwfOv8WRbZ9JSFr_SugexyuhQ.eyJlbWFpbCI6InJlcGx5K2ktMTI2NzIzMjctODQxN2JjMzQ4Yzcw
NTk4YjljZDYxMmI2MzM3ZGRiMjIwZWMyMDU5MS0xNTA4NjQ2QHJlcGx5LmdpdGh1Yi5jb20iLCJpc3N1Z
WRfYXQiOiIxMzcwNDgyMjc0IiwidmVyIjoiMSIsInAiOiIwIn0&emailMessageId=9e3563aa-3cce-e
211-884e-85d1397596ad&emailType=InviteSecondReminder&sdate=201306060131&utm_sourc
e=EmailInviteSecondReminder&utm_medium=Email&sendercc=PK&emailLinkType=Unsubscrib
e> .

© 2013 SkillPages, Blackrock Business Park, Dublin, Ireland and 228 Hamilton
Avenue, 3rd Floor, Palo Alto, CA 94301.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment