Skip to content

Instantly share code, notes, and snippets.

@nathanieltubb
Last active December 11, 2018 04:41
Show Gist options
  • Save nathanieltubb/83116fd9f20e83d48ec1c48ed0810a5c to your computer and use it in GitHub Desktop.
Save nathanieltubb/83116fd9f20e83d48ec1c48ed0810a5c to your computer and use it in GitHub Desktop.
Sublime Text 3 Snippets

README

* DO NOT INCLUDE THIS FILE *

HINT

On Mac OSX, your Sublime Text snippets are likely stored here. It might be handy to create a Sublime Project from that directory to enable easier editing of your snippets.

~/Library/Application Support/Sublime Text 3/Packages/User

cd ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/User/

<snippet>
<content><![CDATA[
//---------------------------------------------------------------
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>//--</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<!-- <scope>source.python</scope> -->
</snippet>
<snippet>
<content><![CDATA[
<%= ${1} %>
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>rot</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>text.html.ruby</scope>
</snippet>
<snippet>
<content><![CDATA[
<% ${1} %>
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>rt</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>text.html.ruby</scope>
</snippet>
<snippet>
<content><![CDATA[
<?php ${1: } ?>
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>php</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<!-- <scope>source.python</scope> -->
</snippet>
<snippet>
<content><![CDATA[
@include react(${1:START}, ${2:END}){
${3}
}
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>react</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.sass</scope>
</snippet>
<snippet>
<content><![CDATA[
@include respond(${1:SIZES...}){
${3}
}
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>respond</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.sass</scope>
</snippet>
<snippet>
<content><![CDATA[
echo('<pre style="text-align:left;">');
var_dump(${1:VAR});
//print_f(${1:VAR});
echo('</pre>');
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>vdnice</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.php</scope>
</snippet>
<snippet>
<content><![CDATA[
wp search-replace '${1:OLD}' '${2:NEW}' --skip-columns=guid
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>wpsr</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<!-- <scope>source.python</scope> -->
</snippet>
<snippet>
<content><![CDATA[
wp user create nathaniel_tubb_mri [email protected] --role=administrator
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>wpadduser</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<!-- <scope>source.python</scope> -->
</snippet>
<snippet>
<content>
<![CDATA[
wp config create --dbname=${1:DBNAME} --dbuser=${2:DBUSER} --dbpass="${3:DBPASS}" --dbhost=${4:localhost} --dbprefix=${5:DBPREFIX}
]]>
</content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>wpconf</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<!-- <scope>source.python</scope> -->
</snippet>
<snippet>
<content><![CDATA[
wp db export ~/Desktop/ph-dev-`date +%F`.sql
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>wpdbexport</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<!-- <scope>source.python</scope> -->
</snippet>
<snippet>
<content><![CDATA[
wp core install --url="${1:BLOGURL}" --title="${2:BLOGTITLE}" --admin_user="${3:BLOGUSER}" --admin_email="${4:BLOGUSEREMAIL}" --skip-email
wp user update 1 --first_name="${5:BLOGUSERFIRSTNAME}" --last_name="${6:BLOGUSERLASTNAME}" --nickname="${7:BLOGUSERNICKNAME}" --display_name="${7:BLOGUSERNICKNAME}"
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>wpinstall</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<!-- <scope>source.python</scope> -->
</snippet>
<snippet>
<content><![CDATA[
<?php if(have_posts()) : ?>
<?php while(have_posts()) : the_post(); ?>
${1}
<?php endwhile; ?>
<?php endif; ?>
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>wploop</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>embedding.php text.html.basic</scope>
</snippet>
<snippet>
<content><![CDATA[
INSERT INTO `databasename`.`${1:PREFIX}_users` (`ID`, `user_login`, `user_pass`, `user_nicename`, `user_email`, `user_url`, `user_registered`, `user_activation_key`, `user_status`, `display_name`) VALUES ('${2:USER_ID}', '${3:USERNAME}', MD5('${4:PASSWORD}'), '${5:NICENAME}', '${6:EMAIL}', '', '2000-01-01 00:00:00', '', '0', '${5:NICENAME}');
INSERT INTO `databasename`.`${1:PREFIX}_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`) VALUES (NULL, '${2:USER_ID}', '${1:PREFIX}_capabilities', 'a:1:{s:13:"administrator";s:1:"1";}');
INSERT INTO `databasename`.`${1:PREFIX}_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`) VALUES (NULL, '${2:USER_ID}', '${1:PREFIX}_user_level', '10');
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>wpuser</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