Sublime Forum

TM_FULLNAME does not work in Snippets on OS X

#1

Hello I’ve used the following Snippet content on OS X but the substitution of $TM_FULLNAME is always empty.

=================================
USER NAME: $TM_FULLNAME
FILE NAME: $TM_FILENAME
TAB SIZE: $TM_TAB_SIZE
SOFT TABS: $TM_SOFT_TABS

Kind regards

0 Likes

#2

Can you show the entire snippet using the code formatting in the editor like this:

<snippet> <content><![CDATA[<![CDATA[${1:$SELECTION}]]${-1}>]]></content> <tabTrigger>cdata</tabTrigger> <!-- <scope>source.html, source.xml, text.html</scope> --> </snippet>

That way it will be possible to see exactly what is going on.

0 Likes

#3

This is correct: $TM_FULLNAME does not work. The (unofficial) docs are wrong about that.

0 Likes

#4

hi @jasonaller here is my complete demo snippet.

<snippet>
    <content><![CDATA[
=================================
USER NAME:          $TM_FULLNAME
FILE NAME:          $TM_FILENAME
 TAB SIZE:          $TM_TAB_SIZE
SOFT TABS:          $TM_SOFT_TABS
=================================

]]></content>
    <!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
    <tabTrigger>user</tabTrigger>
    <!-- Optional: Set a scope to limit where the snippet will trigger -->
    <!-- <scope>source.python</scope> -->
</snippet>


0 Likes

#5

hello @FichteFoll ,

thx for your answer did you know if there is a working variable which reflects the current os user instead?

kind regards

Reinhard Luediger

0 Likes

#6

I don’t know of any, no. You’d be able to get it with some Python code in a plugin though.

0 Likes