Home Download Buy Blog Forum Support

ST2: Where do I set variables like TM_FULLNAME?

ST2: Where do I set variables like TM_FULLNAME?

Postby darren_n on Wed Nov 23, 2011 2:40 pm

Sublime Text 2 : Mac

I cannot for the life of me figure out where to set environment variables like TM_FULLNAME for use in Snippets. Can someone point me in the right direction?

Thanks,

D
darren_n
 
Posts: 3
Joined: Tue Jul 19, 2011 1:27 pm

Re: ST2: Where do I set variables like TM_FULLNAME?

Postby crysfel on Tue Jan 17, 2012 7:20 pm

Bump :)
crysfel
 
Posts: 3
Joined: Tue Jan 17, 2012 7:06 pm

Re: ST2: Where do I set variables like TM_FULLNAME?

Postby svenax on Wed Jan 18, 2012 7:07 am

You need to create your own tmPreferences file and put the definitions there. I use Packages/User/Default.tmPreferences with this content:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>name</key>
    <string>Globals</string>
    <key>scope</key>
    <string></string>
    <key>settings</key>
    <dict>
        <key>shellVariables</key>
        <array>
            <dict>
                <key>name</key>
                <string>TM_FULLNAME</string>
                <key>value</key>
                <string><![CDATA[My Full Name]]></string>
            </dict>
            <dict>
                <key>name</key>
                <string>TM_EMAIL</string>
                <key>value</key>
                <string><![CDATA[My Email]]></string>
            </dict>
            <dict>
                <key>name</key>
                <string>TM_ORGANIZATION_NAME</string>
                <key>value</key>
                <string><![CDATA[My Company]]></string>
            </dict>
            <dict>
                <key>name</key>
                <string>TM_YEAR</string>
                <key>value</key>
                <string><![CDATA[2012]]></string>
            </dict>
        </array>
    </dict>
    <key>uuid</key>
    <string>0ef292cd-943a-4fb0-b43d-65959c5e6b06</string>
</dict>
</plist>
svenax
 
Posts: 149
Joined: Tue Dec 20, 2011 12:47 pm

Re: ST2: Where do I set variables like TM_FULLNAME?

Postby brunobatista on Sun Jul 29, 2012 4:29 pm

Thanks!

Solved my problem!!! >:)
brunobatista
 
Posts: 16
Joined: Thu Apr 26, 2012 2:13 pm

Re: ST2: Where do I set variables like TM_FULLNAME?

Postby Xunius on Sat Jul 05, 2014 3:25 pm

Using the method you suggested, how to get the current time and format it into something like "2014-07-10 12:12"?

Thanks
Xunius
 
Posts: 1
Joined: Sat Jul 05, 2014 3:23 pm


Return to Technical Support

Who is online

Users browsing this forum: No registered users and 15 guests