diff options
author | Andrea Crotti <andrea.crotti.0@gmail.com> | 2011-07-07 14:32:44 +0200 |
---|---|---|
committer | Andrea Crotti <andrea.crotti.0@gmail.com> | 2011-07-07 14:32:44 +0200 |
commit | a9bd2ed46234f52e638a8b6ede9e08837828fcab (patch) | |
tree | ffec00d0782378c9bf6004426e6c1ac8f466a21f | |
parent | 70da9c5c032c44881d4610960cb8db8979155eb4 (diff) |
remove .yasnippet extension
242 files changed, 1878 insertions, 14 deletions
diff --git a/antlr-mode/project b/antlr-mode/project new file mode 100644 index 0000000..0506cb2 --- /dev/null +++ b/antlr-mode/project @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# name: project +# key: proj +# contributor: Andrea crotti +# -- +<project name="${1:test}" default="${2:compile}" basedir="${3:.}"> + +$0 +</project>
\ No newline at end of file diff --git a/antlr-mode/property b/antlr-mode/property new file mode 100644 index 0000000..c724d46 --- /dev/null +++ b/antlr-mode/property @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: property +# key: prop +# contributor: Andrea crotti +# -- +<property name="${1:name}" value="${2:value}" /> +$0
\ No newline at end of file diff --git a/antlr-mode/target b/antlr-mode/target new file mode 100644 index 0000000..e728638 --- /dev/null +++ b/antlr-mode/target @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: target +# key: target +# contributor: Andrea crotti +# -- +<target name="${1:compile}" ${2:other}> + $0 +</target>
\ No newline at end of file diff --git a/applescript-mode/bang b/applescript-mode/bang new file mode 100644 index 0000000..7d97bbf --- /dev/null +++ b/applescript-mode/bang @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: bang +# key: ! +# contributor: Andrea crotti +# -- +#!/usr/bin/osascript
\ No newline at end of file diff --git a/c++-mode/<sstream> b/c++-mode/<sstream> new file mode 100644 index 0000000..fc229da --- /dev/null +++ b/c++-mode/<sstream> @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: <sstream> +# key: ss +# contributor: Andrea crotti +# -- +#include <sstream>
\ No newline at end of file diff --git a/c++-mode/cerr b/c++-mode/cerr new file mode 100644 index 0000000..d07a35a --- /dev/null +++ b/c++-mode/cerr @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: cerr +# key: err +# contributor: Andrea crotti +# -- +cerr << $0; diff --git a/c++-mode/cin b/c++-mode/cin new file mode 100644 index 0000000..4a8d143 --- /dev/null +++ b/c++-mode/cin @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: cin +# key: cin +# contributor: Andrea crotti +# -- +cin >> $0;
\ No newline at end of file diff --git a/c++-mode/cout b/c++-mode/cout new file mode 100644 index 0000000..e8991d9 --- /dev/null +++ b/c++-mode/cout @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: cout +# key: cout +# contributor: Andrea crotti +# -- +std::cout << ${1:string} $0<< std::endl;
\ No newline at end of file diff --git a/c++-mode/cstd b/c++-mode/cstd new file mode 100644 index 0000000..9811e19 --- /dev/null +++ b/c++-mode/cstd @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: cstd +# key: cstd +# contributor: Andrea crotti +# -- +#include <cstdlib>
\ No newline at end of file diff --git a/c++-mode/delete b/c++-mode/delete new file mode 100644 index 0000000..2aefd6b --- /dev/null +++ b/c++-mode/delete @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: delete +# key: dl +# contributor: Andrea crotti +# -- +delete ${1:pointer};
\ No newline at end of file diff --git a/c++-mode/delete[] b/c++-mode/delete[] new file mode 100644 index 0000000..4259a1d --- /dev/null +++ b/c++-mode/delete[] @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: delete[] +# key: dla +# contributor: Andrea crotti +# -- +delete[] ${1:arr};
\ No newline at end of file diff --git a/c++-mode/dynamic_casting b/c++-mode/dynamic_casting new file mode 100644 index 0000000..9ac73c0 --- /dev/null +++ b/c++-mode/dynamic_casting @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: dynamic_casting +# key: cast +# contributor: Andrea crotti +# -- +check_and_cast<${1:Type} *>(${2:msg});
\ No newline at end of file diff --git a/c++-mode/enum b/c++-mode/enum new file mode 100644 index 0000000..f324f1b --- /dev/null +++ b/c++-mode/enum @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: enum +# key: enum +# contributor: Andrea crotti +# -- +enum ${1:NAME}{ +$0 +};
\ No newline at end of file diff --git a/c++-mode/fori b/c++-mode/fori new file mode 100644 index 0000000..d99db87 --- /dev/null +++ b/c++-mode/fori @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: fori +# key: fori +# contributor: Andrea crotti +# -- +for (${1:iter}=${2:var}.begin(); $1!=$2.end(); ++$1) { + $0 +}
\ No newline at end of file diff --git a/c++-mode/ignore b/c++-mode/ignore new file mode 100644 index 0000000..70aa4d5 --- /dev/null +++ b/c++-mode/ignore @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: ignore +# key: ignore +# contributor: Andrea crotti +# -- +${1:std::}cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
\ No newline at end of file diff --git a/c++-mode/inline b/c++-mode/inline new file mode 100644 index 0000000..6519878 --- /dev/null +++ b/c++-mode/inline @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: inline +# key: il +# contributor: Andrea crotti +# -- +inline $0
\ No newline at end of file diff --git a/c++-mode/io b/c++-mode/io new file mode 100644 index 0000000..e306156 --- /dev/null +++ b/c++-mode/io @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: io +# key: io +# contributor: Andrea crotti +# -- +#include <iostream>
\ No newline at end of file diff --git a/c++-mode/iterator b/c++-mode/iterator new file mode 100644 index 0000000..f95ef39 --- /dev/null +++ b/c++-mode/iterator @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: iterator +# key: iter +# contributor: Andrea crotti +# -- +${1:std::}${2:vector<int>}::iterator ${3:iter}; diff --git a/c++-mode/map b/c++-mode/map new file mode 100644 index 0000000..2b4db29 --- /dev/null +++ b/c++-mode/map @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: map +# key: map +# contributor: Andrea crotti +# -- +std::map<${1:type1}$0> ${2:var};
\ No newline at end of file diff --git a/c++-mode/module b/c++-mode/module new file mode 100644 index 0000000..0d158c6 --- /dev/null +++ b/c++-mode/module @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# name: module +# key: mod +# contributor: Andrea crotti +# -- +class ${1:Class} : public cSimpleModule +{ + $0 +}
\ No newline at end of file diff --git a/c++-mode/operator!= b/c++-mode/operator!= new file mode 100644 index 0000000..06143fb --- /dev/null +++ b/c++-mode/operator!= @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: operator!= +# key: != +# contributor: Andrea crotti +# -- +bool ${1:MyClass}::operator!=(const $1 &other) const { + return !(*this == other); +}
\ No newline at end of file diff --git a/c++-mode/operator+ b/c++-mode/operator+ new file mode 100644 index 0000000..1469dc2 --- /dev/null +++ b/c++-mode/operator+ @@ -0,0 +1,11 @@ +# -*- mode: snippet -*- +# name: operator+ +# key: + +# contributor: Andrea crotti +# -- +${1:MyClass} $1::operator+(const $1 &other) +{ + $1 result = *this; + result += other; + return result; +}
\ No newline at end of file diff --git a/c++-mode/operator+= b/c++-mode/operator+= new file mode 100644 index 0000000..f8dcd55 --- /dev/null +++ b/c++-mode/operator+= @@ -0,0 +1,10 @@ +# -*- mode: snippet -*- +# name: operator+= +# key: += +# contributor: Andrea crotti +# -- +${1:MyClass}& $1::operator+=(${2:const $1 &rhs}) +{ + $0 + return *this; +}
\ No newline at end of file diff --git a/c++-mode/operator<< b/c++-mode/operator<< new file mode 100644 index 0000000..e3cb99d --- /dev/null +++ b/c++-mode/operator<< @@ -0,0 +1,10 @@ +# -*- mode: snippet -*- +# name: operator<< +# key: << +# contributor: Andrea crotti +# -- +std::ostream& operator<<(std::ostream& s, const ${1:type}& ${2:c}) +{ + $0 + return s; +}
\ No newline at end of file diff --git a/c++-mode/operator= b/c++-mode/operator= new file mode 100644 index 0000000..68fb065 --- /dev/null +++ b/c++-mode/operator= @@ -0,0 +1,13 @@ +# -*- mode: snippet -*- +# name: operator= +# key: = +# where this is a reference to myself +# contributor: Andrea crotti +# -- +${1:MyClass}& $1::operator=(const $1 &rhs) { + // Check for self-assignment! + if (this == &rhs) + return *this; + $0 + return *this; +}
\ No newline at end of file diff --git a/c++-mode/operator== b/c++-mode/operator== new file mode 100644 index 0000000..29ae7d6 --- /dev/null +++ b/c++-mode/operator== @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: operator== +# key: == +# contributor: Andrea crotti +# -- +bool ${1:MyClass}::operator==(const $1 &other) const { + $0 +}
\ No newline at end of file diff --git a/c++-mode/operator>> b/c++-mode/operator>> new file mode 100644 index 0000000..98af2cf --- /dev/null +++ b/c++-mode/operator>> @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# name: operator>> +# key: >> +# contributor: Andrea crotti +# -- +istream& operator>>(istream& s, const ${1:type}& ${2:c}) +{ + $0 +} diff --git a/c++-mode/pack b/c++-mode/pack new file mode 100644 index 0000000..675ec1c --- /dev/null +++ b/c++-mode/pack @@ -0,0 +1,10 @@ +# -*- mode: snippet -*- +# name: pack +# key: pack +# contributor: Andrea crotti +# -- +void cNetCommBuffer::pack(${1:type}) { + +} + +$0
\ No newline at end of file diff --git a/c++-mode/private b/c++-mode/private new file mode 100644 index 0000000..d9839c5 --- /dev/null +++ b/c++-mode/private @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: private +# key: pr +# contributor: Andrea crotti +# -- +private: + $0
\ No newline at end of file diff --git a/c++-mode/protected b/c++-mode/protected new file mode 100644 index 0000000..db2cc5d --- /dev/null +++ b/c++-mode/protected @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: protected +# key: pt +# contributor: Andrea crotti +# -- +protected: + $0
\ No newline at end of file diff --git a/c++-mode/public b/c++-mode/public new file mode 100644 index 0000000..0395d42 --- /dev/null +++ b/c++-mode/public @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: public +# key: pb +# contributor: Andrea crotti +# -- +public: + $0
\ No newline at end of file diff --git a/c++-mode/std b/c++-mode/std new file mode 100644 index 0000000..dca6e3b --- /dev/null +++ b/c++-mode/std @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: std +# key: std +# contributor: Andrea crotti +# -- +using namespace std;
\ No newline at end of file diff --git a/c++-mode/std:: b/c++-mode/std:: new file mode 100644 index 0000000..defe7bf --- /dev/null +++ b/c++-mode/std:: @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: std:: +# key: st +# contributor: Andrea crotti +# -- +std::$0
\ No newline at end of file diff --git a/c++-mode/str b/c++-mode/str new file mode 100644 index 0000000..da41d99 --- /dev/null +++ b/c++-mode/str @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: str +# key: str +# contributor: Andrea crotti +# -- +#include <string>
\ No newline at end of file diff --git a/c++-mode/template b/c++-mode/template new file mode 100644 index 0000000..0d0bf72 --- /dev/null +++ b/c++-mode/template @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: template +# key: temp +# contributor: Andrea crotti +# -- +template<${1:$$(yas/choose-value '("typename" "class"))} ${2:T}> +$0
\ No newline at end of file diff --git a/c++-mode/test_main b/c++-mode/test_main new file mode 100644 index 0000000..5e941a8 --- /dev/null +++ b/c++-mode/test_main @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# name: test_main +# key: test_main +# contributor: Andrea crotti +# -- +int main(int argc, char **argv) { + ::testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +}
\ No newline at end of file diff --git a/c++-mode/this b/c++-mode/this new file mode 100644 index 0000000..dee89a1 --- /dev/null +++ b/c++-mode/this @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: this +# key: th +# contributor: Andrea crotti +# -- +this
\ No newline at end of file diff --git a/c++-mode/throw b/c++-mode/throw new file mode 100644 index 0000000..de31b5d --- /dev/null +++ b/c++-mode/throw @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: throw +# key: throw +# contributor: Andrea crotti +# -- +throw ${1:MyError}($0);
\ No newline at end of file diff --git a/c++-mode/try b/c++-mode/try new file mode 100644 index 0000000..fce09bc --- /dev/null +++ b/c++-mode/try @@ -0,0 +1,11 @@ +# -*- mode: snippet -*- +# name: try +# key: try +# contributor: Andrea crotti +# a bit too intrusive now still, not always I want to do this +# -- +try { + $0 +} catch (${1:type}) { + +} diff --git a/c++-mode/vector b/c++-mode/vector new file mode 100644 index 0000000..31930d2 --- /dev/null +++ b/c++-mode/vector @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: vector +# key: vec +# contributor: Andrea crotti +# -- +std::vector<${1:Class}> ${2:var}${3:(${4:10}, $1($5))};
\ No newline at end of file diff --git a/c-mode/assert b/c-mode/assert index 4a6d4a5..85ba342 100644 --- a/c-mode/assert +++ b/c-mode/assert @@ -1,5 +1,7 @@ # -*- mode: snippet -*- # name: assert # key: ass +# contributor: Andrea crotti # -- -#include <assert.h>
\ No newline at end of file +#include <assert.h> +$0
\ No newline at end of file diff --git a/c-mode/compile b/c-mode/compile new file mode 100644 index 0000000..3d0bbfd --- /dev/null +++ b/c-mode/compile @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: compile +# key: compile +# contributor: Andrea crotti +# -- +// -*- compile-command: "${1:gcc -Wall -o ${2:dest} ${3:file}}" -*-
\ No newline at end of file diff --git a/c-mode/malloc b/c-mode/malloc new file mode 100644 index 0000000..57fc9a6 --- /dev/null +++ b/c-mode/malloc @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: malloc +# key: malloc +# contributor: Andrea crotti +# -- +malloc(sizeof($1)${2: * ${3:3}}); +$0
\ No newline at end of file diff --git a/c-mode/packed b/c-mode/packed new file mode 100644 index 0000000..a6492e7 --- /dev/null +++ b/c-mode/packed @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: packed +# key: packed +# contributor: Andrea crotti +# -- +__attribute__((__packed__))$0
\ No newline at end of file diff --git a/c-mode/printf b/c-mode/printf new file mode 100644 index 0000000..05bb1e9 --- /dev/null +++ b/c-mode/printf @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: printf +# key: pr +# contributor: Andrea crotti +# -- +printf("${1:format string}"${2: ,a0,a1});
\ No newline at end of file diff --git a/c-mode/stdio b/c-mode/stdio new file mode 100644 index 0000000..01f57df --- /dev/null +++ b/c-mode/stdio @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: stdio +# key: io +# contributor: Andrea crotti +# -- +#include <stdio.h>
\ No newline at end of file diff --git a/c-mode/stdlib b/c-mode/stdlib new file mode 100644 index 0000000..da5df9d --- /dev/null +++ b/c-mode/stdlib @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: stdlib +# key: std +# contributor: Andrea crotti +# -- +#include <stdlib.h> diff --git a/c-mode/string b/c-mode/string new file mode 100644 index 0000000..f5603af --- /dev/null +++ b/c-mode/string @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: string +# key: str +# contributor: Andrea crotti +# -- +#include <string.h>
\ No newline at end of file diff --git a/c-mode/switch b/c-mode/switch new file mode 100644 index 0000000..62d0f5d --- /dev/null +++ b/c-mode/switch @@ -0,0 +1,12 @@ +# -*- mode: snippet -*- +# name: switch +# key: case +# contributor: Andrea crotti +# -- +switch (${1:ch}) { + case ${2:const}: + ${3:a = b}; + break; + ${4:default: + ${5:action}} +} diff --git a/c-mode/union b/c-mode/union new file mode 100644 index 0000000..a28d48c --- /dev/null +++ b/c-mode/union @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: union +# key: union +# contributor: Andrea crotti +# -- +typedef union { + $0 +} ${1:name};
\ No newline at end of file diff --git a/c-mode/unistd b/c-mode/unistd new file mode 100644 index 0000000..f5c9ec4 --- /dev/null +++ b/c-mode/unistd @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: unistd +# key: uni +# contributor: Andrea crotti +# -- +#include <unistd.h>
\ No newline at end of file diff --git a/cc-mode/for b/cc-mode/for new file mode 100644 index 0000000..0b0db6d --- /dev/null +++ b/cc-mode/for @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: for +# key: for +# contributor: Andrea crotti +# -- +for (${1:i = 0}; ${2:i < N}; ${3:i++}) { + $0 +} diff --git a/cc-mode/guard b/cc-mode/guard new file mode 100644 index 0000000..e14e8b1 --- /dev/null +++ b/cc-mode/guard @@ -0,0 +1,11 @@ +# -*- mode: snippet -*- +# name: guard +# key: guard +# contributor: Andrea crotti +# -- +#ifndef ${1:NAME}_H +#define $1_H + +$0 + +#endif // $1
\ No newline at end of file diff --git a/cc-mode/math b/cc-mode/math new file mode 100644 index 0000000..9411dd3 --- /dev/null +++ b/cc-mode/math @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: math +# key: math +# contributor: Andrea crotti +# -- +#include <math.h> +$0
\ No newline at end of file diff --git a/cc-mode/ternary b/cc-mode/ternary new file mode 100644 index 0000000..bb1f438 --- /dev/null +++ b/cc-mode/ternary @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: ternary +# key: ? +# contributor: Andrea crotti +# -- +(${1:cond}) ? ${2:then} : ${3:else};
\ No newline at end of file diff --git a/cc-mode/typedef b/cc-mode/typedef new file mode 100644 index 0000000..244b075 --- /dev/null +++ b/cc-mode/typedef @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: typedef +# key: typedef +# contributor: Andrea crotti +# -- +typedef ${1:type} ${2:alias};
\ No newline at end of file diff --git a/cc-mode/while b/cc-mode/while new file mode 100644 index 0000000..007dcf2 --- /dev/null +++ b/cc-mode/while @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: while +# key: while +# contributor: Andrea crotti +# -- +while (${1:condition}) { + $0 +}
\ No newline at end of file diff --git a/conf-unix-mode/section b/conf-unix-mode/section new file mode 100644 index 0000000..8ec349d --- /dev/null +++ b/conf-unix-mode/section @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# name: section +# key: sec +# section for xorg.conf +# contributor: Andrea crotti +# -- +Section "${1:Device}" + $0 +EndSection
\ No newline at end of file diff --git a/cpp-omnet-mode/EV b/cpp-omnet-mode/EV new file mode 100644 index 0000000..927d5bd --- /dev/null +++ b/cpp-omnet-mode/EV @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: EV +# key: ev +# contributor: Andrea crotti +# -- +EV << "${1:string}"$0;
\ No newline at end of file diff --git a/cpp-omnet-mode/emit_signal b/cpp-omnet-mode/emit_signal new file mode 100644 index 0000000..8e25ed2 --- /dev/null +++ b/cpp-omnet-mode/emit_signal @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: emit_signal +# key: emit +# contributor: Andrea crotti +# -- +emit(${1:signal_id}, ${2:long});
\ No newline at end of file diff --git a/cpp-omnet-mode/intuniform b/cpp-omnet-mode/intuniform new file mode 100644 index 0000000..b97cadb --- /dev/null +++ b/cpp-omnet-mode/intuniform @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: intuniform +# key: intuni +# contributor: Andrea crotti +# -- +intuniform(${1:0}, ${2:1})
\ No newline at end of file diff --git a/cpp-omnet-mode/math b/cpp-omnet-mode/math new file mode 100644 index 0000000..5a35b3b --- /dev/null +++ b/cpp-omnet-mode/math @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: math +# key: math +# contributor: Andrea crotti +# -- +#include <cmath>
\ No newline at end of file diff --git a/cpp-omnet-mode/nan b/cpp-omnet-mode/nan new file mode 100644 index 0000000..ef551ec --- /dev/null +++ b/cpp-omnet-mode/nan @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: nan +# key: nan +# contributor: Andrea crotti +# -- +isnan(${1:x})
\ No newline at end of file diff --git a/cpp-omnet-mode/omnet b/cpp-omnet-mode/omnet new file mode 100644 index 0000000..2c99a18 --- /dev/null +++ b/cpp-omnet-mode/omnet @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: omnet +# key: omnet +# contributor: Andrea crotti +# -- +#include <omnetpp.h>
\ No newline at end of file diff --git a/cpp-omnet-mode/parameter_omnetpp b/cpp-omnet-mode/parameter_omnetpp new file mode 100644 index 0000000..dfa4fb5 --- /dev/null +++ b/cpp-omnet-mode/parameter_omnetpp @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: parameter_omnetpp +# key: par +# contributor: Andrea crotti +# -- +${1:var} = par("${2:par}");
\ No newline at end of file diff --git a/cpp-omnet-mode/scheduleAt b/cpp-omnet-mode/scheduleAt new file mode 100644 index 0000000..e53ff14 --- /dev/null +++ b/cpp-omnet-mode/scheduleAt @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: scheduleAt +# key: sched +# contributor: Andrea crotti +# -- +scheduleAt(simTime()+${1:1.0}, ${2:event});
\ No newline at end of file diff --git a/cpp-omnet-mode/uniform b/cpp-omnet-mode/uniform new file mode 100644 index 0000000..b6ecc65 --- /dev/null +++ b/cpp-omnet-mode/uniform @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: uniform +# key: uni +# uniform distribution +# contributor: Andrea crotti +# -- +uniform(${1:0}, ${2:1})
\ No newline at end of file diff --git a/emacs-lisp-mode/defun b/emacs-lisp-mode/defun new file mode 100644 index 0000000..b72f23c --- /dev/null +++ b/emacs-lisp-mode/defun @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: defun +# key: def +# contributor: Andrea crotti +# -- +(defun ${1:fun} (${2:args}) + ${3:(interactive${4: "P"})} + $0)
\ No newline at end of file diff --git a/emacs-lisp-mode/hash b/emacs-lisp-mode/hash new file mode 100644 index 0000000..5211d41 --- /dev/null +++ b/emacs-lisp-mode/hash @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: hash +# key: hash +# contributor: Andrea crotti +# -- +make-hash-table ${1:options}
\ No newline at end of file diff --git a/emacs-lisp-mode/minor_mode b/emacs-lisp-mode/minor_mode new file mode 100644 index 0000000..5cef332 --- /dev/null +++ b/emacs-lisp-mode/minor_mode @@ -0,0 +1,22 @@ +# -*- mode: snippet -*- +# name: minor_mode +# key: minor +# contributor: Andrea Crotti +# contributor: Andrea crotti +# -- +(defvar ${1:mode}-modeline-indicator " ${2:INDICATOR}" + "call ($1-install-mode) again if this is changed") + +(defvar $1-mode nil) +(make-variable-buffer-local '$1-mode) +(put '$1-mode 'permanent-local t) + +(defun $1-mode (&optional arg) + "$0" + (interactive "P") + (setq $1-mode + (if (null arg) (not $1-mode) + (> (prefix-numeric-value arg) 0))) + (force-mode-line-update)) + +(provide '$1-mode)
\ No newline at end of file diff --git a/emacs-lisp-mode/word_regexp b/emacs-lisp-mode/word_regexp new file mode 100644 index 0000000..8926b89 --- /dev/null +++ b/emacs-lisp-mode/word_regexp @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: word_regexp +# key: < +# contributor: Andrea crotti +# -- +"\\_<${1:word}\\_>"
\ No newline at end of file diff --git a/erc-mode/blist b/erc-mode/blist new file mode 100644 index 0000000..57f6302 --- /dev/null +++ b/erc-mode/blist @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: blist +# key: b +# contributor: Andrea crotti +# -- +blist diff --git a/erc-mode/help b/erc-mode/help new file mode 100644 index 0000000..73492ce --- /dev/null +++ b/erc-mode/help @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: help +# key: h +# contributor: Andrea crotti +# -- +help $0
\ No newline at end of file diff --git a/go-mode/func b/go-mode/func new file mode 100644 index 0000000..c9a0d5f --- /dev/null +++ b/go-mode/func @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: func +# key: func +# contributor: Andrea crotti +# -- +func ${1:fun}(${2:args}) { +$0 +}
\ No newline at end of file diff --git a/go-mode/import b/go-mode/import new file mode 100644 index 0000000..c956304 --- /dev/null +++ b/go-mode/import @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: import +# key: imp +# contributor: Andrea crotti +# -- +import ${1:package} +$0
\ No newline at end of file diff --git a/go-mode/main b/go-mode/main new file mode 100644 index 0000000..1706f27 --- /dev/null +++ b/go-mode/main @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# name: main +# key: main +# contributor: Andrea crotti +# -- +func main() { + ${1:fmt.Printf("Hello, 世界\n")} + $0 +} diff --git a/go-mode/map b/go-mode/map new file mode 100644 index 0000000..e3d630e --- /dev/null +++ b/go-mode/map @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# name: map +# key: map +# contributor: Andrea crotti +# -- +map[${1:string}] ${2:int} { + ${3:"X": 100,} + $0 +}
\ No newline at end of file diff --git a/go-mode/printf b/go-mode/printf new file mode 100644 index 0000000..082308b --- /dev/null +++ b/go-mode/printf @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: printf +# key: pr +# contributor: Andrea crotti +# -- +fmt.Printf("${1:fmt}\n"${2:,str}) +$0
\ No newline at end of file diff --git a/go-mode/switch b/go-mode/switch new file mode 100644 index 0000000..bdc7112 --- /dev/null +++ b/go-mode/switch @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# name: switch +# key: switch +# contributor: Andrea crotti +# -- +switch { + case ${1:cond}: + $0 +}
\ No newline at end of file diff --git a/go-mode/var b/go-mode/var new file mode 100644 index 0000000..1c921a8 --- /dev/null +++ b/go-mode/var @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: var +# key: var +# contributor: Andrea crotti +# -- +var ${1:ok} ${2:bool} +$0
\ No newline at end of file diff --git a/groovy-mode/class b/groovy-mode/class new file mode 100644 index 0000000..b9319d5 --- /dev/null +++ b/groovy-mode/class @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: class +# key: class +# contributor: Andrea crotti +# -- +class ${1:Class} { + $0 +}
\ No newline at end of file diff --git a/groovy-mode/def b/groovy-mode/def new file mode 100644 index 0000000..f19a5f1 --- /dev/null +++ b/groovy-mode/def @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: def +# key: def +# contributor: Andrea crotti +# -- +def ${1:method}(${2:args}) { + $0 +}
\ No newline at end of file diff --git a/groovy-mode/dict b/groovy-mode/dict new file mode 100644 index 0000000..6ef7ffc --- /dev/null +++ b/groovy-mode/dict @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: dict +# key: dict +# contributor: Andrea crotti +# -- +${1:dict} = [${2:key} : ${3:value}$0]
\ No newline at end of file diff --git a/groovy-mode/for b/groovy-mode/for new file mode 100644 index 0000000..2e53b9a --- /dev/null +++ b/groovy-mode/for @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# name: for +# key: for +# contributor: Andrea crotti +# -- +for (${1:var} in ${2:iter}) { + $0 +} +
\ No newline at end of file diff --git a/groovy-mode/println b/groovy-mode/println new file mode 100644 index 0000000..3d6abd4 --- /dev/null +++ b/groovy-mode/println @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: println +# key: pr +# contributor: Andrea crotti +# -- +println ${1:"string"} +$0
\ No newline at end of file diff --git a/groovy-mode/times b/groovy-mode/times new file mode 100644 index 0000000..e3a316c --- /dev/null +++ b/groovy-mode/times @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: times +# key: times +# contributor: Andrea crotti +# -- +${1:10}.times { + $0 +} .
\ No newline at end of file diff --git a/haskell-mode/case b/haskell-mode/case new file mode 100644 index 0000000..364f470 --- /dev/null +++ b/haskell-mode/case @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# name: case +# key: case +# contributor: Andrea crotti +# -- +case ${1:var} of + ${2:cond} -> ${3:value} + $0 + otherwise -> ${4:other}
\ No newline at end of file diff --git a/haskell-mode/doc b/haskell-mode/doc new file mode 100644 index 0000000..556f788 --- /dev/null +++ b/haskell-mode/doc @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: doc +# key: doc +# contributor: Andrea crotti +# -- +{- + $0 +-}
\ No newline at end of file diff --git a/haskell-mode/function b/haskell-mode/function new file mode 100644 index 0000000..8ce6076 --- /dev/null +++ b/haskell-mode/function @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: fun +# key: fun +# contributor: Andrea Crotti +# contributor: Andrea crotti +# -- +${1:function-name} :: ${2:type} +$1 ${3:arguments} $0
\ No newline at end of file diff --git a/haskell-mode/import b/haskell-mode/import new file mode 100644 index 0000000..55a1380 --- /dev/null +++ b/haskell-mode/import @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: import +# key: import +# contributor: Andrea crotti +# -- +import${1: qualified} ${2:Module${3:(symbols)}}${4: as ${5:alias}}
\ No newline at end of file diff --git a/haskell-mode/instance b/haskell-mode/instance new file mode 100644 index 0000000..2cb4b06 --- /dev/null +++ b/haskell-mode/instance @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: instance +# key: instance +# contributor: Andrea crotti +# -- +instance ${1:${2:(Show a)} => }${3:Ord} ${4:DataType} where +$0 diff --git a/haskell-mode/main b/haskell-mode/main new file mode 100644 index 0000000..e3ec65d --- /dev/null +++ b/haskell-mode/main @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: main +# key: main +# contributor: Andrea crotti +# -- +main = do $0
\ No newline at end of file diff --git a/haskell-mode/module b/haskell-mode/module new file mode 100644 index 0000000..fc9f0f4 --- /dev/null +++ b/haskell-mode/module @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: module +# key: mod +# contributor: Andrea crotti +# -- +module ${1:Module} where +$0
\ No newline at end of file diff --git a/haskell-mode/new class b/haskell-mode/new class new file mode 100644 index 0000000..a105cc6 --- /dev/null +++ b/haskell-mode/new class @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: new class +# key: class +# contributor: Andrea crotti +# -- +class ${1:Class Name} where + $0
\ No newline at end of file diff --git a/haskell-mode/pragma b/haskell-mode/pragma new file mode 100644 index 0000000..cfcaa74 --- /dev/null +++ b/haskell-mode/pragma @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: pragma +# key: { +# contributor: Andrea crotti +# -- +{-# ${1:PRAGMA} #-}
\ No newline at end of file diff --git a/haskell-mode/print b/haskell-mode/print new file mode 100644 index 0000000..e61166b --- /dev/null +++ b/haskell-mode/print @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: print +# key: pr +# contributor: Andrea crotti +# -- +print $0
\ No newline at end of file diff --git a/java-mode/apr_assert b/java-mode/apr_assert new file mode 100644 index 0000000..8720db1 --- /dev/null +++ b/java-mode/apr_assert @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: apr_assert +# key: apr_assert +# contributor: Andrea crotti +# -- +if (Globals.useAssertions) { + ${1:assert ..}; +} diff --git a/java-mode/author b/java-mode/author new file mode 100644 index 0000000..4a9f716 --- /dev/null +++ b/java-mode/author @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: author +# key: author +# contributor: Andrea crotti +# -- +@author Andrea Crotti, Marius Grysla, Oscar Dustmann
\ No newline at end of file diff --git a/java-mode/cls b/java-mode/cls new file mode 100644 index 0000000..67f3b17 --- /dev/null +++ b/java-mode/cls @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: cls +# key: cls +# contributor: Andrea crotti +# -- +class ${1:Class} { + $0 +}
\ No newline at end of file diff --git a/java-mode/doc b/java-mode/doc new file mode 100644 index 0000000..4e1534d --- /dev/null +++ b/java-mode/doc @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: doc +# key: /* +# contributor: Andrea crotti +# -- +/** + * ${1:documentation} + */
\ No newline at end of file diff --git a/java-mode/equals b/java-mode/equals new file mode 100644 index 0000000..9024dd5 --- /dev/null +++ b/java-mode/equals @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: equals +# key: eq +# contributor: Andrea crotti +# -- +public boolean equals(${1:Class} other) { + $0 +}
\ No newline at end of file diff --git a/java-mode/file_class b/java-mode/file_class new file mode 100644 index 0000000..0d7e2d2 --- /dev/null +++ b/java-mode/file_class @@ -0,0 +1,12 @@ +# -*- mode: snippet -*- +# name: file_class +# key: file +# contributor: Andrea crotti +# -- +public class ${1:`(let ((fn (file-name-nondirectory + (file-name-sans-extension + (or (buffer-file-name) + (buffer-name (current-buffer))))))))} + + $0 +end diff --git a/java-mode/for b/java-mode/for new file mode 100644 index 0000000..47cf4c2 --- /dev/null +++ b/java-mode/for @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: for +# key: for +# contributor: Andrea crotti +# -- +for (${1:int i = 0}; ${2:i < N}; ${3:i++}) { + $0 +}
\ No newline at end of file diff --git a/java-mode/fori b/java-mode/fori new file mode 100644 index 0000000..eb4d43a --- /dev/null +++ b/java-mode/fori @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# name: fori +# key: fori +# contributor: Andrea crotti +# -- +for (${1:Object el} : ${2:iterator}) { + $0 +} +
\ No newline at end of file diff --git a/java-mode/if b/java-mode/if new file mode 100644 index 0000000..1b28d2b --- /dev/null +++ b/java-mode/if @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: if +# key: if +# contributor: Andrea crotti +# -- +if (${1:condition) { + $0 +}
\ No newline at end of file diff --git a/java-mode/ife b/java-mode/ife new file mode 100644 index 0000000..04da22d --- /dev/null +++ b/java-mode/ife @@ -0,0 +1,11 @@ +# -*- mode: snippet -*- +# name: ife +# key: ife +# contributor: Andrea crotti +# -- +if (${1:cond}) { + $2 +} +else { + $3 +}
\ No newline at end of file diff --git a/java-mode/import b/java-mode/import new file mode 100644 index 0000000..c66772f --- /dev/null +++ b/java-mode/import @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: import +# key: imp +# contributor: Andrea crotti +# -- +import ${1:System.}; +$0
\ No newline at end of file diff --git a/java-mode/iterator b/java-mode/iterator new file mode 100644 index 0000000..55f642a --- /dev/null +++ b/java-mode/iterator @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: iterator +# key: iterator +# contributor: Andrea crotti +# -- +public Iterator<${1:type}> iterator() { + $0 +} diff --git a/java-mode/javadoc b/java-mode/javadoc new file mode 100644 index 0000000..f179219 --- /dev/null +++ b/java-mode/javadoc @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# name: javadoc +# key: doc +# contributor: Andrea crotti +# -- +/** + * $0 + * + */
\ No newline at end of file diff --git a/java-mode/main b/java-mode/main new file mode 100644 index 0000000..aa20636 --- /dev/null +++ b/java-mode/main @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: main +# key: main +# contributor: Andrea crotti +# -- +public static void main(String[] args) { + $0 +}
\ No newline at end of file diff --git a/java-mode/method b/java-mode/method new file mode 100644 index 0000000..c8df4b1 --- /dev/null +++ b/java-mode/method @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: method +# key: method +# contributor: Andrea crotti +# -- +${1:public }${2:void} ${3:name} (${4:args}) { + $0 +}
\ No newline at end of file diff --git a/java-mode/new b/java-mode/new new file mode 100644 index 0000000..6506faf --- /dev/null +++ b/java-mode/new @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: new +# key: new +# contributor: Andrea crotti +# -- +${1:Type} ${2:obj} = new ${3:Constr}(${4:args}); +$0
\ No newline at end of file diff --git a/java-mode/param b/java-mode/param new file mode 100644 index 0000000..bf30787 --- /dev/null +++ b/java-mode/param @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: param +# key: param +# contributor: Andrea crotti +# -- +@param ${1:paramater} $0
\ No newline at end of file diff --git a/java-mode/printf b/java-mode/printf new file mode 100644 index 0000000..8df6fc9 --- /dev/null +++ b/java-mode/printf @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: printf +# key: printf +# contributor: Andrea crotti +# -- +System.out.printf("$0%n");
\ No newline at end of file diff --git a/java-mode/println b/java-mode/println new file mode 100644 index 0000000..3602e64 --- /dev/null +++ b/java-mode/println @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: println +# key: pr +# contributor: Andrea crotti +# -- +System.out.println("${1:text}"); +$0
\ No newline at end of file diff --git a/java-mode/return b/java-mode/return new file mode 100644 index 0000000..afc0153 --- /dev/null +++ b/java-mode/return @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: return +# key: ret +# contributor: Andrea crotti +# -- +@return ${1:description}
\ No newline at end of file diff --git a/java-mode/test b/java-mode/test new file mode 100644 index 0000000..76bb3d1 --- /dev/null +++ b/java-mode/test @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# name: test +# key: test +# contributor: Andrea crotti +# -- +@Test +public void test_${1:Case}() { + $0 +}
\ No newline at end of file diff --git a/java-mode/testClass b/java-mode/testClass new file mode 100644 index 0000000..c1fd7d2 --- /dev/null +++ b/java-mode/testClass @@ -0,0 +1,13 @@ +# -*- mode: snippet -*- +# name: testClass +# key: tc +# contributor: Andrea crotti +# -- +import junit.framework.*; +import junit.textui.*; + +public class Test${1:Class} extends TestCase { + protected void setUp() { + $0 + } +}
\ No newline at end of file diff --git a/java-mode/this b/java-mode/this new file mode 100644 index 0000000..3beac15 --- /dev/null +++ b/java-mode/this @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: this +# key: . +# contributor: Andrea crotti +# -- +this.$0
\ No newline at end of file diff --git a/java-mode/toString b/java-mode/toString new file mode 100644 index 0000000..222e617 --- /dev/null +++ b/java-mode/toString @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: toString +# key: toStr +# contributor: Andrea crotti +# -- +public String toString() { + $0 +}
\ No newline at end of file diff --git a/java-mode/try b/java-mode/try new file mode 100644 index 0000000..5b4f49b --- /dev/null +++ b/java-mode/try @@ -0,0 +1,12 @@ +# -*- mode: snippet -*- +# name: try +# key: try +# contributor: Andrea crotti +# -- +try { + $0 +} +catch (${1:Throwable e}) { + ${2:System.out.println("Error " + e.getMessage()); + e.printStackTrace();} +} diff --git a/latex-mode/item b/latex-mode/item index 4b4cafb..d4773f5 100644 --- a/latex-mode/item +++ b/latex-mode/item @@ -2,4 +2,4 @@ # name: item # key: - # -- -\item \itemt{$0}
\ No newline at end of file +\item $0
\ No newline at end of file diff --git a/lisp-interaction-mode/defun b/lisp-interaction-mode/defun new file mode 100644 index 0000000..85deda0 --- /dev/null +++ b/lisp-interaction-mode/defun @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: defun +# key: defun +# contributor: Andrea crotti +# -- +(defun ${1:fun} (${2:args}) + $0 +)
\ No newline at end of file diff --git a/lua-mode/fun b/lua-mode/fun new file mode 100644 index 0000000..7a8abfc --- /dev/null +++ b/lua-mode/fun @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: fun +# key: fun +# contributor: Andrea crotti +# -- +function () + ${1:return something} +end
\ No newline at end of file diff --git a/m4-mode/def b/m4-mode/def new file mode 100644 index 0000000..44b9668 --- /dev/null +++ b/m4-mode/def @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: def +# key: def +# contributor: Andrea crotti +# -- +define(\`${1:macro}',\`${2:subst}'). +$0
\ No newline at end of file diff --git a/makefile-automake-mode/noinst_HEADERS b/makefile-automake-mode/noinst_HEADERS new file mode 100644 index 0000000..af5a3f1 --- /dev/null +++ b/makefile-automake-mode/noinst_HEADERS @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: noinst_HEADERS +# key: noinst +# contributor: Andrea crotti +# -- +noinst_HEADERS = $0
\ No newline at end of file diff --git a/makefile-bsdmake-mode/PHONY b/makefile-bsdmake-mode/PHONY new file mode 100644 index 0000000..3ac2ed9 --- /dev/null +++ b/makefile-bsdmake-mode/PHONY @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: PHONY +# key: phony +# contributor: Andrea crotti +# -- +.PHONY: $0
\ No newline at end of file diff --git a/makefile-bsdmake-mode/echo b/makefile-bsdmake-mode/echo new file mode 100644 index 0000000..3f199f4 --- /dev/null +++ b/makefile-bsdmake-mode/echo @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: echo +# key: echo +# contributor: Andrea crotti +# -- +@echo ${1:"message to output"} diff --git a/makefile-bsdmake-mode/gen b/makefile-bsdmake-mode/gen new file mode 100644 index 0000000..816c1a2 --- /dev/null +++ b/makefile-bsdmake-mode/gen @@ -0,0 +1,12 @@ +# -*- mode: snippet -*- +# name: gen +# key: gen +# possibly add some smart control over the list +# contributor: Andrea crotti +# -- +all: ${1:targets} + +$0 + +clean: + ${2:clean actions} diff --git a/makefile-bsdmake-mode/if b/makefile-bsdmake-mode/if new file mode 100644 index 0000000..8c4c5d4 --- /dev/null +++ b/makefile-bsdmake-mode/if @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# name: if +# key: if +# contributor: Andrea crotti +# -- +@if [ ${1:cond} ] + then $0 +fi +
\ No newline at end of file diff --git a/makefile-bsdmake-mode/var b/makefile-bsdmake-mode/var new file mode 100644 index 0000000..1c1e80d --- /dev/null +++ b/makefile-bsdmake-mode/var @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: var +# key: $ +# contributor: Andrea crotti +# -- +$(${1:VAR})$0
\ No newline at end of file diff --git a/ned-mode/chan b/ned-mode/chan new file mode 100644 index 0000000..3f1f4e1 --- /dev/null +++ b/ned-mode/chan @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: chan +# key: chan +# contributor: Andrea crotti +# -- +channel Channel extends ${1:ned.DelayChannel} { + $0 +} diff --git a/ned-mode/connections b/ned-mode/connections new file mode 100644 index 0000000..dc67f52 --- /dev/null +++ b/ned-mode/connections @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: connections +# key: conn +# contributor: Andrea crotti +# -- +connections${1: allowunconnected}: + $0
\ No newline at end of file diff --git a/ned-mode/for b/ned-mode/for new file mode 100644 index 0000000..b207c81 --- /dev/null +++ b/ned-mode/for @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: for +# key: for +# contributor: Andrea crotti +# -- +for ${1:i}=${2:0}..${3:sizeof(port)-1} { + $0 +}
\ No newline at end of file diff --git a/ned-mode/import b/ned-mode/import new file mode 100644 index 0000000..84d15e2 --- /dev/null +++ b/ned-mode/import @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: import +# key: imp +# contributor: Andrea crotti +# -- +import ned.${1:Package};
\ No newline at end of file diff --git a/ned-mode/network b/ned-mode/network new file mode 100644 index 0000000..70a3f39 --- /dev/null +++ b/ned-mode/network @@ -0,0 +1,12 @@ +# -*- mode: snippet -*- +# name: network +# key: net +# contributor: Andrea crotti +# -- +network ${1:Name} +{ + submodules: + $2 + connections: + $3 +}
\ No newline at end of file diff --git a/ned-mode/simple b/ned-mode/simple new file mode 100644 index 0000000..2fbe7d3 --- /dev/null +++ b/ned-mode/simple @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# name: simple +# key: simple +# contributor: Andrea crotti +# -- +simple ${1:Component}${2: extends ${3:Component}} +{ + $0 +}
\ No newline at end of file diff --git a/ned-mode/submodules b/ned-mode/submodules new file mode 100644 index 0000000..dd93bd2 --- /dev/null +++ b/ned-mode/submodules @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: submodules +# key: sub +# contributor: Andrea crotti +# -- +submodules: + $0
\ No newline at end of file diff --git a/nesc-mode/TOSSIM b/nesc-mode/TOSSIM new file mode 100644 index 0000000..297a654 --- /dev/null +++ b/nesc-mode/TOSSIM @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: TOSSIM +# key: tossim +# contributor: Andrea crotti +# -- +#ifndef TOSSIM + $0 +#endif
\ No newline at end of file diff --git a/nesc-mode/author b/nesc-mode/author new file mode 100644 index 0000000..71b3966 --- /dev/null +++ b/nesc-mode/author @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: author +# key: author +# contributor: Andrea crotti +# -- +@author Andrea Crotti, Marius Gysla, Oscar Dustmann
\ No newline at end of file diff --git a/nesc-mode/command b/nesc-mode/command new file mode 100644 index 0000000..955df14 --- /dev/null +++ b/nesc-mode/command @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: command +# key: command +# contributor: Andrea crotti +# -- +command ${1:void} ${2:naMe}($3) { + +}
\ No newline at end of file diff --git a/nesc-mode/dbg b/nesc-mode/dbg new file mode 100644 index 0000000..9350f97 --- /dev/null +++ b/nesc-mode/dbg @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: dbg +# key: dbg +# contributor: Andrea crotti +# -- +dbg("${1:Module}", "${2:message}"${3:, ${4:var list}});
\ No newline at end of file diff --git a/nesc-mode/event b/nesc-mode/event new file mode 100644 index 0000000..4bd95b8 --- /dev/null +++ b/nesc-mode/event @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: event +# key: event +# contributor: Andrea crotti +# -- +event ${1:void} ${2:On.Event}($3) { + $0 +}
\ No newline at end of file diff --git a/nesc-mode/ifdef b/nesc-mode/ifdef new file mode 100644 index 0000000..9ca7b5e --- /dev/null +++ b/nesc-mode/ifdef @@ -0,0 +1,10 @@ +# -*- mode: snippet -*- +# name: ifdef +# key: ifdef +# contributor: Andrea crotti +# -- +#ifdef ${1:Macro} + $2 +${3:#else} + $4 +#endif
\ No newline at end of file diff --git a/nesc-mode/interface b/nesc-mode/interface new file mode 100644 index 0000000..afa86f4 --- /dev/null +++ b/nesc-mode/interface @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: interface +# key: int +# contributor: Andrea crotti +# -- +interface ${1:Interface} { + $0 +}
\ No newline at end of file diff --git a/nesc-mode/module b/nesc-mode/module new file mode 100644 index 0000000..d35ab55 --- /dev/null +++ b/nesc-mode/module @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# name: module +# key: mod +# contributor: Andrea crotti +# -- +module ${1:Module} { + ${2:uses interface ${3:Packet}}; + $0 +}
\ No newline at end of file diff --git a/nesc-mode/nx b/nesc-mode/nx new file mode 100644 index 0000000..889edd9 --- /dev/null +++ b/nesc-mode/nx @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: nx +# key: nx +# contributor: Andrea crotti +# -- +nx_uint${1:8}_t ${2:var}; +$0
\ No newline at end of file diff --git a/nesc-mode/provides b/nesc-mode/provides new file mode 100644 index 0000000..fc8f8b8 --- /dev/null +++ b/nesc-mode/provides @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: provides +# key: provides +# contributor: Andrea crotti +# -- +provides interface ${1:Interface};
\ No newline at end of file diff --git a/nesc-mode/sim b/nesc-mode/sim new file mode 100644 index 0000000..37feb76 --- /dev/null +++ b/nesc-mode/sim @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: sim +# key: sim +# contributor: Andrea crotti +# -- +#ifdef TOSSIM + $0 +#endif
\ No newline at end of file diff --git a/nesc-mode/uint8_t b/nesc-mode/uint8_t new file mode 100644 index 0000000..a3b12f1 --- /dev/null +++ b/nesc-mode/uint8_t @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: uint8_t +# key: u8 +# contributor: Andrea crotti +# -- +uint8_t ${1:var}; +$0
\ No newline at end of file diff --git a/nesc-mode/uses b/nesc-mode/uses new file mode 100644 index 0000000..1e6f765 --- /dev/null +++ b/nesc-mode/uses @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: uses +# key: uses +# contributor: Andrea crotti +# -- +uses interface ${1:Interface}${2: as ${3:alias}}; +$0
\ No newline at end of file diff --git a/octave-mode/for b/octave-mode/for new file mode 100644 index 0000000..2ef1ae3 --- /dev/null +++ b/octave-mode/for @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: for +# key: for +# contributor: Andrea crotti +# -- +for ${1:var} = ${2:expr} + $0 +endfor
\ No newline at end of file diff --git a/octave-mode/function b/octave-mode/function new file mode 100644 index 0000000..3a00aa5 --- /dev/null +++ b/octave-mode/function @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: function +# key: fun +# contributor: Andrea crotti +# -- +function ${1:return_val} = ${2:fname}(${3:args}) + $0 +endfunction
\ No newline at end of file diff --git a/octave-mode/if b/octave-mode/if new file mode 100644 index 0000000..0e103b5 --- /dev/null +++ b/octave-mode/if @@ -0,0 +1,10 @@ +# -*- mode: snippet -*- +# name: if +# key: if +# contributor: Andrea crotti +# -- +if ${1:cond} + $0 +${2:else + ${3:other}} +endif
\ No newline at end of file diff --git a/org-mode/beamer b/org-mode/beamer new file mode 100644 index 0000000..f866542 --- /dev/null +++ b/org-mode/beamer @@ -0,0 +1,17 @@ +# -*- mode: snippet -*- +# name: beamer +# key: beamer +# contributor: Andrea crotti +# -- +#+STARTUP: beamer +#+OPTIONS: toc:nil +#+LANGUAGE: ${1:it} +#+LaTeX_CLASS: beamer +#+LaTeX_CLASS_OPTIONS: [presentation] +#+BEAMER_FRAME_LEVEL: 2 +#+BEAMER_HEADER_EXTRA: \usetheme{Berlin} \usecolortheme{default} +#+COLUMNS: %40ITEM %10BEAMER_env(Env) %10BEAMER_envargs(Env Args) %4BEAMER_col(Col) %8BEAMER_extra(Extra) +#+TITLE: ${2:TITLE} +#+AUTHOR: Andrea Crotti + +$0 diff --git a/org-mode/code b/org-mode/code new file mode 100644 index 0000000..1976150 --- /dev/null +++ b/org-mode/code @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: code +# key: code +# contributor: Andrea crotti +# -- +#+begin_${1:lang} ${2:options} +$0 +#+end_$1
\ No newline at end of file diff --git a/org-mode/crypt b/org-mode/crypt new file mode 100644 index 0000000..378d174 --- /dev/null +++ b/org-mode/crypt @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: crypt +# key: crypt +# contributor: Andrea crotti +# -- +-*- mode: org; epa-file-encrypt-to: (“andrea.crotti.0@gmail.com”) -*- +$0
\ No newline at end of file diff --git a/org-mode/curly b/org-mode/curly new file mode 100644 index 0000000..b0b3886 --- /dev/null +++ b/org-mode/curly @@ -0,0 +1,11 @@ +# -*- mode: snippet -*- +# name: curly +# key: curly +# contributor: Andrea crotti +# -- +${1:def} = +\left \{ +\begin{array}{ll} +$0 +\end{array} +\right
\ No newline at end of file diff --git a/org-mode/dot b/org-mode/dot index c040564..e9db9fc 100644 --- a/org-mode/dot +++ b/org-mode/dot @@ -1,7 +1,10 @@ # -*- mode: snippet -*- # name: dot # key: dot +# contributor: Andrea crotti # -- -#+begin_src dot :file ${1:path}.${2:pdf} :cmdline -T$2 -$0 -#+end_src
\ No newline at end of file +#+begin_src dot :file ${1:file} :cmdline -T${2:pdf} :exports none :results silent + $0 +#+end_src + +[[file:$1]]
\ No newline at end of file diff --git a/org-mode/elisp b/org-mode/elisp new file mode 100644 index 0000000..aea4c48 --- /dev/null +++ b/org-mode/elisp @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: elisp +# key: elisp +# contributor: Andrea crotti +# -- +#+begin_src emacs-lisp :tangle yes +$0 +#+end_src
\ No newline at end of file diff --git a/org-mode/embedded b/org-mode/embedded new file mode 100644 index 0000000..5858bdb --- /dev/null +++ b/org-mode/embedded @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: embedded +# key: emb +# contributor: Andrea crotti +# -- +src_${1:lang}${2:[${3:where}]}{${4:code}}
\ No newline at end of file diff --git a/org-mode/entry b/org-mode/entry new file mode 100644 index 0000000..45271e0 --- /dev/null +++ b/org-mode/entry @@ -0,0 +1,12 @@ +# -*- mode: snippet -*- +# name: entry +# key: entry +# contributor: Andrea crotti +# -- +#+begin_html +--- +layout: ${1:default} +title: ${2:title} +--- +#+end_html +$0
\ No newline at end of file diff --git a/org-mode/img b/org-mode/img new file mode 100644 index 0000000..13093cb --- /dev/null +++ b/org-mode/img @@ -0,0 +1,11 @@ +# -*- mode: snippet -*- +# name: img +# key: img +# contributor: Andrea crotti +# -- +<img src="$1" + alt="$2" align="${3:left}" + title="${4:image title}" + class="img" +</img> +$0
\ No newline at end of file diff --git a/org-mode/latex b/org-mode/latex new file mode 100644 index 0000000..62228ee --- /dev/null +++ b/org-mode/latex @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: latex +# key: latex +# contributor: Andrea crotti +# -- +#+BEGIN_LaTeX +$0 +#+END_LaTeX
\ No newline at end of file diff --git a/org-mode/matrix b/org-mode/matrix new file mode 100644 index 0000000..9e2f679 --- /dev/null +++ b/org-mode/matrix @@ -0,0 +1,12 @@ +# -*- mode: snippet -*- +# name: matrix +# key: matrix +# possible improvement, compute the number of lines from the argument to array +# contributor: Andrea crotti +# -- +\left \( +\begin{array}{${1:ccc}} +${2:v1 & v2} \\ +$0 +\end{array} +\right \)
\ No newline at end of file diff --git a/org-mode/node b/org-mode/node new file mode 100644 index 0000000..161d36e --- /dev/null +++ b/org-mode/node @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: node +# key: node +# contributor: Andrea crotti +# -- +t${1:0} [ label = "${2:label}" ]; +$0
\ No newline at end of file diff --git a/org-mode/src b/org-mode/src new file mode 100644 index 0000000..1209f96 --- /dev/null +++ b/org-mode/src @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# name: src +# key: src +# contributor: Andrea Crotti +# contributor: Andrea crotti +# -- +#+begin_src ${1:language} +$0 +#+end_src diff --git a/org-mode/srcname b/org-mode/srcname new file mode 100644 index 0000000..c9c532e --- /dev/null +++ b/org-mode/srcname @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: srcname +# key: name +# contributor: Andrea crotti +# -- +#+srcname: $0
\ No newline at end of file diff --git a/org-mode/verse b/org-mode/verse new file mode 100644 index 0000000..9af51ce --- /dev/null +++ b/org-mode/verse @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: verse +# key: verse +# contributor: Andrea crotti +# -- +#+begin_verse + $0 +#+end_verse
\ No newline at end of file diff --git a/python-mode/builtin b/python-mode/builtin new file mode 100644 index 0000000..8748c12 --- /dev/null +++ b/python-mode/builtin @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: builtin +# key: __ +# group : definitions +# contributor: Andrea crotti +# -- +def __${1:$$(yas/choose-value '("str" "cmp" "iter" "eq" "repr"))}__(self${2:, other}): + $0
\ No newline at end of file diff --git a/python-mode/cfor b/python-mode/cfor new file mode 100644 index 0000000..556d472 --- /dev/null +++ b/python-mode/cfor @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: cfor +# key: cfor +# contributor: Andrea crotti +# -- +for ${1:i} from ${2:0} < = $1 < ${3:num}: + $0 diff --git a/python-mode/classmethod b/python-mode/classmethod new file mode 100644 index 0000000..7bb66a2 --- /dev/null +++ b/python-mode/classmethod @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: classmethod +# key: cm +# -- +@classmethod +def ${1:meth}(cls, $0): +
\ No newline at end of file diff --git a/python-mode/cls b/python-mode/cls new file mode 100644 index 0000000..a9f888c --- /dev/null +++ b/python-mode/cls @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: cls +# key: cls +# contributor: Andrea crotti +# -- +class ${1:class}(${2:object}): + $0
\ No newline at end of file diff --git a/python-mode/dec b/python-mode/dec new file mode 100644 index 0000000..768b109 --- /dev/null +++ b/python-mode/dec @@ -0,0 +1,14 @@ +# -*- mode: snippet -*- +# name: dec +# key: dec +# group : definitions +# contributor: Andrea crotti +# -- +def ${1:decorator}(func): + $2 + def _$1(*args, **kwargs): + $3 + ret = func(*args, **kwargs) + $4 + return ret + return _$1
\ No newline at end of file diff --git a/python-mode/def b/python-mode/def new file mode 100644 index 0000000..df5202c --- /dev/null +++ b/python-mode/def @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: def +# key: def +# group : definitions +# contributor: Andrea crotti +# -- +def ${1:fun}(${2:args}): + $0
\ No newline at end of file diff --git a/python-mode/deftest b/python-mode/deftest new file mode 100644 index 0000000..541e35d --- /dev/null +++ b/python-mode/deftest @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: deftest +# key: dt +# -- +def test_${1:long_name}(self): + $0
\ No newline at end of file diff --git a/python-mode/docstring b/python-mode/docstring new file mode 100644 index 0000000..8255ccd --- /dev/null +++ b/python-mode/docstring @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: docstring +# key: ds +# contributor: Andrea crotti +# -- +""" +$0 +""" diff --git a/python-mode/doctest b/python-mode/doctest new file mode 100644 index 0000000..4ac8c9c --- /dev/null +++ b/python-mode/doctest @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: doctest +# key: doc +# contributor: Andrea crotti +# -- +>>> ${1:function calls} +${2:desired output} +$0
\ No newline at end of file diff --git a/python-mode/eq b/python-mode/eq new file mode 100644 index 0000000..8dd7684 --- /dev/null +++ b/python-mode/eq @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: eq +# key: eq +# group: overloading +# contributor: Andrea crotti +# -- +def __eq__(self, other): + return self.$1 == other.$1
\ No newline at end of file diff --git a/python-mode/from b/python-mode/from new file mode 100644 index 0000000..14d7d65 --- /dev/null +++ b/python-mode/from @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: from +# key: from +# group : general +# contributor: Andrea crotti +# -- +from ${1:lib} import ${2:funs} +$0
\ No newline at end of file diff --git a/python-mode/fsf b/python-mode/fsf new file mode 100644 index 0000000..7805b03 --- /dev/null +++ b/python-mode/fsf @@ -0,0 +1,23 @@ +# -*- mode: snippet -*- +# name: fsf +# key: fsf +# contributor: Andrea crotti +# -- +############################################################################# +## ## +## Fetched from http://www.secdev.org/python/tunproxy.py ## +## ${1:filename}.py --- small demo program for tunneling over UDP with tun/tap ## +## ## +## Copyright (C) ${2:date somehow} Andrea Crotti ## +## ## +## This program is free software; you can redistribute it and/or modify it ## +## under the terms of the GNU General Public License as published by the ## +## Free Software Foundation; either version 2, or (at your option) any ## +## later version. ## +## ## +## This program is distributed in the hope that it will be useful, but ## +## WITHOUT ANY WARRANTY; without even the implied warranty of ## +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ## +## General Public License for more details. ## +## ## +############################################################################# diff --git a/python-mode/function b/python-mode/function new file mode 100644 index 0000000..5462544 --- /dev/null +++ b/python-mode/function @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: function +# key: f +# -- +def ${1:function}($0): +
\ No newline at end of file diff --git a/python-mode/if b/python-mode/if new file mode 100644 index 0000000..9ea8fa2 --- /dev/null +++ b/python-mode/if @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: if +# key: if +# group : control structure +# contributor: Andrea crotti +# -- +if ${1:cond}: + $0
\ No newline at end of file diff --git a/python-mode/ife b/python-mode/ife new file mode 100644 index 0000000..c3fc3d5 --- /dev/null +++ b/python-mode/ife @@ -0,0 +1,10 @@ +# -*- mode: snippet -*- +# name: ife +# key: ife +# group : control structure +# contributor: Andrea crotti +# -- +if $1: + $2 +else: + $0
\ No newline at end of file diff --git a/python-mode/import b/python-mode/import new file mode 100644 index 0000000..a59d4e4 --- /dev/null +++ b/python-mode/import @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: import +# key: imp +# group : general +# contributor: Andrea crotti +# -- +import ${1:lib}${2: as ${3:alias}} +$0
\ No newline at end of file diff --git a/python-mode/init b/python-mode/init new file mode 100644 index 0000000..5b5fdd5 --- /dev/null +++ b/python-mode/init @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# name: init +# key: init +# group : definitions +# contributor: Andrea crotti +# -- +def __init__(self${1:, args}): + ${2:"${3:docstring}" + }$0
\ No newline at end of file diff --git a/python-mode/iso b/python-mode/iso new file mode 100644 index 0000000..53da5ff --- /dev/null +++ b/python-mode/iso @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: iso +# key: iso +# group : general +# contributor: Andrea crotti +# -- +# -*- coding: iso-8859-15 -*- +$0
\ No newline at end of file diff --git a/python-mode/iter b/python-mode/iter new file mode 100644 index 0000000..cf28637 --- /dev/null +++ b/python-mode/iter @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: iter +# key: iter +# group: overloading +# contributor: Andrea crotti +# -- +def __iter__(self): + return ${1:iter($2)}
\ No newline at end of file diff --git a/python-mode/lambda b/python-mode/lambda new file mode 100644 index 0000000..4478ddf --- /dev/null +++ b/python-mode/lambda @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: lambda +# key: lam +# contributor: Andrea crotti +# -- +lambda ${1:x}: $0
\ No newline at end of file diff --git a/python-mode/list b/python-mode/list new file mode 100644 index 0000000..13243c6 --- /dev/null +++ b/python-mode/list @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: list +# key: li +# group : definitions +# contributor: Andrea crotti +# -- +[${1:el} for $1 in ${2:list}] +$0
\ No newline at end of file diff --git a/python-mode/logging b/python-mode/logging new file mode 100644 index 0000000..f4a0009 --- /dev/null +++ b/python-mode/logging @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: logging +# key: log +# contributor: Andrea crotti +# -- +logger = logging.getLogger("${1:name}") +logger.setLevel(logging.${2:level}) diff --git a/python-mode/metaclass b/python-mode/metaclass new file mode 100644 index 0000000..242af34 --- /dev/null +++ b/python-mode/metaclass @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: metaclass +# key: meta +# contributor: Andrea crotti +# -- +__metaclass__ = $0
\ No newline at end of file diff --git a/python-mode/method b/python-mode/method new file mode 100644 index 0000000..55e9756 --- /dev/null +++ b/python-mode/method @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: method +# key: m +# -- +def ${1:method}(self, $0): +
\ No newline at end of file diff --git a/python-mode/not_impl b/python-mode/not_impl new file mode 100644 index 0000000..b985369 --- /dev/null +++ b/python-mode/not_impl @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: not_impl +# key: not_impl +# contributor: Andrea crotti +# -- +raise NotImplementedError
\ No newline at end of file diff --git a/python-mode/np b/python-mode/np new file mode 100644 index 0000000..4652cf4 --- /dev/null +++ b/python-mode/np @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: np +# key: np +# group : general +# contributor: Andrea crotti +# -- +import numpy as np +$0
\ No newline at end of file diff --git a/python-mode/pack b/python-mode/pack new file mode 100644 index 0000000..f4a55df --- /dev/null +++ b/python-mode/pack @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: pack +# key: pack +# contributor: Andrea crotti +# -- +struct.pack("!${1:fmt}", $0)
\ No newline at end of file diff --git a/python-mode/prop b/python-mode/prop new file mode 100644 index 0000000..cc43fd9 --- /dev/null +++ b/python-mode/prop @@ -0,0 +1,18 @@ +# contributor: Mads D. Kristensen <madsdk@gmail.com> +# name: prop +# contributor: Andrea crotti +# -- +def ${1:foo}(): + doc = """${2:Doc string}""" + def fget(self): + return self._$1 + + def fset(self, value): + self._$1 = value + + def fdel(self): + del self._$1 + return locals() +$1 = property(**$1()) + +$0 diff --git a/python-mode/reg b/python-mode/reg new file mode 100644 index 0000000..dfda0ed --- /dev/null +++ b/python-mode/reg @@ -0,0 +1,11 @@ +# -*- mode: snippet -*- +# name: reg +# key: reg +<<<<<<< HEAD +# group : general +======= +>>>>>>> d3678734bbc83e0fcaf0cf4493c0fbace41c5416 +# contributor: Andrea crotti +# -- +${1:regexp} = re.compile(r"${2:expr}") +$0
\ No newline at end of file diff --git a/python-mode/scapy b/python-mode/scapy new file mode 100644 index 0000000..70f543e --- /dev/null +++ b/python-mode/scapy @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: scapy +# key: scapy +# contributor: Andrea crotti +# -- +from scapy.all import $0
\ No newline at end of file diff --git a/python-mode/self b/python-mode/self new file mode 100644 index 0000000..8ddc1bd --- /dev/null +++ b/python-mode/self @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: self +# key: . +# contributor: Andrea crotti +# -- +self.$0
\ No newline at end of file diff --git a/python-mode/setdef b/python-mode/setdef new file mode 100644 index 0000000..b3df72e --- /dev/null +++ b/python-mode/setdef @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: setdef +# key: setdef +# contributor: Andrea crotti +# -- +${1:var}.setdefault(${2:key}, []).append(${3:value})
\ No newline at end of file diff --git a/python-mode/static b/python-mode/static new file mode 100644 index 0000000..02a80c7 --- /dev/null +++ b/python-mode/static @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: static +# key: sm +# contributor: Andrea crotti +# -- +@staticmethod +def ${1:func}($0): +
\ No newline at end of file diff --git a/python-mode/str b/python-mode/str new file mode 100644 index 0000000..539ade3 --- /dev/null +++ b/python-mode/str @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: str +# key: str +# group: overloading +# contributor: Andrea crotti +# -- +def __str__(self): + $0
\ No newline at end of file diff --git a/python-mode/super b/python-mode/super new file mode 100644 index 0000000..76a61a1 --- /dev/null +++ b/python-mode/super @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: super +# key: super +# contributor: Andrea crotti +# -- +super(${1:Class}, self).${2:function}(${3:args})
\ No newline at end of file diff --git a/python-mode/test_class b/python-mode/test_class new file mode 100644 index 0000000..4013022 --- /dev/null +++ b/python-mode/test_class @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: test_class +# key: tcs +# group : definitions +# contributor: Andrea crotti +# -- +class Test${1:toTest}(unittest.TestCase): + $0 diff --git a/python-mode/test_file b/python-mode/test_file new file mode 100644 index 0000000..ea78f07 --- /dev/null +++ b/python-mode/test_file @@ -0,0 +1,13 @@ +# -*- mode: snippet -*- +# name: test_file +# key: tf +# group : definitions +# contributor: Andrea crotti +# -- +import unittest +${1:from ${2:test_file} import *} + +$0 + +if __name__ == '__main__': + unittest.main()
\ No newline at end of file diff --git a/python-mode/trace b/python-mode/trace new file mode 100644 index 0000000..033800d --- /dev/null +++ b/python-mode/trace @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: trace +# key: tr +# contributor: Andrea crotti +# -- +import pdb; pdb.set_trace()
\ No newline at end of file diff --git a/python-mode/utf8 b/python-mode/utf8 new file mode 100644 index 0000000..f16b2eb --- /dev/null +++ b/python-mode/utf8 @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: utf8 +# key: utf +# group : general +# contributor: Andrea crotti +# -- +# -*- encoding: utf-8 -*- +$0
\ No newline at end of file diff --git a/python-mode/with b/python-mode/with new file mode 100644 index 0000000..a8cee42 --- /dev/null +++ b/python-mode/with @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: with +# key: with +# group : control structure +# contributor: Andrea crotti +# -- +with ${1:expr}${2: as ${3:alias}}: + $0
\ No newline at end of file diff --git a/python-mode/yaml b/python-mode/yaml new file mode 100644 index 0000000..a88218a --- /dev/null +++ b/python-mode/yaml @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: yaml +# key: yaml +# group : general +# contributor: Andrea crotti +# -- +${1:res} = yaml.load(open(${2:file})) +$0
\ No newline at end of file diff --git a/rename_add_contr.py b/rename_add_contr.py index c513164..3ed7847 100644..100755 --- a/rename_add_contr.py +++ b/rename_add_contr.py @@ -3,11 +3,14 @@ import os import re from os.path import join from shutil import move + + def rename(root, f): - if not f.endswith(".yasnippet"): - move(join(root, f), join(root, f + ".yasnippet")) - else: - print "already ending with the right extension" + if f.endswith('.yasnippet'): + base, _ = f.split('.') + print("move %s to %s" % (join(root, f), join(root, base))) + move(join(root, f), join(root, base)) + CONT = "# contributor: Andrea crotti\n# --" END = "# --\n\n" @@ -21,11 +24,13 @@ def insert(root, f, orig, to): nex_text = re.sub(orig, to, text) open(fname, 'w').write(nex_text) -for root, dirs, files in os.walk('.'): - if "mode" in root: - # os.popen("git add *yasnippet") - for f in files: - insert(root, f, orig, to) +if __name__ == '__main__': + for root, dirs, files in os.walk('.'): + if "mode" in root: + # os.popen("git add *yasnippet") + for f in files: + rename(root, f) + # insert(root, f, orig, to) diff --git a/ruby-mode/GLOB b/ruby-mode/GLOB new file mode 100644 index 0000000..cb8a981 --- /dev/null +++ b/ruby-mode/GLOB @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: GLOB +# key: $ +# contributor: Andrea crotti +# -- +$${1:GLOBAL} = $0
\ No newline at end of file diff --git a/ruby-mode/attribute b/ruby-mode/attribute new file mode 100644 index 0000000..95c811a --- /dev/null +++ b/ruby-mode/attribute @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: attribute +# key: @ +# contributor: Andrea crotti +# -- +@${1:attr} = $0
\ No newline at end of file diff --git a/ruby-mode/bench b/ruby-mode/bench new file mode 100644 index 0000000..25a9f69 --- /dev/null +++ b/ruby-mode/bench @@ -0,0 +1,11 @@ +# -*- mode: snippet -*- +# name: bench +# key: bench +# contributor: Andrea crotti +# -- +require "benchmark" + +TESTS = ${1:1_000} +Benchmark.bmbm do |x| + x.report("${2:var}") {} +end diff --git a/ruby-mode/def b/ruby-mode/def new file mode 100644 index 0000000..33c919e --- /dev/null +++ b/ruby-mode/def @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: def +# key: def +# contributor: Andrea crotti +# -- +def ${1:method}${2:(${3:args})} + $0 +end
\ No newline at end of file diff --git a/ruby-mode/init b/ruby-mode/init new file mode 100644 index 0000000..95754f0 --- /dev/null +++ b/ruby-mode/init @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: init +# key: init +# contributor: Andrea crotti +# -- +def initialize(${1:args}) + $0 +end
\ No newline at end of file diff --git a/ruby-mode/test class b/ruby-mode/test class new file mode 100644 index 0000000..234b1c3 --- /dev/null +++ b/ruby-mode/test class @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: test class +# key: tc +# contributor: Andrea crotti +# -- +class TC_${1:Class} < Test::Unit::TestCase + $0 +end
\ No newline at end of file diff --git a/ruby-mode/to_ b/ruby-mode/to_ new file mode 100644 index 0000000..812426e --- /dev/null +++ b/ruby-mode/to_ @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# name: to_ +# key: to_ +# contributor: Andrea crotti +# -- +def to_s + "${1:string}" +end +$0
\ No newline at end of file diff --git a/ruby-mode/tu b/ruby-mode/tu new file mode 100644 index 0000000..f0e2c49 --- /dev/null +++ b/ruby-mode/tu @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: tu +# key: tu +# contributor: Andrea crotti +# -- +require 'test/unit'
\ No newline at end of file diff --git a/sh-mode/bang b/sh-mode/bang new file mode 100644 index 0000000..e93e718 --- /dev/null +++ b/sh-mode/bang @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: bang +# key: ! +# contributor: Andrea crotti +# -- +#!/bin/bash +$0
\ No newline at end of file diff --git a/sh-mode/for loop b/sh-mode/for loop new file mode 100644 index 0000000..7701358 --- /dev/null +++ b/sh-mode/for loop @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: for loop +# key: for +# contributor: Andrea crotti +# -- +for ${1:var} in ${2:stuff} do + $0 +done
\ No newline at end of file diff --git a/sh-mode/function b/sh-mode/function new file mode 100644 index 0000000..b18523a --- /dev/null +++ b/sh-mode/function @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: function +# key: func +# contributor: Andrea crotti +# -- +function ${1:name} (${2:args}) { + $0 +}
\ No newline at end of file diff --git a/sh-mode/if b/sh-mode/if new file mode 100644 index 0000000..9daab2e --- /dev/null +++ b/sh-mode/if @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# name: if +# key: if +# contributor: Andrea crotti +# -- +if ${1:[ -f file]} + then ${2:do} +fi +$0
\ No newline at end of file diff --git a/sh-mode/ife b/sh-mode/ife new file mode 100644 index 0000000..6145daf --- /dev/null +++ b/sh-mode/ife @@ -0,0 +1,10 @@ +# -*- mode: snippet -*- +# name: ife +# key: ife +# contributor: Andrea crotti +# -- +if ${1:cond} +then ${2:stuff} +else ${3:other} +fi +$0
\ No newline at end of file diff --git a/snippet-mode/cont b/snippet-mode/cont new file mode 100644 index 0000000..ae9ab79 --- /dev/null +++ b/snippet-mode/cont @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: cont +# key: cont +# contributor: Andrea crotti +# -- +# contributor: Andrea Crotti
\ No newline at end of file diff --git a/snippet-mode/elisp b/snippet-mode/elisp new file mode 100644 index 0000000..772502e --- /dev/null +++ b/snippet-mode/elisp @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: elisp +# key: ` +# contributor: Andrea crotti +# -- +\`$0\`
\ No newline at end of file diff --git a/snippet-mode/group b/snippet-mode/group new file mode 100644 index 0000000..9f3aafb --- /dev/null +++ b/snippet-mode/group @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: group +# key: group +# contributor: Andrea crotti +# -- +# group : ${1:group}
\ No newline at end of file diff --git a/text-mode/bang b/text-mode/bang new file mode 100644 index 0000000..f7ef140 --- /dev/null +++ b/text-mode/bang @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: bang +# key: ! +# insert a choice if you have more than one possibility +# contributor: Andrea crotti +# -- +#!/usr/bin/env `(let ((found (all-asscs interpreter-mode-alist major-mode))) (if found (yas/choose-value found) ""))`$0
\ No newline at end of file diff --git a/text-mode/fixme b/text-mode/fixme new file mode 100644 index 0000000..a049a5c --- /dev/null +++ b/text-mode/fixme @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: fixme +# key: fi +# contributor: Andrea crotti +# -- +`(with-comment " FIXME: $0")`
\ No newline at end of file diff --git a/text-mode/localvar b/text-mode/localvar new file mode 100644 index 0000000..2f56469 --- /dev/null +++ b/text-mode/localvar @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: var +# key: var +# contributor: Andrea crotti +# -- +`(with-comment "-*- ${1:var}: ${2:value} -*-")`
\ No newline at end of file diff --git a/text-mode/mode b/text-mode/mode new file mode 100644 index 0000000..71ca63b --- /dev/null +++ b/text-mode/mode @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: mode +# key: mode +# contributor: Andrea crotti +# -- +`(with-comment "-*- mode: ${1:mode} -*-")`
\ No newline at end of file diff --git a/text-mode/rect b/text-mode/rect new file mode 100644 index 0000000..f4fe628 --- /dev/null +++ b/text-mode/rect @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: rect +# key: rect +# contributor: Andrea crotti +# -- +<rect x="${1:1}" y="${2:1}" width="${3:1198}" height="${4:398}" + fill="${5:none}" stroke="${6:blue}" stroke-width="${7:2}"/> diff --git a/text-mode/svg b/text-mode/svg new file mode 100644 index 0000000..63dc7e8 --- /dev/null +++ b/text-mode/svg @@ -0,0 +1,10 @@ +# -*- mode: snippet -*- +# name: svg +# key: svg +# contributor: Andrea crotti +# -- +<svg width="${1:12}cm" height="${2:4}cm" viewBox="0 0 1200 400" + xmlns="http://www.w3.org/2000/svg" version="1.1"> + + $0 +</svg>
\ No newline at end of file diff --git a/text-mode/switch b/text-mode/switch new file mode 100644 index 0000000..b7a8a48 --- /dev/null +++ b/text-mode/switch @@ -0,0 +1,10 @@ +# -*- mode: snippet -*- +# name: switch +# key: switch +# contributor: Andrea crotti +# -- +switch (${1:var}) { + case ${2:0}: + $0 + break; +} diff --git a/text-mode/todo b/text-mode/todo new file mode 100644 index 0000000..e099b74 --- /dev/null +++ b/text-mode/todo @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: todo +# key: t +# contributor: Andrea crotti +# -- +`(with-comment " TODO: $0")`
\ No newline at end of file diff --git a/text-mode/xxx b/text-mode/xxx new file mode 100644 index 0000000..f8c2085 --- /dev/null +++ b/text-mode/xxx @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: xxx +# key: x +# contributor: Andrea crotti +# -- +`(with-comment "XXX: $0 ")`
\ No newline at end of file diff --git a/tuareg-mode/let b/tuareg-mode/let new file mode 100644 index 0000000..ed781fa --- /dev/null +++ b/tuareg-mode/let @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: let +# key: let +# contributor: Andrea crotti +# -- +let ${1:var} $0
\ No newline at end of file diff --git a/tuareg-mode/printf b/tuareg-mode/printf new file mode 100644 index 0000000..758af4b --- /dev/null +++ b/tuareg-mode/printf @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: printf +# key: printf +# contributor: Andrea crotti +# -- +Printf.printf ${1:"string"} ${2:vals};;
\ No newline at end of file diff --git a/tuareg-mode/rec b/tuareg-mode/rec new file mode 100644 index 0000000..25a77b2 --- /dev/null +++ b/tuareg-mode/rec @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: rec +# key: rec +# contributor: Andrea crotti +# -- +let rec ${1:fun} ${2:args} = + $0
\ No newline at end of file diff --git a/yaml-mode/entry b/yaml-mode/entry new file mode 100644 index 0000000..eabc485 --- /dev/null +++ b/yaml-mode/entry @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: entry +# key: entry +# contributor: Andrea crotti +# -- +${1:entry}: ${2:value} +$0
\ No newline at end of file diff --git a/yaml-mode/list b/yaml-mode/list new file mode 100644 index 0000000..89a4bdd --- /dev/null +++ b/yaml-mode/list @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: list +# key: list +# contributor: Andrea crotti +# -- +[$1] +$0
\ No newline at end of file diff --git a/yaml-mode/section b/yaml-mode/section new file mode 100644 index 0000000..5ef3d7d --- /dev/null +++ b/yaml-mode/section @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: section +# key: -- +# contributor: Andrea crotti +# -- +--- # ${1:section} +$0
\ No newline at end of file |