2016-05-08 9 views
0

Googleでポップアップした同様の投稿を読んで、いずれも問題を解決していないので、もう一度質問しています。Linux用のSublime Text 2でカスタムスニペットを作成して使用する方法は?

私はこれは私が(動作しない)を思い付いたスニペットコードであるコード

#include <bits/stdc++.h> 

using namespace std; 

typedef long long ll; 
typedef long l; 
typedef unsigned long long ull; 
typedef pair<int,int> pii; 
typedef pair<int,pair<int,int> > tii; 
typedef vector<pair<int,int> > vec_pii; 
#define fastinput ios_base::sync_with_stdio(false); cin.tie(false); 
#define mp make_pair 
#define setbits(n) __builtin_popcount((n)) 
#define pb push_back 
#define mod 1000000007 
#define gcd(a,b) __gcd(a,b) 
#define sf(n) scanf("%lld",&(n)) 
#define pf(n) printf("%lld\n",(n)) 
#define min3(a,b,c) (min((c),min((a),(b)))) 
#define max3(a,b,c) (max((a),max((b),(c)))) 

の次の行を使用して新しいファイルを初期化するC++ファイルのスニペットを作成したいです。間違いを修正して、それが機能するかどうか確認してください。

<snippet> 
    <content><![CDATA[ 
#include <bits/stdc++.h> 

using namespace std; 

typedef long long ll; 
typedef long l; 
typedef unsigned long long ull; 
typedef pair<int,int> pii; 
typedef pair<int,pair<int,int> > tii; 
typedef vector<pair<int,int> > vec_pii; 
#define fastinput ios_base::sync_with_stdio(false); cin.tie(false); 
#define mp make_pair 
#define setbits(n) __builtin_popcount((n)) 
#define pb push_back 
#define mod 1000000007 
#define gcd(a,b) __gcd(a,b) 
#define sf(n) scanf("%lld",&(n)) 
#define pf(n) printf("%lld\n",(n)) 
#define min3(a,b,c) (min((c),min((a),(b)))) 
#define max3(a,b,c) (max((a),max((b),(c)))) 
]]></content> 
    <!-- Optional: Set a tabTrigger to define how to trigger the snippet --> 
    <tabTrigger>newfile</tabTrigger> 
    <!-- Optional: Set a scope to limit where the snippet will trigger --> 
    <scope>source.cpp</scope> 
</snippet> 

答えて

1

変更
<scope>source.cpp</scope>
<scope>source.c++</scope>



にあなたの対象文書&地域の正しいスコープ名を見つけるために、SublimeTextのshow_scope_nameコマンドまたはScopeHunterのようなプラグインを使用することができます。

+1

ありがとうございました! これは私が理解するまでに年齢を取っていました –

関連する問題