Skip to content

Instantly share code, notes, and snippets.

@Xtremefaith
Last active December 20, 2015 23:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Xtremefaith/6215797 to your computer and use it in GitHub Desktop.
Save Xtremefaith/6215797 to your computer and use it in GitHub Desktop.
Sublime Text Snippets

Inline PHP

<snippet>
    <content><![CDATA[
<?php ${1:${TM_SELECTED_TEXT}} ?>
]]></content>
	<tabTrigger>?</tabTrigger>
	<description>Inline PHP</description>
</snippet>

Include Selection (using keybinding)

[
    { 
    	"keys": ["?", "tab"], 
    	"command": "insert_snippet", 
    	"args": {"contents": "<?php ${0:${TM_SELECTED_TEXT}} ?>"}, 
    	"context":
      [
          { "key": "selector", "operator": "equal", "operand": "text.html" }
       ]
    },
    { "keys": ["ctrl+m"], "command": "mote" }
]

Doctype

<snippet>
    <content><![CDATA[
<!DOCTYPE HTML>
<html lang="en-us">
	<head>
		<meta charset="utf-8">
		<title>$0</title>
		<link rel="stylesheet" type="text/css" href="css/style.css">
		<link rel="shortcut icon" href="favicon.ico">
	</head>
	<body>
		<header></header>
		<footer></footer>
	</body>
</html>
]]></content>
	<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
	<tabTrigger>doctype</tabTrigger>
	<!-- Optional: Set a scope to limit where the snippet will trigger -->
	<!-- <scope>source.python</scope> -->
</snippet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment