diff --git a/snippets/c++-ts-mode/acm b/snippets/c++-ts-mode/acm new file mode 100644 index 000000000..6e885bc5f --- /dev/null +++ b/snippets/c++-ts-mode/acm @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: accumulate +# key: acm +# -- +auto sum = std::accumulate(std::begin(${1:container}), std::end($1), 0); +$0 diff --git a/snippets/c++-ts-mode/ajf b/snippets/c++-ts-mode/ajf new file mode 100644 index 000000000..105419e28 --- /dev/null +++ b/snippets/c++-ts-mode/ajf @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# name: adjacent_find +# key: ajf +# -- +auto pos = std::adjacent_find(std::begin(${1:container}), std::end($1)); +if (pos != std::end($1)) { + $2 +} +$0 diff --git a/snippets/c++-ts-mode/alo b/snippets/c++-ts-mode/alo new file mode 100644 index 000000000..f16ad5466 --- /dev/null +++ b/snippets/c++-ts-mode/alo @@ -0,0 +1,10 @@ +# -*- mode: snippet -*- +# name: all_of +# key: alo +# -- +if (std::all_of(std::begin(${1:container}), std::end($1), []($2) { + $3 +})) { + $4 +} +$0 diff --git a/snippets/c++-ts-mode/ano b/snippets/c++-ts-mode/ano new file mode 100644 index 000000000..36e017f5a --- /dev/null +++ b/snippets/c++-ts-mode/ano @@ -0,0 +1,10 @@ +# -*- mode: snippet -*- +# name: any_of +# key: ano +# -- +if (std::any_of(std::begin(${1:container}), std::end($1), []($2) { + $3 +})) { + $4 +} +$0 diff --git a/snippets/c++-ts-mode/assert b/snippets/c++-ts-mode/assert new file mode 100644 index 000000000..f8f6a4990 --- /dev/null +++ b/snippets/c++-ts-mode/assert @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: assert +# key: ass +# -- +assert($0); \ No newline at end of file diff --git a/snippets/c++-ts-mode/beginend b/snippets/c++-ts-mode/beginend new file mode 100644 index 000000000..9b4c5ab18 --- /dev/null +++ b/snippets/c++-ts-mode/beginend @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: v.begin(), v.end() +# key: beginend +# -- +${1:v}.begin(), $1.end() diff --git a/snippets/c++-ts-mode/boost_require b/snippets/c++-ts-mode/boost_require new file mode 100644 index 000000000..804bb3f89 --- /dev/null +++ b/snippets/c++-ts-mode/boost_require @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: boost_require +# key: req +# group: boost +# -- +BOOST_REQUIRE( ${1:condition} ); +$0 \ No newline at end of file diff --git a/snippets/c++-ts-mode/cerr b/snippets/c++-ts-mode/cerr new file mode 100644 index 000000000..2be491741 --- /dev/null +++ b/snippets/c++-ts-mode/cerr @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: cerr +# key: err +# -- +cerr << $0; diff --git a/snippets/c++-ts-mode/cin b/snippets/c++-ts-mode/cin new file mode 100644 index 000000000..5442fbe50 --- /dev/null +++ b/snippets/c++-ts-mode/cin @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: cin +# key: cin +# -- +`(progn (goto-char (point-min)) (unless (re-search-forward +"^using\\s-+namespace std;" nil 'no-error) "std::")) +`cin >> $0; \ No newline at end of file diff --git a/snippets/c++-ts-mode/class b/snippets/c++-ts-mode/class new file mode 100644 index 000000000..39bf1dbcf --- /dev/null +++ b/snippets/c++-ts-mode/class @@ -0,0 +1,11 @@ +# -*- mode: snippet -*- +# name: class +# key: cls +# -- +class ${1:Name} +{ +public: + ${1:$(yas-c++-class-name yas-text)}(); + ${2:virtual ~${1:$(yas-c++-class-name yas-text)}();} +}; +$0 \ No newline at end of file diff --git a/snippets/c++-ts-mode/class11 b/snippets/c++-ts-mode/class11 new file mode 100644 index 000000000..73390b09b --- /dev/null +++ b/snippets/c++-ts-mode/class11 @@ -0,0 +1,46 @@ +# -*- mode: snippet -*- +# name: class11 +# key: cls11 +# group: c++11 +# uuid: d7c41f87-9b8a-479d-bb12-89f4cbdd46a7 +# contributor: Ved Vyas +# +## Snippet for C++11 classes based on c++-mode/class. Allows for Rule of +## [0, All]. A choice between ";", " = default;", and " = delete;" is presented +## for each method. The methods and some of the optional keywords/specifiers are +## exposed as fields that users can easily skip-and-clear. +## Hackish query-replace-regexp to renumber non-mirror fields in the region +## between public and protected (can use N as a field number in the snippet): +## \${[0-9N]*:\([^\$]\) -> ${\,(+ 2 \#):\1 +## +## References +## 1. http://en.cppreference.com/w/cpp/language/rule_of_three#Rule_of_five +## 2. https://en.wikipedia.org/wiki/Rule_of_three_%28C%2B%2B_programming%29#Example_in_C.2B.2B +## 3. http://stackoverflow.com/a/4782927 +# -- +class ${1:Name} +{ +public: +${2: ${3://! Default constructor + }${1:$(yas-c++-class-name yas-text)}()${4:;$(yas-c++-class-method-declare-choice)} + +}${5: ${6://! Copy constructor + }${1:$(yas-c++-class-name yas-text)}(const ${1:$(yas-c++-class-name yas-text)} &other)${7:;$(yas-c++-class-method-declare-choice)} + +}${8: ${9://! Move constructor + }${1:$(yas-c++-class-name yas-text)}(${1:$(yas-c++-class-name yas-text)} &&other)${10: noexcept}${11:;$(yas-c++-class-method-declare-choice)} + +}${12: ${13://! Destructor + }${14:virtual }~${1:$(yas-c++-class-name yas-text)}()${15: noexcept}${16:;$(yas-c++-class-method-declare-choice)} + +}${17: ${18://! Copy assignment operator + }${1:$(yas-c++-class-name yas-text)}& operator=(const ${1:$(yas-c++-class-name yas-text)} &other)${19:;$(yas-c++-class-method-declare-choice)} + +}${20: ${21://! Move assignment operator + }${1:$(yas-c++-class-name yas-text)}& operator=(${1:$(yas-c++-class-name yas-text)} &&other)${22: noexcept}${23:;$(yas-c++-class-method-declare-choice)} + +}$0 + +protected: +private: +}; \ No newline at end of file diff --git a/snippets/c++-ts-mode/cni b/snippets/c++-ts-mode/cni new file mode 100644 index 000000000..e8694d2dd --- /dev/null +++ b/snippets/c++-ts-mode/cni @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: count_if +# key: cni +# -- +auto n = std::count_if(std::begin(${1:container}), std::end($1), []($2) { + $3 +}); +$0 diff --git a/snippets/c++-ts-mode/cnt b/snippets/c++-ts-mode/cnt new file mode 100644 index 000000000..00047989a --- /dev/null +++ b/snippets/c++-ts-mode/cnt @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: count +# key: cnt +# -- +auto n = std::count(std::begin(${1:container}), std::end($1), $2); +$0 diff --git a/snippets/c++-ts-mode/const_[] b/snippets/c++-ts-mode/const_[] new file mode 100644 index 000000000..9c9215a1f --- /dev/null +++ b/snippets/c++-ts-mode/const_[] @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: const_[] +# key: c[ +# -- +const ${1:Name}& operator[](${2:int index}) const +{ + $0 +} \ No newline at end of file diff --git a/snippets/c++-ts-mode/constructor b/snippets/c++-ts-mode/constructor new file mode 100644 index 000000000..bf47065d7 --- /dev/null +++ b/snippets/c++-ts-mode/constructor @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: constructor +# key: ct +# -- +${1:Name}::$1(${2:args}) ${3: : ${4:init}} +{ + $0 +} \ No newline at end of file diff --git a/snippets/c++-ts-mode/cout b/snippets/c++-ts-mode/cout new file mode 100644 index 000000000..e1367fb5d --- /dev/null +++ b/snippets/c++-ts-mode/cout @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# contributor: York Zhao +# name: cout +# key: cout +# -- +`(progn (goto-char (point-min)) (unless (re-search-forward +"^using\\s-+namespace std;" nil 'no-errer) "std::")) +`cout << $0${1:} << "${2:\n}"; diff --git a/snippets/c++-ts-mode/cpb b/snippets/c++-ts-mode/cpb new file mode 100644 index 000000000..0ca826cde --- /dev/null +++ b/snippets/c++-ts-mode/cpb @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: copy_backward +# key: cpb +# -- +std::copy_backward(std::begin(${1:container}), std::end($1), std::end($1)); +$0 diff --git a/snippets/c++-ts-mode/cpi b/snippets/c++-ts-mode/cpi new file mode 100644 index 000000000..4c1771284 --- /dev/null +++ b/snippets/c++-ts-mode/cpi @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# name: copy_if +# key: cpi +# -- +std::copy_if(std::begin(${1:container}), std::end($1), std::begin($2), +[]($3) { + $4 +}); +$0 diff --git a/snippets/c++-ts-mode/cpn b/snippets/c++-ts-mode/cpn new file mode 100644 index 000000000..a96996ea9 --- /dev/null +++ b/snippets/c++-ts-mode/cpn @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: copy_n +# key: cpn +# -- +std::copy_n(std::begin(${1:container}), $2, std::end($1)); +$0 diff --git a/snippets/c++-ts-mode/cpp b/snippets/c++-ts-mode/cpp new file mode 100644 index 000000000..99ea53c4a --- /dev/null +++ b/snippets/c++-ts-mode/cpp @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: cpp +# key: cpp +# -- +#include "`(file-name-nondirectory (file-name-sans-extension (buffer-file-name)))`.h" \ No newline at end of file diff --git a/snippets/c++-ts-mode/cpy b/snippets/c++-ts-mode/cpy new file mode 100644 index 000000000..14b36b6a4 --- /dev/null +++ b/snippets/c++-ts-mode/cpy @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: copy +# key: cpy +# -- +std::copy(std::begin(${1:container}), std::end($1), std::begin($2)); +$0 diff --git a/snippets/c++-ts-mode/cstd b/snippets/c++-ts-mode/cstd new file mode 100644 index 000000000..614887506 --- /dev/null +++ b/snippets/c++-ts-mode/cstd @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: cstd +# key: cstd +# -- +#include \ No newline at end of file diff --git a/snippets/c++-ts-mode/d+= b/snippets/c++-ts-mode/d+= new file mode 100644 index 000000000..791bf1a6c --- /dev/null +++ b/snippets/c++-ts-mode/d+= @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: d+= +# key: d+= +# -- +${1:Name}& operator+=(${2:const $1 &}); \ No newline at end of file diff --git a/snippets/c++-ts-mode/d_operator b/snippets/c++-ts-mode/d_operator new file mode 100644 index 000000000..d23f4d62a --- /dev/null +++ b/snippets/c++-ts-mode/d_operator @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: d_operator<< +# key: << +# -- +friend std::ostream& operator<<(std::ostream&, const ${1:Name}&); \ No newline at end of file diff --git a/snippets/c++-ts-mode/d_operator[] b/snippets/c++-ts-mode/d_operator[] new file mode 100644 index 000000000..92cb6ad2c --- /dev/null +++ b/snippets/c++-ts-mode/d_operator[] @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: d_operator[] +# key: [ +# -- +${1:Name}& operator[](${2:int index}); \ No newline at end of file diff --git a/snippets/c++-ts-mode/d_operator[]_const b/snippets/c++-ts-mode/d_operator[]_const new file mode 100644 index 000000000..fd68238e8 --- /dev/null +++ b/snippets/c++-ts-mode/d_operator[]_const @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: d_operator[]_const +# key: c[ +# -- +const ${1:Name}& operator[](${2:int index}) const; \ No newline at end of file diff --git a/snippets/c++-ts-mode/d_operator_istream b/snippets/c++-ts-mode/d_operator_istream new file mode 100644 index 000000000..d38c0fce0 --- /dev/null +++ b/snippets/c++-ts-mode/d_operator_istream @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: d_operator>> +# key: >> +# -- +friend std::istream& operator>>(std::istream&, const ${1:Name}&); \ No newline at end of file diff --git a/snippets/c++-ts-mode/delete b/snippets/c++-ts-mode/delete new file mode 100644 index 000000000..61119d189 --- /dev/null +++ b/snippets/c++-ts-mode/delete @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: delete +# key: dl +# -- +delete ${1:pointer}; \ No newline at end of file diff --git a/snippets/c++-ts-mode/delete[] b/snippets/c++-ts-mode/delete[] new file mode 100644 index 000000000..69223c2fd --- /dev/null +++ b/snippets/c++-ts-mode/delete[] @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: delete[] +# key: dla +# -- +delete[] ${1:arr}; \ No newline at end of file diff --git a/snippets/c++-ts-mode/doc b/snippets/c++-ts-mode/doc new file mode 100644 index 000000000..b58550ab4 --- /dev/null +++ b/snippets/c++-ts-mode/doc @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: doc +# key: doc +# -- +/** + * $0 + */ \ No newline at end of file diff --git a/snippets/c++-ts-mode/dynamic_casting b/snippets/c++-ts-mode/dynamic_casting new file mode 100644 index 000000000..8a81e1e29 --- /dev/null +++ b/snippets/c++-ts-mode/dynamic_casting @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: dynamic_casting +# key: cast +# -- +check_and_cast<${1:Name} *>(${2:msg}); \ No newline at end of file diff --git a/snippets/c++-ts-mode/enum b/snippets/c++-ts-mode/enum new file mode 100644 index 000000000..7b22035ea --- /dev/null +++ b/snippets/c++-ts-mode/enum @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: enum +# key: enum +# -- +enum ${1:NAME}{ +$0 +}; \ No newline at end of file diff --git a/snippets/c++-ts-mode/eql b/snippets/c++-ts-mode/eql new file mode 100644 index 000000000..01368cc89 --- /dev/null +++ b/snippets/c++-ts-mode/eql @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: equal +# key: eql +# -- +if (std::equal(std::begin(${1:container}), std::end($1), std::begin($2))) { + $3 +} +$0 diff --git a/snippets/c++-ts-mode/erm b/snippets/c++-ts-mode/erm new file mode 100644 index 000000000..16b8f36bd --- /dev/null +++ b/snippets/c++-ts-mode/erm @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: remove +# key: erm +# -- +${1:container}.erase(std::remove(std::begin($1), std::end($1), $2), std::end($1)); +$0 diff --git a/snippets/c++-ts-mode/ffo b/snippets/c++-ts-mode/ffo new file mode 100644 index 000000000..36c689453 --- /dev/null +++ b/snippets/c++-ts-mode/ffo @@ -0,0 +1,10 @@ +# -*- mode: snippet -*- +# name: find_first_of +# key: ffo +# -- +auto pos = std::find_first_of(std::begin(${1:container}), std::end($1), + std::begin($2), std::end($3)); +if (pos != std::end($1)) { + $4 +} +$0 diff --git a/snippets/c++-ts-mode/fil b/snippets/c++-ts-mode/fil new file mode 100644 index 000000000..12d065a0b --- /dev/null +++ b/snippets/c++-ts-mode/fil @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: fill +# key: fil +# -- +std::fill(std::begin(${1:container}), std::end($1), $2); +$0 diff --git a/snippets/c++-ts-mode/fin b/snippets/c++-ts-mode/fin new file mode 100644 index 000000000..41eaf6c79 --- /dev/null +++ b/snippets/c++-ts-mode/fin @@ -0,0 +1,11 @@ +# -*- mode: snippet -*- +# name: find_if_not +# key: fin +# -- +auto pos = std::find_if_not(std::begin(${1:container}), std::end($1),[]($2) { + $3 +}); +if (pos != std::end($1)) { + $4 +} +$0 diff --git a/snippets/c++-ts-mode/fixture b/snippets/c++-ts-mode/fixture new file mode 100644 index 000000000..1a25aee95 --- /dev/null +++ b/snippets/c++-ts-mode/fixture @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# name: fixture +# key: fixt +# -- +BOOST_FIXTURE_TEST_SUITE( ${1:name}, ${2:Fixture} ) + +$0 + +BOOST_AUTO_TEST_SUITE_END() \ No newline at end of file diff --git a/snippets/c++-ts-mode/fln b/snippets/c++-ts-mode/fln new file mode 100644 index 000000000..ef2028a0d --- /dev/null +++ b/snippets/c++-ts-mode/fln @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: fill_n +# key: fln +# -- +std::fill_n(std::begin(${1:container}), $2, $3); +$0 diff --git a/snippets/c++-ts-mode/fnd b/snippets/c++-ts-mode/fnd new file mode 100644 index 000000000..6009138d5 --- /dev/null +++ b/snippets/c++-ts-mode/fnd @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# name: find +# key: fnd +# -- +auto pos = std::find(std::begin(${1:container}), std::end($1), $2); +if (pos != std::end($1)) { + $3 +} +$0 diff --git a/snippets/c++-ts-mode/fne b/snippets/c++-ts-mode/fne new file mode 100644 index 000000000..7f27e7a44 --- /dev/null +++ b/snippets/c++-ts-mode/fne @@ -0,0 +1,10 @@ +# -*- mode: snippet -*- +# name: find_end +# key: fne +# -- +auto pos = std::find_std::end(std::begin(${1:container}), std::end($1), + std::begin($2), std::end($3)); +if (pos != std::end($1)) { + $4 +} +$0 diff --git a/snippets/c++-ts-mode/fni b/snippets/c++-ts-mode/fni new file mode 100644 index 000000000..de0a6e85f --- /dev/null +++ b/snippets/c++-ts-mode/fni @@ -0,0 +1,11 @@ +# -*- mode: snippet -*- +# name: find_if +# key: fni +# -- +auto pos = std::find_if(std::begin(${1:container}), std::end($1), []($2) { + $3 +}); +if (pos != std::end($1)) { + $4 +} +$0 diff --git a/snippets/c++-ts-mode/fori b/snippets/c++-ts-mode/fori new file mode 100644 index 000000000..7676a8954 --- /dev/null +++ b/snippets/c++-ts-mode/fori @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: fori +# key: fori +# -- +for (${1:auto }${2:it} = ${3:var}.begin(); $2 != $3.end(); ++$2) { + $0 +} \ No newline at end of file diff --git a/snippets/c++-ts-mode/forr b/snippets/c++-ts-mode/forr new file mode 100644 index 000000000..685b97edb --- /dev/null +++ b/snippets/c++-ts-mode/forr @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: for range +# key: forr +# -- +for (${1:type} ${2:name} : ${3:containerName}) { + $0 +} \ No newline at end of file diff --git a/snippets/c++-ts-mode/fre b/snippets/c++-ts-mode/fre new file mode 100644 index 000000000..09d1a78c8 --- /dev/null +++ b/snippets/c++-ts-mode/fre @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: for_each +# key: fre +# -- +std::for_each(std::begin(${1:container}), std::end($1), []($2) { + $3 +}); +$0 diff --git a/snippets/c++-ts-mode/friend b/snippets/c++-ts-mode/friend new file mode 100644 index 000000000..d3c9009b3 --- /dev/null +++ b/snippets/c++-ts-mode/friend @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: friend +# key: fr +# -- +friend $0; \ No newline at end of file diff --git a/snippets/c++-ts-mode/fun_declaration b/snippets/c++-ts-mode/fun_declaration new file mode 100644 index 000000000..03184dc7c --- /dev/null +++ b/snippets/c++-ts-mode/fun_declaration @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: fun_declaration +# key: f +# -- +${1:type} ${2:name}(${3:args})${4: const}; \ No newline at end of file diff --git a/snippets/c++-ts-mode/gnn b/snippets/c++-ts-mode/gnn new file mode 100644 index 000000000..b3b74b526 --- /dev/null +++ b/snippets/c++-ts-mode/gnn @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: generate_n +# key: gnn +# -- +std::generate_n(std::begin(${1:container}), $2, []($3) { + $4 +}); +$0 diff --git a/snippets/c++-ts-mode/gnr b/snippets/c++-ts-mode/gnr new file mode 100644 index 000000000..e48e7c155 --- /dev/null +++ b/snippets/c++-ts-mode/gnr @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: generate +# key: gnr +# -- +std::generate(std::begin(${1:container}), std::end($1), []($2) { + $3 +}); +$0 diff --git a/snippets/c++-ts-mode/gtest b/snippets/c++-ts-mode/gtest new file mode 100644 index 000000000..8ba9c575f --- /dev/null +++ b/snippets/c++-ts-mode/gtest @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: gtest +# key: gtest +# group: testing +# -- +#include \ No newline at end of file diff --git a/snippets/c++-ts-mode/ignore b/snippets/c++-ts-mode/ignore new file mode 100644 index 000000000..ac4085db7 --- /dev/null +++ b/snippets/c++-ts-mode/ignore @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: ignore +# key: ignore +# -- +${1:std::}cin.ignore(std::numeric_limits::max(), '\n'); \ No newline at end of file diff --git a/snippets/c++-ts-mode/ihp b/snippets/c++-ts-mode/ihp new file mode 100644 index 000000000..bf975b9bd --- /dev/null +++ b/snippets/c++-ts-mode/ihp @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: is_heap +# key: ihp +# -- +if (std::is_heap(std::begin(${1:container}), std::end($1))) { + $2 +} +$0 diff --git a/snippets/c++-ts-mode/ihu b/snippets/c++-ts-mode/ihu new file mode 100644 index 000000000..765508e67 --- /dev/null +++ b/snippets/c++-ts-mode/ihu @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# name: is_heap_until +# key: ihu +# -- +auto pos = std::is_heap_until(std::begin(${1:container}), std::end($1)); +if (pos != std::end($1)) { + $2 +} +$0 diff --git a/snippets/c++-ts-mode/inline b/snippets/c++-ts-mode/inline new file mode 100644 index 000000000..da5c320c1 --- /dev/null +++ b/snippets/c++-ts-mode/inline @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: inline +# key: il +# -- +inline $0 \ No newline at end of file diff --git a/snippets/c++-ts-mode/io b/snippets/c++-ts-mode/io new file mode 100644 index 000000000..1355dac9f --- /dev/null +++ b/snippets/c++-ts-mode/io @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: io +# key: io +# -- +#include \ No newline at end of file diff --git a/snippets/c++-ts-mode/ipr b/snippets/c++-ts-mode/ipr new file mode 100644 index 000000000..c7ffd71de --- /dev/null +++ b/snippets/c++-ts-mode/ipr @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: is_permutation +# key: ipr +# -- +if (std::is_permutation(std::begin(${1:container}), std::end($1), std::begin($2))) { + $3 +} +$0 diff --git a/snippets/c++-ts-mode/ipt b/snippets/c++-ts-mode/ipt new file mode 100644 index 000000000..b7a150977 --- /dev/null +++ b/snippets/c++-ts-mode/ipt @@ -0,0 +1,10 @@ +# -*- mode: snippet -*- +# name: is_partitioned +# key: ipt +# -- +if (std::is_partitioned(std::begin(${1:container}), std::end($1), []($2) { + $3 +})) { + $4 +} +$0 diff --git a/snippets/c++-ts-mode/iss b/snippets/c++-ts-mode/iss new file mode 100644 index 000000000..11c4cf05e --- /dev/null +++ b/snippets/c++-ts-mode/iss @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: is_sorted +# key: iss +# -- +if (std::is_sorted(std::begin(${1:container}), std::end($1))) { + $2 +} +$0 diff --git a/snippets/c++-ts-mode/isu b/snippets/c++-ts-mode/isu new file mode 100644 index 000000000..0c443ff4d --- /dev/null +++ b/snippets/c++-ts-mode/isu @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# name: is_sorted_until +# key: isu +# -- +auto pos = std::is_sorted_until(std::begin(${1:container}), std::end($1)); +if (pos != std::end($1)) { + $2 +} +$0 diff --git a/snippets/c++-ts-mode/ita b/snippets/c++-ts-mode/ita new file mode 100644 index 000000000..45da1bc91 --- /dev/null +++ b/snippets/c++-ts-mode/ita @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: iota +# key: ita +# -- +std::iota(std::begin(${1:container}), std::end($1), $2); +$0 diff --git a/snippets/c++-ts-mode/iterator b/snippets/c++-ts-mode/iterator new file mode 100644 index 000000000..1aad629d5 --- /dev/null +++ b/snippets/c++-ts-mode/iterator @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: iterator +# key: iter +# -- +${1:std::}${2:vector}::iterator ${3:iter}; diff --git a/snippets/c++-ts-mode/lambda b/snippets/c++-ts-mode/lambda new file mode 100644 index 000000000..d7ade5b3f --- /dev/null +++ b/snippets/c++-ts-mode/lambda @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: lambda +# key: lambda +# -- +[${1:capture clause}](${2:parameters}) { + $0 +} \ No newline at end of file diff --git a/snippets/c++-ts-mode/ltr b/snippets/c++-ts-mode/ltr new file mode 100644 index 000000000..0c2168519 --- /dev/null +++ b/snippets/c++-ts-mode/ltr @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: remove whitespace at beginning +# key: ltr +# -- +${1:container}.erase(0, $1.find_first_not_of(" \t\n\r")); +$0 diff --git a/snippets/c++-ts-mode/lwr b/snippets/c++-ts-mode/lwr new file mode 100644 index 000000000..5d4f566f0 --- /dev/null +++ b/snippets/c++-ts-mode/lwr @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: string to lower case +# key: lwr +# -- +std::transform(std::begin(${1:container}), std::end($1), std::begin($1), [](char c) { +return std::tolower(c);}); +$0 diff --git a/snippets/c++-ts-mode/lxc b/snippets/c++-ts-mode/lxc new file mode 100644 index 000000000..d60c1e50e --- /dev/null +++ b/snippets/c++-ts-mode/lxc @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# name: lexigraphical_compare +# key: lxc +# -- +if (std::lexigraphical_compare(std::begin(${1:container}), std::end($1), + std::begin($2), std::end($3)) { + $4 +} +$0 diff --git a/snippets/c++-ts-mode/map b/snippets/c++-ts-mode/map new file mode 100644 index 000000000..17ed9ae1d --- /dev/null +++ b/snippets/c++-ts-mode/map @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: map +# key: map +# -- +std::map<${1:type1}$0> ${2:var}; \ No newline at end of file diff --git a/snippets/c++-ts-mode/member_function b/snippets/c++-ts-mode/member_function new file mode 100644 index 000000000..ccc03fdcd --- /dev/null +++ b/snippets/c++-ts-mode/member_function @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: member_function +# key: mf +# -- +${1:type} ${2:Name}::${3:name}(${4:args})${5: const} +{ + $0 +} diff --git a/snippets/c++-ts-mode/mkh b/snippets/c++-ts-mode/mkh new file mode 100644 index 000000000..9d5061449 --- /dev/null +++ b/snippets/c++-ts-mode/mkh @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: make_heap +# key: mkh +# -- +std::make_heap(std::begin(${1:container}), std::end($1)); +$0 diff --git a/snippets/c++-ts-mode/mme b/snippets/c++-ts-mode/mme new file mode 100644 index 000000000..e40fa074c --- /dev/null +++ b/snippets/c++-ts-mode/mme @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: minmax_element +# key: mme +# -- +auto minmax = std::minmax_element(std::begin(${1:container}), std::end($1)); +$0 diff --git a/snippets/c++-ts-mode/mne b/snippets/c++-ts-mode/mne new file mode 100644 index 000000000..0491705b1 --- /dev/null +++ b/snippets/c++-ts-mode/mne @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: min_element +# key: mne +# -- +auto pos = std::min_element(std::begin(${1:container}), std::end($1)); +$0 diff --git a/snippets/c++-ts-mode/module b/snippets/c++-ts-mode/module new file mode 100644 index 000000000..9155d5bef --- /dev/null +++ b/snippets/c++-ts-mode/module @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: module +# key: mod +# -- +class ${1:Name} : public cSimpleModule +{ + $0 +} \ No newline at end of file diff --git a/snippets/c++-ts-mode/mpb b/snippets/c++-ts-mode/mpb new file mode 100644 index 000000000..4ca0b091b --- /dev/null +++ b/snippets/c++-ts-mode/mpb @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: move_backward +# key: mpb +# -- +std::move_backward(std::begin(${1:container}), std::end($1), std::end($1)); +$0 diff --git a/snippets/c++-ts-mode/mrg b/snippets/c++-ts-mode/mrg new file mode 100644 index 000000000..d6bbc71a6 --- /dev/null +++ b/snippets/c++-ts-mode/mrg @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: merge +# key: mrg +# -- +std::merge(std::begin(${1:container}), std::end($1), +std::begin($2), std::end($3), std::begin($4)); +$0 diff --git a/snippets/c++-ts-mode/msm b/snippets/c++-ts-mode/msm new file mode 100644 index 000000000..6c729f696 --- /dev/null +++ b/snippets/c++-ts-mode/msm @@ -0,0 +1,11 @@ +# -*- mode: snippet -*- +# name: mismatch +# key: msm +# -- +auto values = std::mismatch(std::begin(${1:container}), std::end($1), std::begin($1)); +if (values.first == std::end($1)) { + $2 +} else { + $3 +} +$0 diff --git a/snippets/c++-ts-mode/mxe b/snippets/c++-ts-mode/mxe new file mode 100644 index 000000000..a2ffea452 --- /dev/null +++ b/snippets/c++-ts-mode/mxe @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: max_element +# key: mxe +# -- +auto pos = std::max_element(std::begin(${1:container}), std::end($1)); +$0 diff --git a/snippets/c++-ts-mode/namespace b/snippets/c++-ts-mode/namespace new file mode 100644 index 000000000..5f702d891 --- /dev/null +++ b/snippets/c++-ts-mode/namespace @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# name: namespace +# key: ns +# -- +namespace ${1:Namespace} { + + `yas/selected-text` + +} // $1 \ No newline at end of file diff --git a/snippets/c++-ts-mode/nno b/snippets/c++-ts-mode/nno new file mode 100644 index 000000000..43727827c --- /dev/null +++ b/snippets/c++-ts-mode/nno @@ -0,0 +1,10 @@ +# -*- mode: snippet -*- +# name: none_of +# key: nno +# -- +if (std::none_of(std::begin(${1:container}), std::end($1), []($2) { + $3 +})) { + $4 +} +$0 diff --git a/snippets/c++-ts-mode/ns b/snippets/c++-ts-mode/ns new file mode 100644 index 000000000..7d4b336ef --- /dev/null +++ b/snippets/c++-ts-mode/ns @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: namespace ... +# key: ns +# -- +namespace \ No newline at end of file diff --git a/snippets/c++-ts-mode/nth b/snippets/c++-ts-mode/nth new file mode 100644 index 000000000..e0c0fbaf8 --- /dev/null +++ b/snippets/c++-ts-mode/nth @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: nth_element +# key: nth +# -- +std::nth_element(std::begin(${1:container}), std::end($1), std::end($1)); +$0 diff --git a/snippets/c++-ts-mode/nxp b/snippets/c++-ts-mode/nxp new file mode 100644 index 000000000..46ece1e2c --- /dev/null +++ b/snippets/c++-ts-mode/nxp @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: next_permutation +# key: nxp +# -- +if (std::next_permutation(std::begin(${1:container}), std::end($1))) { + $2 +} +$0 diff --git a/snippets/c++-ts-mode/operator!= b/snippets/c++-ts-mode/operator!= new file mode 100644 index 000000000..f0c133fa1 --- /dev/null +++ b/snippets/c++-ts-mode/operator!= @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# name: operator!= +# key: != +# group: operator overloading +# -- +bool ${1:Name}::operator!=(const $1 &other) const +{ + return !(*this == other); +} \ No newline at end of file diff --git a/snippets/c++-ts-mode/operator+ b/snippets/c++-ts-mode/operator+ new file mode 100644 index 000000000..3dfa8fc5e --- /dev/null +++ b/snippets/c++-ts-mode/operator+ @@ -0,0 +1,11 @@ +# -*- mode: snippet -*- +# name: operator+ +# key: + +# group: operator overloading +# -- +${1:Name} $1::operator+(const $1 &other) +{ + $1 result = *this; + result += other; + return result; +} \ No newline at end of file diff --git a/snippets/c++-ts-mode/operator+= b/snippets/c++-ts-mode/operator+= new file mode 100644 index 000000000..c038cd97d --- /dev/null +++ b/snippets/c++-ts-mode/operator+= @@ -0,0 +1,10 @@ +# -*- mode: snippet -*- +# name: operator+= +# key: += +# group: operator overloading +# -- +${1:Name}& $1::operator+=(${2:const $1 &rhs}) +{ + $0 + return *this; +} \ No newline at end of file diff --git a/snippets/c++-ts-mode/operator= b/snippets/c++-ts-mode/operator= new file mode 100644 index 000000000..e376d5c7a --- /dev/null +++ b/snippets/c++-ts-mode/operator= @@ -0,0 +1,14 @@ +# -*- mode: snippet -*- +# name: operator= +# key: = +# where this is a reference to myself +# group: operator overloading +# -- +${1:Name}& $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/snippets/c++-ts-mode/operator== b/snippets/c++-ts-mode/operator== new file mode 100644 index 000000000..bdc3266b8 --- /dev/null +++ b/snippets/c++-ts-mode/operator== @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# name: operator== +# key: == +# group: operator overloading +# -- +bool ${1:Name}::operator==(const $1 &other) const +{ + $0 +} \ No newline at end of file diff --git a/snippets/c++-ts-mode/operator[] b/snippets/c++-ts-mode/operator[] new file mode 100644 index 000000000..ad97ce0b7 --- /dev/null +++ b/snippets/c++-ts-mode/operator[] @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# name: operator[] +# key: [] +# group: operator overloading +# -- +${1:Name}& operator[](${2:int index}) +{ + $0 +} \ No newline at end of file diff --git a/snippets/c++-ts-mode/operator_istream b/snippets/c++-ts-mode/operator_istream new file mode 100644 index 000000000..1de0ae0ea --- /dev/null +++ b/snippets/c++-ts-mode/operator_istream @@ -0,0 +1,10 @@ +# -*- mode: snippet -*- +# name: operator>> +# key: >> +# group: operator overloading +# -- +std::istream& operator>>(std::istream& is, const ${1:Name}& ${2:c}) +{ + $0 + return is; +} \ No newline at end of file diff --git a/snippets/c++-ts-mode/operator_ostream b/snippets/c++-ts-mode/operator_ostream new file mode 100644 index 000000000..d23bedaca --- /dev/null +++ b/snippets/c++-ts-mode/operator_ostream @@ -0,0 +1,10 @@ +# -*- mode: snippet -*- +# name: operator<< +# key: << +# group: operator overloading +# -- +std::ostream& operator<<(std::ostream& os, const ${1:Name}& ${2:c}) +{ + $0 + return os; +} \ No newline at end of file diff --git a/snippets/c++-ts-mode/ostream b/snippets/c++-ts-mode/ostream new file mode 100644 index 000000000..9371338db --- /dev/null +++ b/snippets/c++-ts-mode/ostream @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: ostream +# key: os +# -- +#include \ No newline at end of file diff --git a/snippets/c++-ts-mode/pack b/snippets/c++-ts-mode/pack new file mode 100644 index 000000000..5172bb969 --- /dev/null +++ b/snippets/c++-ts-mode/pack @@ -0,0 +1,10 @@ +# -*- mode: snippet -*- +# name: pack +# key: pack +# -- +void cNetCommBuffer::pack(${1:type}) +{ + +} + +$0 \ No newline at end of file diff --git a/snippets/c++-ts-mode/phh b/snippets/c++-ts-mode/phh new file mode 100644 index 000000000..4527265b5 --- /dev/null +++ b/snippets/c++-ts-mode/phh @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: push_heap +# key: phh +# -- +std::push_heap(std::begin(${1:container}), std::end($1)); +$0 diff --git a/snippets/c++-ts-mode/ppt b/snippets/c++-ts-mode/ppt new file mode 100644 index 000000000..fc05481a3 --- /dev/null +++ b/snippets/c++-ts-mode/ppt @@ -0,0 +1,11 @@ +# -*- mode: snippet -*- +# name: partition_point +# key: ppt +# -- +auto pos = std::partition_point(std::begin(${1:container}), std::end($1), []($2) { + $3 +}); +if (pos != std::end($1)) { + $4 +} +$0 diff --git a/snippets/c++-ts-mode/private b/snippets/c++-ts-mode/private new file mode 100644 index 000000000..bba11e496 --- /dev/null +++ b/snippets/c++-ts-mode/private @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: private +# key: pr +# expand-env: ((yas-also-auto-indent-first-line t)) +# -- +private: + $0 \ No newline at end of file diff --git a/snippets/c++-ts-mode/protected b/snippets/c++-ts-mode/protected new file mode 100644 index 000000000..9553957f6 --- /dev/null +++ b/snippets/c++-ts-mode/protected @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: protected +# key: pt +# expand-env: ((yas-also-auto-indent-first-line t)) +# -- +protected: + $0 \ No newline at end of file diff --git a/snippets/c++-ts-mode/prp b/snippets/c++-ts-mode/prp new file mode 100644 index 000000000..a94f0e931 --- /dev/null +++ b/snippets/c++-ts-mode/prp @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: prev_permutation +# key: prp +# -- +if (std::prev_permutation(std::begin(${1:container}), std::end($1))) { + $2 +} +$0 diff --git a/snippets/c++-ts-mode/psc b/snippets/c++-ts-mode/psc new file mode 100644 index 000000000..ad8ff4272 --- /dev/null +++ b/snippets/c++-ts-mode/psc @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: partial_sort_copy +# key: psc +# -- +std::partial_sort_copy(std::begin(${1:container}), std::end($1), + std::begin($2), std::end($3)); +$0 diff --git a/snippets/c++-ts-mode/pst b/snippets/c++-ts-mode/pst new file mode 100644 index 000000000..e7287e2c3 --- /dev/null +++ b/snippets/c++-ts-mode/pst @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: partial_sort +# key: pst +# -- +std::partial_sort(std::begin(${1:container}), std::end($1), std::end($1)); +$0 diff --git a/snippets/c++-ts-mode/ptc b/snippets/c++-ts-mode/ptc new file mode 100644 index 000000000..dcd7e386b --- /dev/null +++ b/snippets/c++-ts-mode/ptc @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: partition_copy +# key: ptc +# -- +std::partition_copy(std::begin(${1:container}), std::end($1), + std::begin($2), std::end($3)); +$0 diff --git a/snippets/c++-ts-mode/ptn b/snippets/c++-ts-mode/ptn new file mode 100644 index 000000000..44f3c42fd --- /dev/null +++ b/snippets/c++-ts-mode/ptn @@ -0,0 +1,11 @@ +# -*- mode: snippet -*- +# name: partition +# key: ptn +# -- +auto pos = std::partition(std::begin(${1:container}), std::end($1), []($2) { + $3 +}); +if (pos != std::end($1)) { + $4 +} +$0 diff --git a/snippets/c++-ts-mode/public b/snippets/c++-ts-mode/public new file mode 100644 index 000000000..eea5b349a --- /dev/null +++ b/snippets/c++-ts-mode/public @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: public +# key: pb +# expand-env: ((yas-also-auto-indent-first-line t)) +# -- +public: + $0 \ No newline at end of file diff --git a/snippets/c++-ts-mode/rci b/snippets/c++-ts-mode/rci new file mode 100644 index 000000000..114925516 --- /dev/null +++ b/snippets/c++-ts-mode/rci @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# name: replace_copy_if +# key: rci +# -- +std::replace_copy_if(std::begin(${1:container}), std::end($1), + std::begin($1), []($2) { + $3 +}, $4); +$0 diff --git a/snippets/c++-ts-mode/rmc b/snippets/c++-ts-mode/rmc new file mode 100644 index 000000000..681c10b18 --- /dev/null +++ b/snippets/c++-ts-mode/rmc @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: remove_copy +# key: rmc +# -- +std::remove_copy(std::begin(${1:container}), std::end($1), + std::begin($1), $2); +$0 diff --git a/snippets/c++-ts-mode/rmf b/snippets/c++-ts-mode/rmf new file mode 100644 index 000000000..c1713ffe0 --- /dev/null +++ b/snippets/c++-ts-mode/rmf @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# name: remove_copy_if +# key: rmf +# -- +std::remove_copy_if(std::begin(${1:container}), std::end($1), + std::begin($1), []($2) { + $3 +}); +$0 diff --git a/snippets/c++-ts-mode/rmi b/snippets/c++-ts-mode/rmi new file mode 100644 index 000000000..c78f9266e --- /dev/null +++ b/snippets/c++-ts-mode/rmi @@ -0,0 +1,11 @@ +# -*- mode: snippet -*- +# name: remove_if +# key: rmi +# -- +auto pos = std::remove_if(std::begin(${1:container}), std::end($1), []($2) { + $3 +}); +if (pos != std::end($1)) { + $4 +} +$0 diff --git a/snippets/c++-ts-mode/rpc b/snippets/c++-ts-mode/rpc new file mode 100644 index 000000000..a4116f1a3 --- /dev/null +++ b/snippets/c++-ts-mode/rpc @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: replace_copy +# key: rpc +# -- +std::replace_copy(std::begin(${1:container}), std::end($1), std::begin($1), $2, $3); +$0 diff --git a/snippets/c++-ts-mode/rpi b/snippets/c++-ts-mode/rpi new file mode 100644 index 000000000..bc96c47d2 --- /dev/null +++ b/snippets/c++-ts-mode/rpi @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: replace_if +# key: rpi +# -- +std::replace_if(std::begin(${1:container}), std::end($1), []($2) { +$3 +}, $4); +$0 diff --git a/snippets/c++-ts-mode/rpl b/snippets/c++-ts-mode/rpl new file mode 100644 index 000000000..9badf4bee --- /dev/null +++ b/snippets/c++-ts-mode/rpl @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: replace +# key: rpl +# -- +std::replace(std::begin(${1:container}), std::end($1), $2, $3); +$0 diff --git a/snippets/c++-ts-mode/rtc b/snippets/c++-ts-mode/rtc new file mode 100644 index 000000000..373f85dc7 --- /dev/null +++ b/snippets/c++-ts-mode/rtc @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: rotate_copy +# key: rtc +# -- +std::rotate_copy(std::begin(${1:container}), std::begin($2), std::end($1), + std::begin($3)); +$0 diff --git a/snippets/c++-ts-mode/rte b/snippets/c++-ts-mode/rte new file mode 100644 index 000000000..a098782bf --- /dev/null +++ b/snippets/c++-ts-mode/rte @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: rotate +# key: rte +# -- +std::rotate(std::begin(${1:container}), std::begin($2), std::end($1)); +$0 diff --git a/snippets/c++-ts-mode/rvc b/snippets/c++-ts-mode/rvc new file mode 100644 index 000000000..2e4618dd1 --- /dev/null +++ b/snippets/c++-ts-mode/rvc @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: reverse_copy +# key: rvc +# -- +std::reverse_copy(std::begin(${1:container}), std::end($1), std::begin($2)); +$0 diff --git a/snippets/c++-ts-mode/rvr b/snippets/c++-ts-mode/rvr new file mode 100644 index 000000000..71d00c564 --- /dev/null +++ b/snippets/c++-ts-mode/rvr @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: reverse +# key: rvr +# -- +std::reverse(std::begin(${1:container}), std::end($1)); +$0 diff --git a/snippets/c++-ts-mode/shf b/snippets/c++-ts-mode/shf new file mode 100644 index 000000000..ef7adb19f --- /dev/null +++ b/snippets/c++-ts-mode/shf @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: random_shuffle +# key: shf +# -- +std::random_shuffle(std::begin(${1:container}), std::end($1)); +$0 diff --git a/snippets/c++-ts-mode/spt b/snippets/c++-ts-mode/spt new file mode 100644 index 000000000..40ef2c882 --- /dev/null +++ b/snippets/c++-ts-mode/spt @@ -0,0 +1,10 @@ +# -*- mode: snippet -*- +# name: stable_partition +# key: spt +# -- +auto pos = std::stable_partition(std::begin(${1:container}), std::end($1), []($2) { + $3}); +if (pos != std::end($1)) { + $4 +} +$0 diff --git a/snippets/c++-ts-mode/srh b/snippets/c++-ts-mode/srh new file mode 100644 index 000000000..2c9df5987 --- /dev/null +++ b/snippets/c++-ts-mode/srh @@ -0,0 +1,10 @@ +# -*- mode: snippet -*- +# name: search +# key: srh +# -- +auto pos = std::search(std::begin(${1:container}), std::end($1), + std::begin($2), std::end($3)); +if (pos != std::end($1)) { + $4 +} +$0 diff --git a/snippets/c++-ts-mode/srn b/snippets/c++-ts-mode/srn new file mode 100644 index 000000000..c7d929d15 --- /dev/null +++ b/snippets/c++-ts-mode/srn @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# name: search_n +# key: srn +# -- +auto pos = std::search_n(std::begin(${1:container}), std::end($1),$2,$3); +if (pos != std::end($1)) { + $4 +} +$0 diff --git a/snippets/c++-ts-mode/srt b/snippets/c++-ts-mode/srt new file mode 100644 index 000000000..8d44cfdb8 --- /dev/null +++ b/snippets/c++-ts-mode/srt @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: sort +# key: srt +# -- +std::sort(std::begin(${1:container}), std::end($1)); +$0 diff --git a/snippets/c++-ts-mode/sstream b/snippets/c++-ts-mode/sstream new file mode 100644 index 000000000..738fd11ed --- /dev/null +++ b/snippets/c++-ts-mode/sstream @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: +# key: ss +# -- +#include \ No newline at end of file diff --git a/snippets/c++-ts-mode/std b/snippets/c++-ts-mode/std new file mode 100644 index 000000000..04d87720b --- /dev/null +++ b/snippets/c++-ts-mode/std @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: std +# key: std +# -- +using namespace std; \ No newline at end of file diff --git a/snippets/c++-ts-mode/std_colon b/snippets/c++-ts-mode/std_colon new file mode 100644 index 000000000..d9ea8e7ec --- /dev/null +++ b/snippets/c++-ts-mode/std_colon @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: std:: +# key: st +# -- +std::$0 \ No newline at end of file diff --git a/snippets/c++-ts-mode/sth b/snippets/c++-ts-mode/sth new file mode 100644 index 000000000..c8e6fb1dc --- /dev/null +++ b/snippets/c++-ts-mode/sth @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: sort_heap +# key: sth +# -- +std::sort_heap(std::begin(${1:container}), std::end($1)); +$0 diff --git a/snippets/c++-ts-mode/str b/snippets/c++-ts-mode/str new file mode 100644 index 000000000..95b865cba --- /dev/null +++ b/snippets/c++-ts-mode/str @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: str +# key: str +# -- +#include \ No newline at end of file diff --git a/snippets/c++-ts-mode/sts b/snippets/c++-ts-mode/sts new file mode 100644 index 000000000..a5c4d1205 --- /dev/null +++ b/snippets/c++-ts-mode/sts @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: stable_sort +# key: sts +# -- +std::stable_sort(std::begin(${1:container}), std::end($1)); +$0 diff --git a/snippets/c++-ts-mode/swr b/snippets/c++-ts-mode/swr new file mode 100644 index 000000000..93575785f --- /dev/null +++ b/snippets/c++-ts-mode/swr @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: swap_ranges +# key: swr +# -- +std::swap_ranges(std::begin(${1:container}), std::end($1), std::begin($2)); +$0 diff --git a/snippets/c++-ts-mode/template b/snippets/c++-ts-mode/template new file mode 100644 index 000000000..64814b83e --- /dev/null +++ b/snippets/c++-ts-mode/template @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: template +# key: temp +# -- +template<${1:$$(yas/choose-value '("typename" "class"))} ${2:T}> +$0 \ No newline at end of file diff --git a/snippets/c++-ts-mode/test case b/snippets/c++-ts-mode/test case new file mode 100644 index 000000000..4977ae86c --- /dev/null +++ b/snippets/c++-ts-mode/test case @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# name: test case +# key: tc +# group: testing +# -- +BOOST_AUTO_TEST_CASE( ${1:test_case} ) +{ + $0 +} \ No newline at end of file diff --git a/snippets/c++-ts-mode/test_main b/snippets/c++-ts-mode/test_main new file mode 100644 index 000000000..9321cf3ce --- /dev/null +++ b/snippets/c++-ts-mode/test_main @@ -0,0 +1,10 @@ +# -*- mode: snippet -*- +# name: test_main +# key: test_main +# group: testing +# -- +int main(int argc, char **argv) +{ + ::testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +} \ No newline at end of file diff --git a/snippets/c++-ts-mode/test_suite b/snippets/c++-ts-mode/test_suite new file mode 100644 index 000000000..84d0f469c --- /dev/null +++ b/snippets/c++-ts-mode/test_suite @@ -0,0 +1,10 @@ +# -*- mode: snippet -*- +# name: test_suite +# key: ts +# group: testing +# -- +BOOST_AUTO_TEST_SUITE( ${1:test_suite1} ) + +$0 + +BOOST_AUTO_TEST_SUITE_END() \ No newline at end of file diff --git a/snippets/c++-ts-mode/tfm b/snippets/c++-ts-mode/tfm new file mode 100644 index 000000000..12d48816e --- /dev/null +++ b/snippets/c++-ts-mode/tfm @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# name: transform +# key: tfm +# -- +std::transform(std::begin(${1:container}), std::end($1), + std::begin($1), []($2) { +$3% +}); +$0 diff --git a/snippets/c++-ts-mode/this b/snippets/c++-ts-mode/this new file mode 100644 index 000000000..5c7e6a3c3 --- /dev/null +++ b/snippets/c++-ts-mode/this @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: this +# key: th +# -- +this \ No newline at end of file diff --git a/snippets/c++-ts-mode/throw b/snippets/c++-ts-mode/throw new file mode 100644 index 000000000..95616dbaa --- /dev/null +++ b/snippets/c++-ts-mode/throw @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: throw +# key: throw +# -- +throw ${1:MyError}($0); \ No newline at end of file diff --git a/snippets/c++-ts-mode/try b/snippets/c++-ts-mode/try new file mode 100644 index 000000000..f44c67f87 --- /dev/null +++ b/snippets/c++-ts-mode/try @@ -0,0 +1,10 @@ +# -*- mode: snippet -*- +# name: try +# key: try +# a bit too intrusive now still, not always I want to do this +# -- +try { + $0 +} catch (${1:type}) { + +} diff --git a/snippets/c++-ts-mode/tryw b/snippets/c++-ts-mode/tryw new file mode 100644 index 000000000..cf61928ce --- /dev/null +++ b/snippets/c++-ts-mode/tryw @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# name: tryw +# key: tryw +# -- +try { + `(or yas/selected-text (car kill-ring))` +} catch ${1:Exception} { + +} diff --git a/snippets/c++-ts-mode/ucp b/snippets/c++-ts-mode/ucp new file mode 100644 index 000000000..1dc71ff4c --- /dev/null +++ b/snippets/c++-ts-mode/ucp @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: unique_copy +# key: ucp +# -- +std::unique_copy(std::begin(${1:container}), std::end($1), + std::ostream_iterator(std::cout, "\n")); +$0 diff --git a/snippets/c++-ts-mode/uqe b/snippets/c++-ts-mode/uqe new file mode 100644 index 000000000..c35ff16e4 --- /dev/null +++ b/snippets/c++-ts-mode/uqe @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: unique +# key: uqe +# -- +auto pos = std::unique(std::begin(${1:container}), std::end($1)); +$0 diff --git a/snippets/c++-ts-mode/using b/snippets/c++-ts-mode/using new file mode 100644 index 000000000..1feb8cc06 --- /dev/null +++ b/snippets/c++-ts-mode/using @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: using namespace ... +# key: using +# -- +using namespace ${std}; +$0 \ No newline at end of file diff --git a/snippets/c++-ts-mode/vector b/snippets/c++-ts-mode/vector new file mode 100644 index 000000000..ef118a202 --- /dev/null +++ b/snippets/c++-ts-mode/vector @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: vector +# key: vec +# -- +std::vector<${1:Class}> ${2:var}${3:(${4:10}, $1($5))}; \ No newline at end of file diff --git a/snippets/c-ts-mode/assert b/snippets/c-ts-mode/assert new file mode 100644 index 000000000..964205eca --- /dev/null +++ b/snippets/c-ts-mode/assert @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: assert +# key: ass +# -- +#include +$0 \ No newline at end of file diff --git a/snippets/c-ts-mode/compile b/snippets/c-ts-mode/compile new file mode 100644 index 000000000..8246a10e6 --- /dev/null +++ b/snippets/c-ts-mode/compile @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: compile +# key: compile +# -- +// -*- compile-command: "${1:gcc -Wall -o ${2:dest} ${3:file}}" -*- \ No newline at end of file diff --git a/snippets/c-ts-mode/define b/snippets/c-ts-mode/define new file mode 100644 index 000000000..9d5c5dd97 --- /dev/null +++ b/snippets/c-ts-mode/define @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: define +# key: d +# -- +#define $0 \ No newline at end of file diff --git a/snippets/c-ts-mode/fgets b/snippets/c-ts-mode/fgets new file mode 100644 index 000000000..f572e2b9a --- /dev/null +++ b/snippets/c-ts-mode/fgets @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: fgets +# key: fgets +# -- +fgets(${1:variable}, ${2:size}, ${3:stdin}); diff --git a/snippets/c-ts-mode/fprintf b/snippets/c-ts-mode/fprintf new file mode 100644 index 000000000..6b269eb1b --- /dev/null +++ b/snippets/c-ts-mode/fprintf @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: fprintf +# key: fprintf +# -- +fprintf(${1:stdout}, "${2:format string}", ${3:variable}); diff --git a/snippets/c-ts-mode/malloc b/snippets/c-ts-mode/malloc new file mode 100644 index 000000000..2a51de35b --- /dev/null +++ b/snippets/c-ts-mode/malloc @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: malloc +# key: malloc +# -- +malloc(sizeof($1)${2: * ${3:3}}); +$0 \ No newline at end of file diff --git a/snippets/c-ts-mode/packed b/snippets/c-ts-mode/packed new file mode 100644 index 000000000..b4eb125cc --- /dev/null +++ b/snippets/c-ts-mode/packed @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: packed +# key: packed +# -- +__attribute__((__packed__))$0 \ No newline at end of file diff --git a/snippets/c-ts-mode/printf b/snippets/c-ts-mode/printf new file mode 100644 index 000000000..ccc788cca --- /dev/null +++ b/snippets/c-ts-mode/printf @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: printf +# key: pr +# -- +printf("${1:format string}"${2: ,a0,a1}); \ No newline at end of file diff --git a/snippets/c-ts-mode/scanf b/snippets/c-ts-mode/scanf new file mode 100644 index 000000000..002504c05 --- /dev/null +++ b/snippets/c-ts-mode/scanf @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: scanf +# key: scanf +# -- +scanf("${1:format string}", ${2:&variable}); diff --git a/snippets/c-ts-mode/stdio b/snippets/c-ts-mode/stdio new file mode 100644 index 000000000..752976651 --- /dev/null +++ b/snippets/c-ts-mode/stdio @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: stdio +# key: io +# -- +#include \ No newline at end of file diff --git a/snippets/c-ts-mode/stdlib b/snippets/c-ts-mode/stdlib new file mode 100644 index 000000000..f285f94b5 --- /dev/null +++ b/snippets/c-ts-mode/stdlib @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: stdlib +# key: std +# -- +#include \ No newline at end of file diff --git a/snippets/c-ts-mode/string b/snippets/c-ts-mode/string new file mode 100644 index 000000000..d45b7575c --- /dev/null +++ b/snippets/c-ts-mode/string @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: string +# key: str +# -- +#include \ No newline at end of file diff --git a/snippets/c-ts-mode/strstr b/snippets/c-ts-mode/strstr new file mode 100644 index 000000000..09b00e77e --- /dev/null +++ b/snippets/c-ts-mode/strstr @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: strstr +# key: strstr +# -- +strstr(${1:string}, ${2:string}); diff --git a/snippets/c-ts-mode/union b/snippets/c-ts-mode/union new file mode 100644 index 000000000..b4ec5fae2 --- /dev/null +++ b/snippets/c-ts-mode/union @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: union +# key: union +# -- +typedef union { + $0 +} ${1:name}; \ No newline at end of file diff --git a/snippets/c-ts-mode/unistd b/snippets/c-ts-mode/unistd new file mode 100644 index 000000000..d5fca02d0 --- /dev/null +++ b/snippets/c-ts-mode/unistd @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: unistd +# key: uni +# -- +#include \ No newline at end of file diff --git a/snippets/csharp-ts-mode/attrib b/snippets/csharp-ts-mode/attrib new file mode 100644 index 000000000..da3bd1a9c --- /dev/null +++ b/snippets/csharp-ts-mode/attrib @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# contributor : Alejandro Espinoza Esparza +# name: private attribute ....; +# key: attrib +# -- +/// +/// $3 +/// +private $1 $2; \ No newline at end of file diff --git a/snippets/csharp-ts-mode/attrib.1 b/snippets/csharp-ts-mode/attrib.1 new file mode 100644 index 000000000..b91e778d4 --- /dev/null +++ b/snippets/csharp-ts-mode/attrib.1 @@ -0,0 +1,23 @@ +# -*- mode: snippet -*- +# contributor : Alejandro Espinoza Esparza +# name: private attribute ....; public property ... ... { ... } +# key: attrib +# -- +/// +/// $3 +/// +private $1 $2; + +/// +/// $4 +/// +/// $5 +public $1 $2 +{ + get { + return this.$2; + } + set { + this.$2 = value; + } +} \ No newline at end of file diff --git a/snippets/csharp-ts-mode/attrib.2 b/snippets/csharp-ts-mode/attrib.2 new file mode 100644 index 000000000..269b62380 --- /dev/null +++ b/snippets/csharp-ts-mode/attrib.2 @@ -0,0 +1,23 @@ +# -*- mode: snippet -*- +# contributor : Alejandro Espinoza Esparza +# name: private _attribute ....; public Property ... ... { ... } +# key: attrib +# -- +/// +/// $3 +/// +private $1 ${2:$(if (> (length yas-text) 0) (format "_%s%s" (downcase (substring yas-text 0 1)) (substring yas-text 1 (length yas-text))) "")}; + +/// +/// ${3:Description} +/// +/// $1 +public ${1:Type} ${2:Name} +{ + get { + return this.${2:$(if (> (length yas-text) 0) (format "_%s%s" (downcase (substring yas-text 0 1)) (substring yas-text 1 (length yas-text))) "")}; + } + set { + this.${2:$(if (> (length yas-text) 0) (format "_%s%s" (downcase (substring yas-text 0 1)) (substring yas-text 1 (length yas-text))) "")} = value; + } +} \ No newline at end of file diff --git a/snippets/csharp-ts-mode/class b/snippets/csharp-ts-mode/class new file mode 100644 index 000000000..b5d66a928 --- /dev/null +++ b/snippets/csharp-ts-mode/class @@ -0,0 +1,23 @@ +# -*- mode: snippet -*- +# contributor : Alejandro Espinoza Esparza +# name: class ... { ... } +# key: class +# -- +${5:public} class ${1:Name} +{ + #region Ctor & Destructor + /// + /// ${3:Standard Constructor} + /// + public $1($2) + { + } + + /// + /// ${4:Default Destructor} + /// + public ~$1() + { + } + #endregion +} \ No newline at end of file diff --git a/snippets/csharp-ts-mode/comment b/snippets/csharp-ts-mode/comment new file mode 100644 index 000000000..367a10875 --- /dev/null +++ b/snippets/csharp-ts-mode/comment @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# contributor : Alejandro Espinoza Esparza +# name: /// ... +# key: comment +# -- +/// +/// $1 +/// \ No newline at end of file diff --git a/snippets/csharp-ts-mode/comment.1 b/snippets/csharp-ts-mode/comment.1 new file mode 100644 index 000000000..21b284c1b --- /dev/null +++ b/snippets/csharp-ts-mode/comment.1 @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# contributor : Alejandro Espinoza Esparza +# name: /// ... +# key: comment +# -- +/// $2 \ No newline at end of file diff --git a/snippets/csharp-ts-mode/comment.2 b/snippets/csharp-ts-mode/comment.2 new file mode 100644 index 000000000..82b54e7dd --- /dev/null +++ b/snippets/csharp-ts-mode/comment.2 @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# contributor : Alejandro Espinoza Esparza +# name: /// $1 +# key: comment +# -- diff --git a/snippets/csharp-ts-mode/comment.3 b/snippets/csharp-ts-mode/comment.3 new file mode 100644 index 000000000..9fdc71508 --- /dev/null +++ b/snippets/csharp-ts-mode/comment.3 @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# contributor : Alejandro Espinoza Esparza +# name: /// ... +# key: comment +# -- +/// $2 \ No newline at end of file diff --git a/snippets/csharp-ts-mode/fore b/snippets/csharp-ts-mode/fore new file mode 100644 index 000000000..e5e9c64f2 --- /dev/null +++ b/snippets/csharp-ts-mode/fore @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# contributor : Jostein Kjønigsen +# name: foreach { ... } +# key: fore +# -- +foreach (${1:var} ${2:item} in ${3:list}) +{ + $0 +} \ No newline at end of file diff --git a/snippets/csharp-ts-mode/main b/snippets/csharp-ts-mode/main new file mode 100644 index 000000000..0075116d5 --- /dev/null +++ b/snippets/csharp-ts-mode/main @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: main +# key: main +# -- +static void Main(string[] args) +{ + $0 +} diff --git a/snippets/csharp-ts-mode/method b/snippets/csharp-ts-mode/method new file mode 100644 index 000000000..721ae3a85 --- /dev/null +++ b/snippets/csharp-ts-mode/method @@ -0,0 +1,12 @@ +# -*- mode: snippet -*- +# contributor : Alejandro Espinoza Esparza +# name: public void Method { ... } +# key: method +# -- +/// +/// ${5:Description} +/// ${2:$(if (string= (upcase yas-text) "VOID") "" (format "%s%s%s" "\n/// " yas-text ""))} +${1:public} ${2:void} ${3:MethodName}($4) +{ +$0 +} \ No newline at end of file diff --git a/snippets/csharp-ts-mode/namespace b/snippets/csharp-ts-mode/namespace new file mode 100644 index 000000000..326b8495a --- /dev/null +++ b/snippets/csharp-ts-mode/namespace @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# contributor : Alejandro Espinoza Esparza +# name: namespace .. { ... } +# key: namespace +# -- +namespace $1 +{ +$0 +} \ No newline at end of file diff --git a/snippets/csharp-ts-mode/prop b/snippets/csharp-ts-mode/prop new file mode 100644 index 000000000..44b7dd4db --- /dev/null +++ b/snippets/csharp-ts-mode/prop @@ -0,0 +1,18 @@ +# -*- mode: snippet -*- +# contributor : Alejandro Espinoza Esparza +# name: property ... ... { ... } +# key: prop +# -- +/// +/// $5 +/// +/// $6 +$1 $2 $3 +{ + get { + return this.$4; + } + set { + this.$4 = value; + } +} \ No newline at end of file diff --git a/snippets/csharp-ts-mode/read b/snippets/csharp-ts-mode/read new file mode 100644 index 000000000..09ea91631 --- /dev/null +++ b/snippets/csharp-ts-mode/read @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# contributor : Frede Brændstrup +# name: Console.Read(...); +# key: cr +# -- +Console.Read(${1:Read}); \ No newline at end of file diff --git a/snippets/csharp-ts-mode/readline b/snippets/csharp-ts-mode/readline new file mode 100644 index 000000000..bafb95ffa --- /dev/null +++ b/snippets/csharp-ts-mode/readline @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# contributor : Frede Brændstrup +# name: Console.ReadLine(...); +# key: crl +# -- +Console.ReadLine(${1:Read}); diff --git a/snippets/csharp-ts-mode/region b/snippets/csharp-ts-mode/region new file mode 100644 index 000000000..95a003321 --- /dev/null +++ b/snippets/csharp-ts-mode/region @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# contributor : Alejandro Espinoza Esparza +# name: #region ... #endregion +# key: region +# -- +#region $1 +$0 +#endregion \ No newline at end of file diff --git a/snippets/csharp-ts-mode/trycatch b/snippets/csharp-ts-mode/trycatch new file mode 100644 index 000000000..a76a32a47 --- /dev/null +++ b/snippets/csharp-ts-mode/trycatch @@ -0,0 +1,13 @@ +# -*- mode: snippet -*- +# contributor : Frede Brændstrup +# name: try{...} catch (ex) {...} +# key: tc +# -- +try +{ + $0 +} +catch (${1:Exception} ex) +{ + ${2:Console.WriteLine(ex.ToString());} +} \ No newline at end of file diff --git a/snippets/csharp-ts-mode/using b/snippets/csharp-ts-mode/using new file mode 100644 index 000000000..b07b2f8b9 --- /dev/null +++ b/snippets/csharp-ts-mode/using @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# contributor : Alejandro Espinoza Esparza +# name: using ...; +# key: using +# -- +using $1; \ No newline at end of file diff --git a/snippets/csharp-ts-mode/using.1 b/snippets/csharp-ts-mode/using.1 new file mode 100644 index 000000000..29964af54 --- /dev/null +++ b/snippets/csharp-ts-mode/using.1 @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# contributor : Alejandro Espinoza Esparza +# name: using System; +# key: using +# -- +using System; \ No newline at end of file diff --git a/snippets/csharp-ts-mode/using.2 b/snippets/csharp-ts-mode/using.2 new file mode 100644 index 000000000..212247eb7 --- /dev/null +++ b/snippets/csharp-ts-mode/using.2 @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# contributor : Alejandro Espinoza Esparza +# name: using System....; +# key: using +# -- +using System.$1; \ No newline at end of file diff --git a/snippets/csharp-ts-mode/write b/snippets/csharp-ts-mode/write new file mode 100644 index 000000000..a6d92518b --- /dev/null +++ b/snippets/csharp-ts-mode/write @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# contributor : Frede Brændstrup +# name: Console.Write(...); +# key: cw +# -- +Console.Write(${1:Write}); \ No newline at end of file diff --git a/snippets/csharp-ts-mode/writeline b/snippets/csharp-ts-mode/writeline new file mode 100644 index 000000000..2866490f4 --- /dev/null +++ b/snippets/csharp-ts-mode/writeline @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# contributor : Frede Brændstrup +# name: Console.WriteLine(...); +# key: cwl +# -- +Console.WriteLine(${1:Write}); \ No newline at end of file diff --git a/snippets/css-ts-mode/bg b/snippets/css-ts-mode/bg new file mode 100644 index 000000000..25bce78cf --- /dev/null +++ b/snippets/css-ts-mode/bg @@ -0,0 +1,4 @@ +# -*- mode: snippet -*- +# name: background-color: ... +# -- +background-color: #${1:DDD}; \ No newline at end of file diff --git a/snippets/css-ts-mode/bg.1 b/snippets/css-ts-mode/bg.1 new file mode 100644 index 000000000..2e7906c73 --- /dev/null +++ b/snippets/css-ts-mode/bg.1 @@ -0,0 +1,4 @@ +# -*- mode: snippet -*- +# name: background-image: ... +# -- +background-image: url($1); \ No newline at end of file diff --git a/snippets/css-ts-mode/bor b/snippets/css-ts-mode/bor new file mode 100644 index 000000000..cdd35074d --- /dev/null +++ b/snippets/css-ts-mode/bor @@ -0,0 +1,4 @@ +# -*- mode: snippet -*- +# name: border size style color +# -- +border: ${1:1px} ${2:solid} #${3:999}; \ No newline at end of file diff --git a/snippets/css-ts-mode/cl b/snippets/css-ts-mode/cl new file mode 100644 index 000000000..825c3ec9e --- /dev/null +++ b/snippets/css-ts-mode/cl @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# contributor : rejeep +# name: clear: ... +# -- +clear: $1; \ No newline at end of file diff --git a/snippets/css-ts-mode/disp.block b/snippets/css-ts-mode/disp.block new file mode 100644 index 000000000..e6bfa28f4 --- /dev/null +++ b/snippets/css-ts-mode/disp.block @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# contributor : rejeep +# name: display: block +# -- +display: block; \ No newline at end of file diff --git a/snippets/css-ts-mode/disp.inline b/snippets/css-ts-mode/disp.inline new file mode 100644 index 000000000..b198d57dd --- /dev/null +++ b/snippets/css-ts-mode/disp.inline @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# contributor : rejeep +# name: display: inline +# -- +display: inline; \ No newline at end of file diff --git a/snippets/css-ts-mode/disp.none b/snippets/css-ts-mode/disp.none new file mode 100644 index 000000000..7e7bbd9f2 --- /dev/null +++ b/snippets/css-ts-mode/disp.none @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# contributor : rejeep +# name: display: none +# -- +display: none; \ No newline at end of file diff --git a/snippets/css-ts-mode/ff b/snippets/css-ts-mode/ff new file mode 100644 index 000000000..819c5d3f7 --- /dev/null +++ b/snippets/css-ts-mode/ff @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# contributor : rejeep +# name: font-family: ... +# -- +font-family: $1; \ No newline at end of file diff --git a/snippets/css-ts-mode/fs b/snippets/css-ts-mode/fs new file mode 100644 index 000000000..616e331e4 --- /dev/null +++ b/snippets/css-ts-mode/fs @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# contributor : rejeep +# name: font-size: ... +# -- +font-size: ${12px}; \ No newline at end of file diff --git a/snippets/css-ts-mode/mar.bottom b/snippets/css-ts-mode/mar.bottom new file mode 100644 index 000000000..30e44f645 --- /dev/null +++ b/snippets/css-ts-mode/mar.bottom @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# contributor : rejeep +# name: margin-bottom: ... +# -- +margin-bottom: $1; \ No newline at end of file diff --git a/snippets/css-ts-mode/mar.left b/snippets/css-ts-mode/mar.left new file mode 100644 index 000000000..23f17a20f --- /dev/null +++ b/snippets/css-ts-mode/mar.left @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# contributor : rejeep +# name: margin-left: ... +# -- +margin-left: $1; \ No newline at end of file diff --git a/snippets/css-ts-mode/mar.mar b/snippets/css-ts-mode/mar.mar new file mode 100644 index 000000000..a7184c80c --- /dev/null +++ b/snippets/css-ts-mode/mar.mar @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# contributor : rejeep +# name: margin: ... +# -- +margin: $1; \ No newline at end of file diff --git a/snippets/css-ts-mode/mar.margin b/snippets/css-ts-mode/mar.margin new file mode 100644 index 000000000..91707ca45 --- /dev/null +++ b/snippets/css-ts-mode/mar.margin @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# contributor : rejeep +# name: margin top right bottom left +# -- +margin: ${top} ${right} ${bottom} ${left}; \ No newline at end of file diff --git a/snippets/css-ts-mode/mar.right b/snippets/css-ts-mode/mar.right new file mode 100644 index 000000000..f03533121 --- /dev/null +++ b/snippets/css-ts-mode/mar.right @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# contributor : rejeep +# name: margin-right: ... +# -- +margin-right: $1; \ No newline at end of file diff --git a/snippets/css-ts-mode/mar.top b/snippets/css-ts-mode/mar.top new file mode 100644 index 000000000..0efb7957b --- /dev/null +++ b/snippets/css-ts-mode/mar.top @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# contributor : rejeep +# name: margin-top: ... +# -- +margin-top: $1; \ No newline at end of file diff --git a/snippets/css-ts-mode/pad.bottom b/snippets/css-ts-mode/pad.bottom new file mode 100644 index 000000000..98726dae6 --- /dev/null +++ b/snippets/css-ts-mode/pad.bottom @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# contributor : rejeep +# name: padding-bottom: ... +# -- +padding-bottom: $1; \ No newline at end of file diff --git a/snippets/css-ts-mode/pad.left b/snippets/css-ts-mode/pad.left new file mode 100644 index 000000000..de235a7b3 --- /dev/null +++ b/snippets/css-ts-mode/pad.left @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# contributor : rejeep +# name: padding-left: ... +# -- +padding-left: $1; \ No newline at end of file diff --git a/snippets/css-ts-mode/pad.pad b/snippets/css-ts-mode/pad.pad new file mode 100644 index 000000000..880e149e9 --- /dev/null +++ b/snippets/css-ts-mode/pad.pad @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# contributor : rejeep +# name: padding: ... +# -- +padding: $1; \ No newline at end of file diff --git a/snippets/css-ts-mode/pad.padding b/snippets/css-ts-mode/pad.padding new file mode 100644 index 000000000..73744935d --- /dev/null +++ b/snippets/css-ts-mode/pad.padding @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# contributor : rejeep +# name: padding: top right bottom left +# -- +padding: ${top} ${right} ${bottom} ${left}; \ No newline at end of file diff --git a/snippets/css-ts-mode/pad.right b/snippets/css-ts-mode/pad.right new file mode 100644 index 000000000..4bc0c885d --- /dev/null +++ b/snippets/css-ts-mode/pad.right @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# contributor : rejeep +# name: padding-right: ... +# -- +padding-right: $1; \ No newline at end of file diff --git a/snippets/css-ts-mode/pad.top b/snippets/css-ts-mode/pad.top new file mode 100644 index 000000000..ed159025b --- /dev/null +++ b/snippets/css-ts-mode/pad.top @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# contributor : rejeep +# name: padding-top: ... +# -- +padding-top: $1; \ No newline at end of file diff --git a/snippets/css-ts-mode/v b/snippets/css-ts-mode/v new file mode 100644 index 000000000..fec5bd5b9 --- /dev/null +++ b/snippets/css-ts-mode/v @@ -0,0 +1,10 @@ +# -*- mode: snippet -*- +# name: -vendor-prefix +# contributor: Prateek Saxena +# key: -v +# -- +$1: $2; +-webkit-$1: $2; +-moz-$1: $2; +-ms-$1: $2; +-o-$1: $2; \ No newline at end of file diff --git a/snippets/elixir-ts-mode/after b/snippets/elixir-ts-mode/after new file mode 100644 index 000000000..6b65c8245 --- /dev/null +++ b/snippets/elixir-ts-mode/after @@ -0,0 +1,6 @@ +## -*- mode: snippet -*- +# name: after +# key: after +# -- +after ${1:500} -> + $0 \ No newline at end of file diff --git a/snippets/elixir-ts-mode/call b/snippets/elixir-ts-mode/call new file mode 100644 index 000000000..63b4db253 --- /dev/null +++ b/snippets/elixir-ts-mode/call @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: call +# key: call +# -- +GenServer.call(${1:__MODULE__}, $0) \ No newline at end of file diff --git a/snippets/elixir-ts-mode/case b/snippets/elixir-ts-mode/case new file mode 100644 index 000000000..05d20ce7e --- /dev/null +++ b/snippets/elixir-ts-mode/case @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: case +# key: case +# -- +case $1 do + $0 +end \ No newline at end of file diff --git a/snippets/elixir-ts-mode/cast b/snippets/elixir-ts-mode/cast new file mode 100644 index 000000000..3ef0680fa --- /dev/null +++ b/snippets/elixir-ts-mode/cast @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: cast +# key: cast +# -- +GenServer.cast(${1:__MODULE__}, $0) \ No newline at end of file diff --git a/snippets/elixir-ts-mode/cond b/snippets/elixir-ts-mode/cond new file mode 100644 index 000000000..d8be9ccac --- /dev/null +++ b/snippets/elixir-ts-mode/cond @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: cond +# key: cond +# -- +cond do + $0 +end \ No newline at end of file diff --git a/snippets/elixir-ts-mode/def b/snippets/elixir-ts-mode/def new file mode 100644 index 000000000..9d45c941b --- /dev/null +++ b/snippets/elixir-ts-mode/def @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: def +# key: def +# -- +def ${1:function}${2:(${3:args})} do + $0 +end \ No newline at end of file diff --git a/snippets/elixir-ts-mode/defmacro b/snippets/elixir-ts-mode/defmacro new file mode 100644 index 000000000..da00acbb1 --- /dev/null +++ b/snippets/elixir-ts-mode/defmacro @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: defmacro +# key: defmacro +# -- +defmacro $1 do + $0 +end \ No newline at end of file diff --git a/snippets/elixir-ts-mode/defmacrop b/snippets/elixir-ts-mode/defmacrop new file mode 100644 index 000000000..620ab320a --- /dev/null +++ b/snippets/elixir-ts-mode/defmacrop @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: defmacrop +# key: defmacrop +# -- +defmacrop $1 do + $0 +end \ No newline at end of file diff --git a/snippets/elixir-ts-mode/defmodule b/snippets/elixir-ts-mode/defmodule new file mode 100644 index 000000000..6e4e2d346 --- /dev/null +++ b/snippets/elixir-ts-mode/defmodule @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: defmodule +# key: defmodule +# -- +defmodule $1 do + $0 +end \ No newline at end of file diff --git a/snippets/elixir-ts-mode/defmodule_filename b/snippets/elixir-ts-mode/defmodule_filename new file mode 100644 index 000000000..58346e079 --- /dev/null +++ b/snippets/elixir-ts-mode/defmodule_filename @@ -0,0 +1,7 @@ +## -*- mode: snippet -*- +# name: defmodule XXX end +# key: dm +# -- +defmodule ${1:`(concat (capitalize (file-name-nondirectory (directory-file-name (file-name-directory buffer-file-name)))) ".")`}${2:`(mapconcat 'capitalize (split-string (file-name-base) "_") "")`} do + $0 +end \ No newline at end of file diff --git a/snippets/elixir-ts-mode/defp b/snippets/elixir-ts-mode/defp new file mode 100644 index 000000000..61a682e0a --- /dev/null +++ b/snippets/elixir-ts-mode/defp @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: defp +# key: defp +# -- +defp $1 do + $0 +end \ No newline at end of file diff --git a/snippets/elixir-ts-mode/do b/snippets/elixir-ts-mode/do new file mode 100644 index 000000000..5447f5285 --- /dev/null +++ b/snippets/elixir-ts-mode/do @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: do +# key: do +# -- +do + $0 +end \ No newline at end of file diff --git a/snippets/elixir-ts-mode/doc b/snippets/elixir-ts-mode/doc new file mode 100644 index 000000000..92711c2d0 --- /dev/null +++ b/snippets/elixir-ts-mode/doc @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: doc +# key: doc +# -- +@doc """ +$0 +""" \ No newline at end of file diff --git a/snippets/elixir-ts-mode/fn b/snippets/elixir-ts-mode/fn new file mode 100644 index 000000000..0bdf07378 --- /dev/null +++ b/snippets/elixir-ts-mode/fn @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: fn +# key: fn +# -- +fn ${1:x} -> $1$0 end \ No newline at end of file diff --git a/snippets/elixir-ts-mode/for b/snippets/elixir-ts-mode/for new file mode 100644 index 000000000..2e395df9b --- /dev/null +++ b/snippets/elixir-ts-mode/for @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: for +# key: for +# -- +for ${2:x} <- ${1:enum} do + $2$0 +end \ No newline at end of file diff --git a/snippets/elixir-ts-mode/function b/snippets/elixir-ts-mode/function new file mode 100644 index 000000000..fe56978d3 --- /dev/null +++ b/snippets/elixir-ts-mode/function @@ -0,0 +1,7 @@ +## -*- mode: snippet -*- +# name: function +# key: dfun +# -- +def $1($2)${3:$$(when (and yas-moving-away-p yas-modified-p) (concat " when " yas-text))} do + $0 +end \ No newline at end of file diff --git a/snippets/elixir-ts-mode/function-one-line b/snippets/elixir-ts-mode/function-one-line new file mode 100644 index 000000000..46e806089 --- /dev/null +++ b/snippets/elixir-ts-mode/function-one-line @@ -0,0 +1,5 @@ +## -*- mode: snippet -*- +# name: function-one-line +# key: df +# -- +def $1($2)${3:$$(when (and yas-moving-away-p yas-modified-p) (concat " when " yas-text))}, do: $0 \ No newline at end of file diff --git a/snippets/elixir-ts-mode/hcall b/snippets/elixir-ts-mode/hcall new file mode 100644 index 000000000..9e11b2d63 --- /dev/null +++ b/snippets/elixir-ts-mode/hcall @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: hcall +# key: hcall +# -- +def handle_call($1, _from, ${2:state}) do + $0 +end \ No newline at end of file diff --git a/snippets/elixir-ts-mode/hcast b/snippets/elixir-ts-mode/hcast new file mode 100644 index 000000000..f7cff51db --- /dev/null +++ b/snippets/elixir-ts-mode/hcast @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: hcast +# key: hcast +# -- +def handle_cast($1, ${2:state}) do + $0 +end \ No newline at end of file diff --git a/snippets/elixir-ts-mode/hinfo b/snippets/elixir-ts-mode/hinfo new file mode 100644 index 000000000..4ac5018fa --- /dev/null +++ b/snippets/elixir-ts-mode/hinfo @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: hinfo +# key: hinfo +# -- +def handle_info($1, ${2:state}) do + $0 +end \ No newline at end of file diff --git a/snippets/elixir-ts-mode/if b/snippets/elixir-ts-mode/if new file mode 100644 index 000000000..6a588ce1c --- /dev/null +++ b/snippets/elixir-ts-mode/if @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: if +# key: if +# -- +if ${1:condition} do + $0 +end \ No newline at end of file diff --git a/snippets/elixir-ts-mode/ife b/snippets/elixir-ts-mode/ife new file mode 100644 index 000000000..37729764a --- /dev/null +++ b/snippets/elixir-ts-mode/ife @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# name: if-else +# key: ife +# -- +if ${1:condition} do + $2 +else + $3 +end \ No newline at end of file diff --git a/snippets/elixir-ts-mode/inspect b/snippets/elixir-ts-mode/inspect new file mode 100644 index 000000000..27a60ced2 --- /dev/null +++ b/snippets/elixir-ts-mode/inspect @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: Inspect value +# key: i +# -- +IO.inspect($1, label: "$1")$0 \ No newline at end of file diff --git a/snippets/elixir-ts-mode/io b/snippets/elixir-ts-mode/io new file mode 100644 index 000000000..e6a778094 --- /dev/null +++ b/snippets/elixir-ts-mode/io @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: io +# key: io +# -- +IO.puts("$1")$0 \ No newline at end of file diff --git a/snippets/elixir-ts-mode/iop b/snippets/elixir-ts-mode/iop new file mode 100644 index 000000000..603346b7c --- /dev/null +++ b/snippets/elixir-ts-mode/iop @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: iop +# key: iop +# -- +IO.puts("$1 #{inspect $1}")$0 \ No newline at end of file diff --git a/snippets/elixir-ts-mode/mdoc b/snippets/elixir-ts-mode/mdoc new file mode 100644 index 000000000..a5f8b46d6 --- /dev/null +++ b/snippets/elixir-ts-mode/mdoc @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: moduledoc +# key: mdoc +# -- +@moduledoc """ +$0 +""" \ No newline at end of file diff --git a/snippets/elixir-ts-mode/pry b/snippets/elixir-ts-mode/pry new file mode 100644 index 000000000..24325f627 --- /dev/null +++ b/snippets/elixir-ts-mode/pry @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: pry +# key: pry +# group: debug +# -- +require IEx; IEx.pry \ No newline at end of file diff --git a/snippets/elixir-ts-mode/receive b/snippets/elixir-ts-mode/receive new file mode 100644 index 000000000..24ccd7b54 --- /dev/null +++ b/snippets/elixir-ts-mode/receive @@ -0,0 +1,7 @@ +## -*- mode: snippet -*- +# name: receive +# key: rcv +# -- +receive do + $0 +end \ No newline at end of file diff --git a/snippets/elixir-ts-mode/test b/snippets/elixir-ts-mode/test new file mode 100644 index 000000000..491e76cf2 --- /dev/null +++ b/snippets/elixir-ts-mode/test @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: test +# key: test +# -- +test "$1" do + $0 +end \ No newline at end of file diff --git a/snippets/elixir-ts-mode/unless b/snippets/elixir-ts-mode/unless new file mode 100644 index 000000000..675be0a58 --- /dev/null +++ b/snippets/elixir-ts-mode/unless @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: unless +# key: unless +# -- +unless ${1:condition} do + $0 +end \ No newline at end of file diff --git a/snippets/elixir-ts-mode/wt b/snippets/elixir-ts-mode/wt new file mode 100644 index 000000000..30acd4815 --- /dev/null +++ b/snippets/elixir-ts-mode/wt @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# contributor: Miriam Retka (https://github.com/Auralcat) +# name: wt +# key: wt +# -- +with ${1:{:ok, tuple} <- function(arg)}, do + $0 +end \ No newline at end of file diff --git a/snippets/elixir-ts-mode/wte b/snippets/elixir-ts-mode/wte new file mode 100644 index 000000000..804b586b2 --- /dev/null +++ b/snippets/elixir-ts-mode/wte @@ -0,0 +1,10 @@ +# -*- mode: snippet -*- +# contributor: Miriam Retka (https://github.com/Auralcat) +# name: wte +# key: wte +# -- +with ${1:{:ok, tuple} <- function(arg)}, do + $2 +else + $0 +end \ No newline at end of file diff --git a/snippets/go-ts-mode/benchmark b/snippets/go-ts-mode/benchmark new file mode 100644 index 000000000..ef669a85d --- /dev/null +++ b/snippets/go-ts-mode/benchmark @@ -0,0 +1,10 @@ +# -*- mode: snippet -*- +# name: benchmark +# key: bench +# contributor : @atotto +# -- +func Benchmark$1(b *testing.B) { + for i := 0; i < b.N; i++ { + $0 + } +} diff --git a/snippets/go-ts-mode/const b/snippets/go-ts-mode/const new file mode 100644 index 000000000..c6524e3b9 --- /dev/null +++ b/snippets/go-ts-mode/const @@ -0,0 +1,6 @@ +# -*- mode:snippet -*- +# name: const +# key: const +# -- +const ${1:name type} = ${2:val} +$0 \ No newline at end of file diff --git a/snippets/go-ts-mode/const( b/snippets/go-ts-mode/const( new file mode 100644 index 000000000..03f26da76 --- /dev/null +++ b/snippets/go-ts-mode/const( @@ -0,0 +1,7 @@ +# -*- mode:snippet -*- +# name: const (...) +# key: const +# -- +const ( + ${1:name type} = ${2:val} +) \ No newline at end of file diff --git a/snippets/go-ts-mode/dd b/snippets/go-ts-mode/dd new file mode 100644 index 000000000..6e6fd1ef7 --- /dev/null +++ b/snippets/go-ts-mode/dd @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: debug fmt.Printf +# key: dd +# -- +fmt.Printf("%+v\n", $1) // output for debug +$0 \ No newline at end of file diff --git a/snippets/go-ts-mode/default b/snippets/go-ts-mode/default new file mode 100644 index 000000000..e0cd749d7 --- /dev/null +++ b/snippets/go-ts-mode/default @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: default +# key: def +# -- +default: +$0 \ No newline at end of file diff --git a/snippets/go-ts-mode/else b/snippets/go-ts-mode/else new file mode 100644 index 000000000..7f71305c3 --- /dev/null +++ b/snippets/go-ts-mode/else @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: else +# key: el +# -- + else { + $0 +} \ No newline at end of file diff --git a/snippets/go-ts-mode/error b/snippets/go-ts-mode/error new file mode 100644 index 000000000..85c539a3d --- /dev/null +++ b/snippets/go-ts-mode/error @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: error +# key: err +# contributor : @atotto +# -- +if err != nil { + $0 +} \ No newline at end of file diff --git a/snippets/go-ts-mode/example b/snippets/go-ts-mode/example new file mode 100644 index 000000000..acfb75dc8 --- /dev/null +++ b/snippets/go-ts-mode/example @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: example +# key: example +# contributor : @atotto +# -- +func Example$1() { + $0 +} diff --git a/snippets/go-ts-mode/for b/snippets/go-ts-mode/for new file mode 100644 index 000000000..9f404a387 --- /dev/null +++ b/snippets/go-ts-mode/for @@ -0,0 +1,7 @@ +# -*- mode:snippet -*- +# name: for +# key: for +# -- +for $1 { + $0 +} diff --git a/snippets/go-ts-mode/forrange b/snippets/go-ts-mode/forrange new file mode 100644 index 000000000..9d889eba9 --- /dev/null +++ b/snippets/go-ts-mode/forrange @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: for range +# key: range +# contributor : @atotto +# -- +for ${3:key}, ${2:value} := range ${1:target} { + $0 +} \ No newline at end of file diff --git a/snippets/go-ts-mode/func b/snippets/go-ts-mode/func new file mode 100644 index 000000000..9b1649f34 --- /dev/null +++ b/snippets/go-ts-mode/func @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: func +# key: func +# -- +// $1 ${4:...} +func ${1:name}(${2:args}) $3 { + $0 +} \ No newline at end of file diff --git a/snippets/go-ts-mode/if b/snippets/go-ts-mode/if new file mode 100644 index 000000000..569c1d5c0 --- /dev/null +++ b/snippets/go-ts-mode/if @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: if +# key: if +# -- +if $1 { + $0 +} \ No newline at end of file diff --git a/snippets/go-ts-mode/iferr b/snippets/go-ts-mode/iferr new file mode 100644 index 000000000..f1a284eeb --- /dev/null +++ b/snippets/go-ts-mode/iferr @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: if error +# key: iferr +# -- +if err != $1 { + $0 +} diff --git a/snippets/go-ts-mode/import b/snippets/go-ts-mode/import new file mode 100644 index 000000000..adf411b3c --- /dev/null +++ b/snippets/go-ts-mode/import @@ -0,0 +1,6 @@ +# -*- mode:snippet -*- +# name: import +# key: imp +# -- +import "$1" +$0 \ No newline at end of file diff --git a/snippets/go-ts-mode/import( b/snippets/go-ts-mode/import( new file mode 100644 index 000000000..b38ccf746 --- /dev/null +++ b/snippets/go-ts-mode/import( @@ -0,0 +1,7 @@ +# -*- mode:snippet -*- +# name: import (...) +# key: imp +# -- +import ( + "$0" +) diff --git a/snippets/go-ts-mode/init b/snippets/go-ts-mode/init new file mode 100644 index 000000000..bfb6d4119 --- /dev/null +++ b/snippets/go-ts-mode/init @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: func init() +# key: init +# -- +func init() { + $0 +} \ No newline at end of file diff --git a/snippets/go-ts-mode/lambda b/snippets/go-ts-mode/lambda new file mode 100644 index 000000000..07edca454 --- /dev/null +++ b/snippets/go-ts-mode/lambda @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: lambda func +# key: lambda +# -- +func(${1:args}) $2 { + $0 +}() \ No newline at end of file diff --git a/snippets/go-ts-mode/main b/snippets/go-ts-mode/main new file mode 100644 index 000000000..3d4e94b2f --- /dev/null +++ b/snippets/go-ts-mode/main @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: func main() +# condition: (progn (forward-line 0) (not (and (eq (point-min) (point)) (looking-at-p "package")))) +# key: main +# -- +func main() { + $0 +} \ No newline at end of file diff --git a/snippets/go-ts-mode/map b/snippets/go-ts-mode/map new file mode 100644 index 000000000..a2860ce1a --- /dev/null +++ b/snippets/go-ts-mode/map @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: map +# key: map +# -- +map[${1:type}]${2:type} diff --git a/snippets/go-ts-mode/method b/snippets/go-ts-mode/method new file mode 100644 index 000000000..a87c8d0b5 --- /dev/null +++ b/snippets/go-ts-mode/method @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# name: method +# key: mthd +# contributor: @Kunde21 +# -- +// $2 ${5:...} +func (${1:recv}) ${2:name}(${3:args}) $4 { + $0 +} \ No newline at end of file diff --git a/snippets/go-ts-mode/parallel_benchmark b/snippets/go-ts-mode/parallel_benchmark new file mode 100644 index 000000000..cde73015b --- /dev/null +++ b/snippets/go-ts-mode/parallel_benchmark @@ -0,0 +1,12 @@ +# -*- mode: snippet -*- +# name: parallel_benchmark +# key: parbench +# contributor : @kostya-sh +# -- +func Benchmark$1(b *testing.B) { + b.RunParallel(func(pb *testing.PB) { + for pb.Next() { + $0 + } + }) +} diff --git a/snippets/go-ts-mode/printf b/snippets/go-ts-mode/printf new file mode 100644 index 000000000..56563df46 --- /dev/null +++ b/snippets/go-ts-mode/printf @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: fmt.Printf(...) +# key: pr +# -- +fmt.Printf("${1:%s}\n", ${2:args}) +$0 \ No newline at end of file diff --git a/snippets/go-ts-mode/select b/snippets/go-ts-mode/select new file mode 100644 index 000000000..1db4b3c33 --- /dev/null +++ b/snippets/go-ts-mode/select @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: select +# key: sel +# -- +select { +case $1: + $0 +} \ No newline at end of file diff --git a/snippets/go-ts-mode/switch b/snippets/go-ts-mode/switch new file mode 100644 index 000000000..95c9dd7e3 --- /dev/null +++ b/snippets/go-ts-mode/switch @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: switch +# key: sw +# -- +switch $1 { +case $2: + $0 +} \ No newline at end of file diff --git a/snippets/go-ts-mode/test b/snippets/go-ts-mode/test new file mode 100644 index 000000000..8baf8c95b --- /dev/null +++ b/snippets/go-ts-mode/test @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: test +# key: at +# contributor : @atotto +# -- +func Test$1(t *testing.T) { + $0 +} diff --git a/snippets/go-ts-mode/testmain b/snippets/go-ts-mode/testmain new file mode 100644 index 000000000..5f208da8e --- /dev/null +++ b/snippets/go-ts-mode/testmain @@ -0,0 +1,21 @@ +# -*- mode: snippet -*- +# name: testmain +# key: testmain +# contributor : @atotto +# -- +func TestMain(m *testing.M) { + setup() + ret := m.Run() + if ret == 0 { + teardown() + } + os.Exit(ret) +} + +func setup() { + $1 +} + +func teardown() { + $2 +} \ No newline at end of file diff --git a/snippets/go-ts-mode/type b/snippets/go-ts-mode/type new file mode 100644 index 000000000..862feb76f --- /dev/null +++ b/snippets/go-ts-mode/type @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: type +# key: type +# -- +type $1 $2 { + $0 +} \ No newline at end of file diff --git a/snippets/go-ts-mode/var b/snippets/go-ts-mode/var new file mode 100644 index 000000000..839eb9f97 --- /dev/null +++ b/snippets/go-ts-mode/var @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: var +# key: var +# -- +var ${1:name} ${2:type} +$0 \ No newline at end of file diff --git a/snippets/go-ts-mode/var( b/snippets/go-ts-mode/var( new file mode 100644 index 000000000..5ad7cc88e --- /dev/null +++ b/snippets/go-ts-mode/var( @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: var (...) +# key: var +# -- +var ( + ${1:name} ${2:type} +) \ No newline at end of file diff --git a/snippets/haskell-ts-mode/case b/snippets/haskell-ts-mode/case new file mode 100644 index 000000000..196ab8a4c --- /dev/null +++ b/snippets/haskell-ts-mode/case @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# name: case +# key: case +# expand-env: ((yas-indent-line 'fixed)) +# -- +case ${1:var} of + ${2:cond} -> ${3:value} + $0 + otherwise -> ${4:other} \ No newline at end of file diff --git a/snippets/haskell-ts-mode/data b/snippets/haskell-ts-mode/data new file mode 100644 index 000000000..ed0166f14 --- /dev/null +++ b/snippets/haskell-ts-mode/data @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: data +# key: da +# -- +data ${1:Type} = $2 \ No newline at end of file diff --git a/snippets/haskell-ts-mode/doc b/snippets/haskell-ts-mode/doc new file mode 100644 index 000000000..d9ac69542 --- /dev/null +++ b/snippets/haskell-ts-mode/doc @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: doc +# key: d +# -- +{- + $0 +-} \ No newline at end of file diff --git a/snippets/haskell-ts-mode/efix b/snippets/haskell-ts-mode/efix new file mode 100644 index 000000000..e8714f320 --- /dev/null +++ b/snippets/haskell-ts-mode/efix @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: fixme dummy +# key: efix +# expand-env: ((yas-indent-line 'fixed)) +# -- +(error "FIXME: $0") \ No newline at end of file diff --git a/snippets/haskell-ts-mode/function b/snippets/haskell-ts-mode/function new file mode 100644 index 000000000..633d1e640 --- /dev/null +++ b/snippets/haskell-ts-mode/function @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: fun +# key: fun +# expand-env: ((yas-indent-line 'fixed)) +# -- +${1:function-name} :: ${2:type} +$1 ${3:arguments} $0 diff --git a/snippets/haskell-ts-mode/functione b/snippets/haskell-ts-mode/functione new file mode 100644 index 000000000..22276e775 --- /dev/null +++ b/snippets/haskell-ts-mode/functione @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: fune +# key: fune +# -- +${1:function-name} :: ${2:type} +$1 = $0error "Not implemented: $1" \ No newline at end of file diff --git a/snippets/haskell-ts-mode/import b/snippets/haskell-ts-mode/import new file mode 100644 index 000000000..377154352 --- /dev/null +++ b/snippets/haskell-ts-mode/import @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: import +# key: import +# -- +import${1: qualified} ${2:Module${3:(symbols)}}${4: as ${5:alias}} \ No newline at end of file diff --git a/snippets/haskell-ts-mode/instance b/snippets/haskell-ts-mode/instance new file mode 100644 index 000000000..d288db729 --- /dev/null +++ b/snippets/haskell-ts-mode/instance @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: instance +# key: ins +# -- +instance ${1:${2:(Show a)} => }${3:Ord} ${4:DataType} where +$0 diff --git a/snippets/haskell-ts-mode/main b/snippets/haskell-ts-mode/main new file mode 100644 index 000000000..5ab76baa0 --- /dev/null +++ b/snippets/haskell-ts-mode/main @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: main function +# key: main +# expand-env: ((yas-indent-line 'fixed)) +# -- +main :: IO () +main = do $0 \ No newline at end of file diff --git a/snippets/haskell-ts-mode/module b/snippets/haskell-ts-mode/module new file mode 100644 index 000000000..20d4f3cad --- /dev/null +++ b/snippets/haskell-ts-mode/module @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: module +# key: mod +# -- +module ${1:Module} where +$0 \ No newline at end of file diff --git a/snippets/haskell-ts-mode/new class b/snippets/haskell-ts-mode/new class new file mode 100644 index 000000000..055b5b9ff --- /dev/null +++ b/snippets/haskell-ts-mode/new class @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: new class +# key: class +# expand-env: ((yas-indent-line 'fixed)) +# -- +class ${1:Name} where + $0 \ No newline at end of file diff --git a/snippets/haskell-ts-mode/pragma b/snippets/haskell-ts-mode/pragma new file mode 100644 index 000000000..f5f1b0185 --- /dev/null +++ b/snippets/haskell-ts-mode/pragma @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: pragma +# key: prag +# -- +{-# ${1:PRAGMA} #-} \ No newline at end of file diff --git a/snippets/haskell-ts-mode/print b/snippets/haskell-ts-mode/print new file mode 100644 index 000000000..30b4a447b --- /dev/null +++ b/snippets/haskell-ts-mode/print @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: print +# key: pr +# -- +print $0 \ No newline at end of file diff --git a/snippets/html-ts-mode/dd b/snippets/html-ts-mode/dd new file mode 100644 index 000000000..bb941ff4a --- /dev/null +++ b/snippets/html-ts-mode/dd @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# contributor : Rodrigo Setti +# name:
...
+# group : list +# -- +
$1
\ No newline at end of file diff --git a/snippets/html-ts-mode/dl b/snippets/html-ts-mode/dl new file mode 100644 index 000000000..4030ed989 --- /dev/null +++ b/snippets/html-ts-mode/dl @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# contributor : Rodrigo Setti +# name:
...
+# group : list +# -- +
+ $0 +
\ No newline at end of file diff --git a/snippets/html-ts-mode/doctype b/snippets/html-ts-mode/doctype new file mode 100644 index 000000000..01ca7545f --- /dev/null +++ b/snippets/html-ts-mode/doctype @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: Doctype HTML 4.01 Strict +# group : meta +# -- + \ No newline at end of file diff --git a/snippets/html-ts-mode/doctype.html5 b/snippets/html-ts-mode/doctype.html5 new file mode 100644 index 000000000..f6f13340b --- /dev/null +++ b/snippets/html-ts-mode/doctype.html5 @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: Doctype HTML 5 +# group : meta +# -- + \ No newline at end of file diff --git a/snippets/html-ts-mode/doctype.xhtml1 b/snippets/html-ts-mode/doctype.xhtml1 new file mode 100644 index 000000000..a76916fd1 --- /dev/null +++ b/snippets/html-ts-mode/doctype.xhtml1 @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: DocType XHTML 1.0 frameset +# group : meta +# -- + \ No newline at end of file diff --git a/snippets/html-ts-mode/doctype.xhtml1_1 b/snippets/html-ts-mode/doctype.xhtml1_1 new file mode 100644 index 000000000..9939d22a9 --- /dev/null +++ b/snippets/html-ts-mode/doctype.xhtml1_1 @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: DocType XHTML 1.1 +# group : meta +# -- + \ No newline at end of file diff --git a/snippets/html-ts-mode/doctype.xhtml1_strict b/snippets/html-ts-mode/doctype.xhtml1_strict new file mode 100644 index 000000000..c5a349058 --- /dev/null +++ b/snippets/html-ts-mode/doctype.xhtml1_strict @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: DocType XHTML 1.0 Strict +# group : meta +# -- + \ No newline at end of file diff --git a/snippets/html-ts-mode/doctype.xhtml1_transitional b/snippets/html-ts-mode/doctype.xhtml1_transitional new file mode 100644 index 000000000..368f4aad7 --- /dev/null +++ b/snippets/html-ts-mode/doctype.xhtml1_transitional @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: DocType XHTML 1.0 Transitional +# group : meta +# -- + \ No newline at end of file diff --git a/snippets/html-ts-mode/dt b/snippets/html-ts-mode/dt new file mode 100644 index 000000000..1a756440f --- /dev/null +++ b/snippets/html-ts-mode/dt @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# contributor : Rodrigo Setti +# name:
...
+# group : list +# -- +
$1
\ No newline at end of file diff --git a/snippets/html-ts-mode/form b/snippets/html-ts-mode/form new file mode 100644 index 000000000..35f6a2a7f --- /dev/null +++ b/snippets/html-ts-mode/form @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# key: form +# name: form +# -- +
+ $0 +
\ No newline at end of file diff --git a/snippets/html-ts-mode/html b/snippets/html-ts-mode/html new file mode 100644 index 000000000..4258b5695 --- /dev/null +++ b/snippets/html-ts-mode/html @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# contributor : Jimmy Wu +# name: ... +# -- + + $0 + \ No newline at end of file diff --git a/snippets/html-ts-mode/html.xmlns b/snippets/html-ts-mode/html.xmlns new file mode 100644 index 000000000..c42b65952 --- /dev/null +++ b/snippets/html-ts-mode/html.xmlns @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# contributor : Jimmy Wu +# name: ... +# -- + + $0 + \ No newline at end of file diff --git a/snippets/html-ts-mode/link.import b/snippets/html-ts-mode/link.import new file mode 100644 index 000000000..13267bc45 --- /dev/null +++ b/snippets/html-ts-mode/link.import @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# contributor : Vikrant Rathore +# name: +# -- + \ No newline at end of file diff --git a/snippets/html-ts-mode/link.stylesheet b/snippets/html-ts-mode/link.stylesheet new file mode 100644 index 000000000..6830b1073 --- /dev/null +++ b/snippets/html-ts-mode/link.stylesheet @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# contributor : Jimmy Wu +# name: +# -- + \ No newline at end of file diff --git a/snippets/html-ts-mode/link.stylesheet-ie b/snippets/html-ts-mode/link.stylesheet-ie new file mode 100644 index 000000000..6d969c6d4 --- /dev/null +++ b/snippets/html-ts-mode/link.stylesheet-ie @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# contributor : Jimmy Wu +# name: +# -- + \ No newline at end of file diff --git a/snippets/html-ts-mode/mailto b/snippets/html-ts-mode/mailto new file mode 100644 index 000000000..a99c64234 --- /dev/null +++ b/snippets/html-ts-mode/mailto @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# contributor : Jimmy Wu +# name: ... +# -- +$0 \ No newline at end of file diff --git a/snippets/html-ts-mode/meta b/snippets/html-ts-mode/meta new file mode 100644 index 000000000..3ea9b3e3e --- /dev/null +++ b/snippets/html-ts-mode/meta @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# contributor : Jimmy Wu +# group : meta +# name: +# -- + \ No newline at end of file diff --git a/snippets/html-ts-mode/meta.http-equiv b/snippets/html-ts-mode/meta.http-equiv new file mode 100644 index 000000000..45827cad6 --- /dev/null +++ b/snippets/html-ts-mode/meta.http-equiv @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# contributor : Jimmy Wu +# name: +# group : meta +# -- + \ No newline at end of file diff --git a/snippets/html-ts-mode/script.javascript b/snippets/html-ts-mode/script.javascript new file mode 100644 index 000000000..ecf97a6df --- /dev/null +++ b/snippets/html-ts-mode/script.javascript @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# key: script +# name: script +# -- + \ No newline at end of file diff --git a/snippets/html-ts-mode/script.javascript-src b/snippets/html-ts-mode/script.javascript-src new file mode 100644 index 000000000..a70de7251 --- /dev/null +++ b/snippets/html-ts-mode/script.javascript-src @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# key: script +# name: script src +# -- + \ No newline at end of file diff --git a/snippets/html-ts-mode/textarea b/snippets/html-ts-mode/textarea new file mode 100644 index 000000000..58cf9ef54 --- /dev/null +++ b/snippets/html-ts-mode/textarea @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# contributor : Jimmy Wu +# name: +# -- + \ No newline at end of file diff --git a/snippets/html-ts-mode/th b/snippets/html-ts-mode/th new file mode 100644 index 000000000..a16f1d3db --- /dev/null +++ b/snippets/html-ts-mode/th @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# contributor : Jimmy Wu +# name: ... +# group : table +# -- +$2 \ No newline at end of file diff --git a/snippets/java-ts-mode/apr_assert b/snippets/java-ts-mode/apr_assert new file mode 100644 index 000000000..a3942be96 --- /dev/null +++ b/snippets/java-ts-mode/apr_assert @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: apr_assert +# key: apr_assert +# -- +if (Globals.useAssertions) { + ${1:assert ..}; +} diff --git a/snippets/java-ts-mode/assert b/snippets/java-ts-mode/assert new file mode 100644 index 000000000..686ffeaeb --- /dev/null +++ b/snippets/java-ts-mode/assert @@ -0,0 +1,5 @@ +# -*- mode: snippet; require-final-newline: nil -*- +# name: assert +# key: as +# -- +assert ${1:expression}; \ No newline at end of file diff --git a/snippets/java-ts-mode/assertEquals b/snippets/java-ts-mode/assertEquals new file mode 100644 index 000000000..ce23dae70 --- /dev/null +++ b/snippets/java-ts-mode/assertEquals @@ -0,0 +1,7 @@ +# -*- mode: snippet; require-final-newline: nil -*- +# name: assertEquals +# key: ae +# group: test +# -- +Assert.assertEquals($1, $2); +$0 \ No newline at end of file diff --git a/snippets/java-ts-mode/cls b/snippets/java-ts-mode/cls new file mode 100644 index 000000000..88f534fa2 --- /dev/null +++ b/snippets/java-ts-mode/cls @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: cls +# key: cls +# -- +class ${1:Class} { + $0 +} \ No newline at end of file diff --git a/snippets/java-ts-mode/constructor b/snippets/java-ts-mode/constructor new file mode 100644 index 000000000..c8c705fbb --- /dev/null +++ b/snippets/java-ts-mode/constructor @@ -0,0 +1,9 @@ +# -*- mode: snippet; require-final-newline: nil -*- +# name: constructor +# key: c +# -- +public ${1:`(file-name-base + (or (buffer-file-name) + (buffer-name)))`}($2) { + $0 +} \ No newline at end of file diff --git a/snippets/java-ts-mode/define test method b/snippets/java-ts-mode/define test method new file mode 100644 index 000000000..fd9daf6dd --- /dev/null +++ b/snippets/java-ts-mode/define test method @@ -0,0 +1,8 @@ +# -*- mode: snippet; require-final-newline: nil -*- +# name: define test method +# key: dt +# -- +@Test +public void test${1:Name}() throws Exception { + $0 +} diff --git a/snippets/java-ts-mode/doc b/snippets/java-ts-mode/doc new file mode 100644 index 000000000..88f556eb6 --- /dev/null +++ b/snippets/java-ts-mode/doc @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: doc +# key: /* +# -- +/** + * ${1:documentation} + */ \ No newline at end of file diff --git a/snippets/java-ts-mode/equals b/snippets/java-ts-mode/equals new file mode 100644 index 000000000..e99096689 --- /dev/null +++ b/snippets/java-ts-mode/equals @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: equals +# key: eq +# -- +public boolean equals(${1:Class} other) { + $0 +} \ No newline at end of file diff --git a/snippets/java-ts-mode/file_class b/snippets/java-ts-mode/file_class new file mode 100644 index 000000000..e0a46f624 --- /dev/null +++ b/snippets/java-ts-mode/file_class @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# name: file_class +# key: file +# -- +public class ${1:`(file-name-base + (or (buffer-file-name) + (buffer-name)))`} { + $0 +} diff --git a/snippets/java-ts-mode/for b/snippets/java-ts-mode/for new file mode 100644 index 000000000..833827bf9 --- /dev/null +++ b/snippets/java-ts-mode/for @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: for +# key: for +# -- +for (${1:int i = 0}; ${2:i < N}; ${3:i++}) { + $0 +} \ No newline at end of file diff --git a/snippets/java-ts-mode/fori b/snippets/java-ts-mode/fori new file mode 100644 index 000000000..a417f2cfc --- /dev/null +++ b/snippets/java-ts-mode/fori @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: fori +# key: fori +# -- +for (${1:Object el} : ${2:iterator}) { + $0 +} diff --git a/snippets/java-ts-mode/getter b/snippets/java-ts-mode/getter new file mode 100644 index 000000000..747f9f4c4 --- /dev/null +++ b/snippets/java-ts-mode/getter @@ -0,0 +1,7 @@ +# -*- mode: snippet; require-final-newline: nil -*- +# name: getter +# key: g +# -- +public ${1:int} get${2:Field}() { + return ${3:field}; +} \ No newline at end of file diff --git a/snippets/java-ts-mode/if b/snippets/java-ts-mode/if new file mode 100644 index 000000000..cae545fab --- /dev/null +++ b/snippets/java-ts-mode/if @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: if +# key: if +# -- +if (${1:condition}) { + $0 +} \ No newline at end of file diff --git a/snippets/java-ts-mode/ife b/snippets/java-ts-mode/ife new file mode 100644 index 000000000..975643fea --- /dev/null +++ b/snippets/java-ts-mode/ife @@ -0,0 +1,10 @@ +# -*- mode: snippet -*- +# name: ife +# key: ife +# -- +if (${1:cond}) { + $2 +} +else { + $3 +} \ No newline at end of file diff --git a/snippets/java-ts-mode/import b/snippets/java-ts-mode/import new file mode 100644 index 000000000..56235a205 --- /dev/null +++ b/snippets/java-ts-mode/import @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: import +# key: imp +# -- +import ${1:System.}; +$0 \ No newline at end of file diff --git a/snippets/java-ts-mode/iterator b/snippets/java-ts-mode/iterator new file mode 100644 index 000000000..69fb2acfc --- /dev/null +++ b/snippets/java-ts-mode/iterator @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: iterator +# key: iterator +# -- +public Iterator<${1:type}> iterator() { + $0 +} diff --git a/snippets/java-ts-mode/javadoc b/snippets/java-ts-mode/javadoc new file mode 100644 index 000000000..5bc9051b3 --- /dev/null +++ b/snippets/java-ts-mode/javadoc @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: javadoc +# key: doc +# -- +/** + * $0 + * + */ \ No newline at end of file diff --git a/snippets/java-ts-mode/lambda b/snippets/java-ts-mode/lambda new file mode 100644 index 000000000..a73a7a5d4 --- /dev/null +++ b/snippets/java-ts-mode/lambda @@ -0,0 +1,5 @@ +# -*- mode: snippet; require-final-newline: nil -*- +# name: lambda +# key: \ +# -- +(${1:args}) -> ${2:expression}; \ No newline at end of file diff --git a/snippets/java-ts-mode/main b/snippets/java-ts-mode/main new file mode 100644 index 000000000..b24e49d8f --- /dev/null +++ b/snippets/java-ts-mode/main @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: main +# key: main +# -- +public static void main(String[] args) { + $0 +} \ No newline at end of file diff --git a/snippets/java-ts-mode/main_class b/snippets/java-ts-mode/main_class new file mode 100644 index 000000000..f94469ac7 --- /dev/null +++ b/snippets/java-ts-mode/main_class @@ -0,0 +1,12 @@ +# -*- mode: snippet -*- +# contributor: L. Guruprasad +# name: main_class +# key: main_class +# -- +class `(file-name-nondirectory (file-name-sans-extension (buffer-file-name)))` +{ +public static void main(String[] args) +{ +$> $0 +} +} diff --git a/snippets/java-ts-mode/method b/snippets/java-ts-mode/method new file mode 100644 index 000000000..0b9301353 --- /dev/null +++ b/snippets/java-ts-mode/method @@ -0,0 +1,7 @@ +# -*- mode: snippet; require-final-newline: nil -*- +# name: method +# key: m +# -- +${1:$$(yas-choose-value '("public" "private" "protected" ""))} ${2:void} ${3:name}(${4:args}) { + $0 +} \ No newline at end of file diff --git a/snippets/java-ts-mode/new b/snippets/java-ts-mode/new new file mode 100644 index 000000000..f06091dcf --- /dev/null +++ b/snippets/java-ts-mode/new @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: new +# key: new +# -- +${1:Type} ${2:obj} = new ${3:Constr}(${4:args}); +$0 \ No newline at end of file diff --git a/snippets/java-ts-mode/override b/snippets/java-ts-mode/override new file mode 100644 index 000000000..9878c85e7 --- /dev/null +++ b/snippets/java-ts-mode/override @@ -0,0 +1,6 @@ +# -*- mode: snippet; require-final-newline: nil -*- +# name: override +# key: o +# -- +@Override +$0 \ No newline at end of file diff --git a/snippets/java-ts-mode/param b/snippets/java-ts-mode/param new file mode 100644 index 000000000..81ef56030 --- /dev/null +++ b/snippets/java-ts-mode/param @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: param +# key: param +# -- +@param ${1:parameter} $0 \ No newline at end of file diff --git a/snippets/java-ts-mode/printf b/snippets/java-ts-mode/printf new file mode 100644 index 000000000..f93c96546 --- /dev/null +++ b/snippets/java-ts-mode/printf @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: printf +# key: printf +# -- +System.out.printf("$0%n"); \ No newline at end of file diff --git a/snippets/java-ts-mode/println b/snippets/java-ts-mode/println new file mode 100644 index 000000000..7dd8f0dae --- /dev/null +++ b/snippets/java-ts-mode/println @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: println +# key: pr +# -- +System.out.println("${1:text}"); +$0 \ No newline at end of file diff --git a/snippets/java-ts-mode/return b/snippets/java-ts-mode/return new file mode 100644 index 000000000..5712e0c15 --- /dev/null +++ b/snippets/java-ts-mode/return @@ -0,0 +1,5 @@ +# -*- mode: snippet; require-final-newline: nil -*- +# name: return +# key: r +# -- +return $0 \ No newline at end of file diff --git a/snippets/java-ts-mode/test b/snippets/java-ts-mode/test new file mode 100644 index 000000000..a37d115b2 --- /dev/null +++ b/snippets/java-ts-mode/test @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: test +# key: test +# -- +@Test +public void test_${1:Case}() { + $0 +} \ No newline at end of file diff --git a/snippets/java-ts-mode/testClass b/snippets/java-ts-mode/testClass new file mode 100644 index 000000000..b01a68f1f --- /dev/null +++ b/snippets/java-ts-mode/testClass @@ -0,0 +1,12 @@ +# -*- mode: snippet -*- +# name: testClass +# key: tc +# -- +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/snippets/java-ts-mode/this b/snippets/java-ts-mode/this new file mode 100644 index 000000000..45201b41e --- /dev/null +++ b/snippets/java-ts-mode/this @@ -0,0 +1,6 @@ +# -*- mode: snippet; require-final-newline: nil -*- +# name: this +# key: . +# -- +this.$1 = $1; +$0 \ No newline at end of file diff --git a/snippets/java-ts-mode/toString b/snippets/java-ts-mode/toString new file mode 100644 index 000000000..0382a9e28 --- /dev/null +++ b/snippets/java-ts-mode/toString @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: toString +# key: toStr +# -- +public String toString() { + $0 +} \ No newline at end of file diff --git a/snippets/java-ts-mode/try b/snippets/java-ts-mode/try new file mode 100644 index 000000000..1a17ba386 --- /dev/null +++ b/snippets/java-ts-mode/try @@ -0,0 +1,11 @@ +# -*- mode: snippet -*- +# name: try +# key: try +# -- +try { + $0 +} +catch (${1:Throwable e}) { + ${2:System.out.println("Error " + e.getMessage()); + e.printStackTrace();} +} diff --git a/snippets/java-ts-mode/value b/snippets/java-ts-mode/value new file mode 100644 index 000000000..7ec38ef7c --- /dev/null +++ b/snippets/java-ts-mode/value @@ -0,0 +1,5 @@ +# -*- mode: snippet; require-final-newline: nil -*- +# name: value +# key: val +# -- +final ${1:int} ${2:n} = $0; \ No newline at end of file diff --git a/snippets/js-ts-mode/al b/snippets/js-ts-mode/al new file mode 100644 index 000000000..c95e0df19 --- /dev/null +++ b/snippets/js-ts-mode/al @@ -0,0 +1,4 @@ +# -*- mode: snippet -*- +# name: alert +# -- +alert($0); \ No newline at end of file diff --git a/snippets/js-ts-mode/anfn b/snippets/js-ts-mode/anfn new file mode 100644 index 000000000..2ccd533c6 --- /dev/null +++ b/snippets/js-ts-mode/anfn @@ -0,0 +1,10 @@ +# -*- mode: snippet -*- +# uuid: 289f0557-4e11-47c5-bcbf-1105bbec41ce +# contributor: Jimmy Yuen Ho Wong +# name: anonymousFunction +# key: anfn +# -- + +(${1:params}) => { + ${2} +} \ No newline at end of file diff --git a/snippets/js-ts-mode/bnd b/snippets/js-ts-mode/bnd new file mode 100644 index 000000000..456707203 --- /dev/null +++ b/snippets/js-ts-mode/bnd @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# uuid: 6788dcb5-8d8e-4e30-a97b-83029ecaf89b +# contributor: Jimmy Yuen Ho Wong +# name: bindThis +# key: bnd +# -- + +this.${1:methodName} = this.${1:methodName}.bind(this)$0 \ No newline at end of file diff --git a/snippets/js-ts-mode/class b/snippets/js-ts-mode/class new file mode 100644 index 000000000..276be8b3a --- /dev/null +++ b/snippets/js-ts-mode/class @@ -0,0 +1,12 @@ +# -*- mode: snippet; require-final-newline: nil -*- +# name: class +# key: class +# -- +class ${1:Class}${2: extends ${3:ParentClass}} { + ${4:constructor(${5:arg}) { + ${6:super(arg);} + $7 + \}} + + $0 +} \ No newline at end of file diff --git a/snippets/js-ts-mode/cmmb b/snippets/js-ts-mode/cmmb new file mode 100644 index 000000000..fd8a68be5 --- /dev/null +++ b/snippets/js-ts-mode/cmmb @@ -0,0 +1,12 @@ +# -*- mode: snippet -*- +# uuid: 983d648f-a7de-4e22-bab9-bca5cd6188a6 +# contributor: Jimmy Yuen Ho Wong +# name: Comment Big Block +# key: cmmb +# -- + +/** +|-------------------------------------------------- +| $1 +|-------------------------------------------------- +*/ \ No newline at end of file diff --git a/snippets/js-ts-mode/com b/snippets/js-ts-mode/com new file mode 100644 index 000000000..cb87c711b --- /dev/null +++ b/snippets/js-ts-mode/com @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: comment (/* ... */) +# -- +/* + * $0 + */ \ No newline at end of file diff --git a/snippets/js-ts-mode/const b/snippets/js-ts-mode/const new file mode 100644 index 000000000..21026a120 --- /dev/null +++ b/snippets/js-ts-mode/const @@ -0,0 +1,5 @@ +# -*- mode: snippet; require-final-newline: nil -*- +# name: const declaration +# key: const +# -- +const ${1:name} = ${2:initial}; \ No newline at end of file diff --git a/snippets/js-ts-mode/dar b/snippets/js-ts-mode/dar new file mode 100644 index 000000000..a4690f6b1 --- /dev/null +++ b/snippets/js-ts-mode/dar @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# uuid: 1867e4d6-1042-422e-b114-174969b9325e +# contributor: Jimmy Yuen Ho Wong +# name: destructingArray +# key: dar +# -- + +const [${1:propertyName}] = ${2:arrayToDestruct} \ No newline at end of file diff --git a/snippets/js-ts-mode/debugger b/snippets/js-ts-mode/debugger new file mode 100644 index 000000000..09af6eb88 --- /dev/null +++ b/snippets/js-ts-mode/debugger @@ -0,0 +1,5 @@ +# -*- mode: snippet; require-final-newline: nil -*- +# name: debugger +# key: dbg +# -- +debugger; \ No newline at end of file diff --git a/snippets/js-ts-mode/dob b/snippets/js-ts-mode/dob new file mode 100644 index 000000000..eda17a3e5 --- /dev/null +++ b/snippets/js-ts-mode/dob @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# uuid: 0a552742-2fa3-4d23-8fe6-fe7f211b642a +# contributor: Jimmy Yuen Ho Wong +# name: destructingObject +# key: dob +# -- + +const {${1:propertyName}} = ${2:objectToDestruct} \ No newline at end of file diff --git a/snippets/js-ts-mode/each b/snippets/js-ts-mode/each new file mode 100644 index 000000000..d24d4d602 --- /dev/null +++ b/snippets/js-ts-mode/each @@ -0,0 +1,6 @@ +# -*- mode: snippet; require-final-newline: nil -*- +# name: each +# -- +${1:collection}.forEach(function (${2:elem}) { + $0 +}); \ No newline at end of file diff --git a/snippets/js-ts-mode/edf b/snippets/js-ts-mode/edf new file mode 100644 index 000000000..ad8c02887 --- /dev/null +++ b/snippets/js-ts-mode/edf @@ -0,0 +1,10 @@ +# -*- mode: snippet -*- +# uuid: 45f3a8b4-7ed0-4d80-aa77-1cf79339b6b6 +# contributor: Jimmy Yuen Ho Wong +# name: exportDefaultFunction +# key: edf +# -- + +export default (${1:params}) => { + $0 +} \ No newline at end of file diff --git a/snippets/js-ts-mode/el b/snippets/js-ts-mode/el new file mode 100644 index 000000000..e59b47495 --- /dev/null +++ b/snippets/js-ts-mode/el @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: else +# -- +else { + $0 +} \ No newline at end of file diff --git a/snippets/js-ts-mode/enf b/snippets/js-ts-mode/enf new file mode 100644 index 000000000..5299a74a2 --- /dev/null +++ b/snippets/js-ts-mode/enf @@ -0,0 +1,10 @@ +# -*- mode: snippet -*- +# uuid: 095f24bf-5c76-4d0b-862e-a1f0ab1e1b95 +# contributor: Jimmy Yuen Ho Wong +# name: exportNamedFunction +# key: enf +# -- + +export const ${1:functionName} = (${2:params}) => { + $0 +} \ No newline at end of file diff --git a/snippets/js-ts-mode/error b/snippets/js-ts-mode/error new file mode 100644 index 000000000..558a237a2 --- /dev/null +++ b/snippets/js-ts-mode/error @@ -0,0 +1,5 @@ +# -*- mode: snippet; require-final-newline: nil -*- +# name: new error +# key: err +# -- +new Error(${1:message}); \ No newline at end of file diff --git a/snippets/js-ts-mode/exa b/snippets/js-ts-mode/exa new file mode 100644 index 000000000..8ccdb8365 --- /dev/null +++ b/snippets/js-ts-mode/exa @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# uuid: 1391f808-8044-4878-b551-9f129330507c +# contributor: Jimmy Yuen Ho Wong +# name: exportAs +# key: exa +# -- + +export { ${2:originalName} as ${3:alias} } from '${1:module}'$0 \ No newline at end of file diff --git a/snippets/js-ts-mode/exd b/snippets/js-ts-mode/exd new file mode 100644 index 000000000..a092d2ed2 --- /dev/null +++ b/snippets/js-ts-mode/exd @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# uuid: b9a77d53-af00-4acc-90e5-0259edef0326 +# contributor: Jimmy Yuen Ho Wong +# name: exportDestructing +# key: exd +# -- + +export { $2 } from '${1:module}'$0 \ No newline at end of file diff --git a/snippets/js-ts-mode/exp b/snippets/js-ts-mode/exp new file mode 100644 index 000000000..eb89eda42 --- /dev/null +++ b/snippets/js-ts-mode/exp @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# uuid: 19643fe0-3063-41cd-b384-9f0a51b2f809 +# contributor: Jimmy Yuen Ho Wong +# name: exportDefault +# key: exp +# -- + +export default $1$0 \ No newline at end of file diff --git a/snippets/js-ts-mode/fin b/snippets/js-ts-mode/fin new file mode 100644 index 000000000..c977bcf9c --- /dev/null +++ b/snippets/js-ts-mode/fin @@ -0,0 +1,10 @@ +# -*- mode: snippet -*- +# uuid: 8d343f0b-28ae-4e2c-84a4-2e557603f28b +# contributor: Jimmy Yuen Ho Wong +# name: forIn +# key: fin +# -- + +for(let ${1:item} in ${2:object}) { + $0 +} \ No newline at end of file diff --git a/snippets/js-ts-mode/flow b/snippets/js-ts-mode/flow new file mode 100644 index 000000000..6f1a38c04 --- /dev/null +++ b/snippets/js-ts-mode/flow @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: /* @flow */ +# key: flow +# -- +/* @flow */ \ No newline at end of file diff --git a/snippets/js-ts-mode/fof b/snippets/js-ts-mode/fof new file mode 100644 index 000000000..a0b276590 --- /dev/null +++ b/snippets/js-ts-mode/fof @@ -0,0 +1,10 @@ +# -*- mode: snippet -*- +# uuid: eec73b34-fb19-4d4c-b4fd-853b2eca6f19 +# contributor: Jimmy Yuen Ho Wong +# name: forOf +# key: fof +# -- + +for(let ${1:item} of ${2:object}) { + $0 +} \ No newline at end of file diff --git a/snippets/js-ts-mode/for b/snippets/js-ts-mode/for new file mode 100644 index 000000000..b3be3a7d6 --- /dev/null +++ b/snippets/js-ts-mode/for @@ -0,0 +1,6 @@ +# -*- mode: snippet; require-final-newline: nil -*- +# name: for +# -- +for (let ${1:i} = ${2:0}; $1 < ${3:collection}.length; $1++) { + $0 +} \ No newline at end of file diff --git a/snippets/js-ts-mode/fre b/snippets/js-ts-mode/fre new file mode 100644 index 000000000..7840a432b --- /dev/null +++ b/snippets/js-ts-mode/fre @@ -0,0 +1,10 @@ +# -*- mode: snippet -*- +# uuid: a59f3383-a176-4f60-a992-0d2b983eaa5c +# contributor: Jimmy Yuen Ho Wong +# name: forEach +# key: fre +# -- + +${1:array}.forEach(${2:currentItem} => { + $0 +}) \ No newline at end of file diff --git a/snippets/js-ts-mode/function b/snippets/js-ts-mode/function new file mode 100644 index 000000000..96621b66d --- /dev/null +++ b/snippets/js-ts-mode/function @@ -0,0 +1,7 @@ +# -*- mode: snippet; require-final-newline: nil -*- +# name: function +# key: f +# -- +function ${1:name}(${2:arg}) { + $0 +} \ No newline at end of file diff --git a/snippets/js-ts-mode/if b/snippets/js-ts-mode/if new file mode 100644 index 000000000..12ebb74aa --- /dev/null +++ b/snippets/js-ts-mode/if @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: if +# -- +if (${1:condition}) { + $0 +} \ No newline at end of file diff --git a/snippets/js-ts-mode/ima b/snippets/js-ts-mode/ima new file mode 100644 index 000000000..397065c16 --- /dev/null +++ b/snippets/js-ts-mode/ima @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# uuid: 7c3ddd59-68e7-456c-a906-4241cdaeaf9e +# contributor: Jimmy Yuen Ho Wong +# name: importAs +# key: ima +# -- + +import { ${2:originalName} as ${3:alias} } from '${1:module}'$0 \ No newline at end of file diff --git a/snippets/js-ts-mode/imd b/snippets/js-ts-mode/imd new file mode 100644 index 000000000..8a573b4d1 --- /dev/null +++ b/snippets/js-ts-mode/imd @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# uuid: 851254b3-d70e-4024-a557-2629d3d73507 +# contributor: Jimmy Yuen Ho Wong +# name: importDestructing +# key: imd +# -- + +import { $2 } from '${1:module}'$0 \ No newline at end of file diff --git a/snippets/js-ts-mode/ime b/snippets/js-ts-mode/ime new file mode 100644 index 000000000..8c08ea50a --- /dev/null +++ b/snippets/js-ts-mode/ime @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# uuid: 13efbfa8-12d3-4570-9602-6d64717d75e3 +# contributor: Jimmy Yuen Ho Wong +# name: importEverything +# key: ime +# -- + +import * as ${2:alias} from '${1:module}'$0 \ No newline at end of file diff --git a/snippets/js-ts-mode/imn b/snippets/js-ts-mode/imn new file mode 100644 index 000000000..aee322143 --- /dev/null +++ b/snippets/js-ts-mode/imn @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# uuid: 39b0065c-1dd5-4214-a612-1fead18dd677 +# contributor: Jimmy Yuen Ho Wong +# name: importNoModuleName +# key: imn +# -- + +import '${1:module}'$0 \ No newline at end of file diff --git a/snippets/js-ts-mode/imp b/snippets/js-ts-mode/imp new file mode 100644 index 000000000..b3cb007e3 --- /dev/null +++ b/snippets/js-ts-mode/imp @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# uuid: fb07fe1d-4cf7-47e9-bca8-51a6438c5d6f +# contributor: Jimmy Yuen Ho Wong +# name: import +# key: imp +# -- + +import ${2:moduleName} from '${1:module}'$0 \ No newline at end of file diff --git a/snippets/js-ts-mode/init b/snippets/js-ts-mode/init new file mode 100644 index 000000000..23cccb410 --- /dev/null +++ b/snippets/js-ts-mode/init @@ -0,0 +1,8 @@ +# -*- mode: snippet; require-final-newline: nil -*- +# name: constructor +# key: init +# -- +constructor(${1:arg}) { + ${2:super(${3:arg});} + $0 +} \ No newline at end of file diff --git a/snippets/js-ts-mode/let b/snippets/js-ts-mode/let new file mode 100644 index 000000000..04238bfbf --- /dev/null +++ b/snippets/js-ts-mode/let @@ -0,0 +1,5 @@ +# -*- mode: snippet; require-final-newline: nil -*- +# name: let declaration +# key: let +# -- +let ${1:name} = ${2:initial}; \ No newline at end of file diff --git a/snippets/js-ts-mode/met b/snippets/js-ts-mode/met new file mode 100644 index 000000000..3a5c2498c --- /dev/null +++ b/snippets/js-ts-mode/met @@ -0,0 +1,7 @@ +# -*- mode: snippet; require-final-newline: nil -*- +# name: method +# key: met +# -- +${1:name}(${2:arg}) { + $0 +} \ No newline at end of file diff --git a/snippets/js-ts-mode/metb b/snippets/js-ts-mode/metb new file mode 100644 index 000000000..19b3830bb --- /dev/null +++ b/snippets/js-ts-mode/metb @@ -0,0 +1,10 @@ +# -*- mode: snippet -*- +# uuid: b8f2656b-94d0-40fc-baf2-d335073ecd54 +# contributor: Jimmy Yuen Ho Wong +# name: bound method +# key: metb +# -- + +${1:methodName} = (${2:params}) => { + $0 +} \ No newline at end of file diff --git a/snippets/js-ts-mode/multiline-comment b/snippets/js-ts-mode/multiline-comment new file mode 100644 index 000000000..e86ef90ca --- /dev/null +++ b/snippets/js-ts-mode/multiline-comment @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: multiline-comment +# key: /** +# -- +/** + * $0 + */ \ No newline at end of file diff --git a/snippets/js-ts-mode/nfn b/snippets/js-ts-mode/nfn new file mode 100644 index 000000000..c0bc98735 --- /dev/null +++ b/snippets/js-ts-mode/nfn @@ -0,0 +1,10 @@ +# -*- mode: snippet -*- +# uuid: 4650c619-bbd9-4496-955a-1d626fdf8bcb +# contributor: Jimmy Yuen Ho Wong +# name: namedFunction +# key: nfn +# -- + +const ${1:name} = (${2:params}) => { + ${3} +} \ No newline at end of file diff --git a/snippets/js-ts-mode/param-comment b/snippets/js-ts-mode/param-comment new file mode 100644 index 000000000..709741947 --- /dev/null +++ b/snippets/js-ts-mode/param-comment @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: param-comment +# key: *@p +#condition: (= (js2-node-type (js2-node-at-point)) js2-COMMENT) +# -- +* @param {${type}} ${comment}. \ No newline at end of file diff --git a/snippets/js-ts-mode/pge b/snippets/js-ts-mode/pge new file mode 100644 index 000000000..e663daf34 --- /dev/null +++ b/snippets/js-ts-mode/pge @@ -0,0 +1,10 @@ +# -*- mode: snippet -*- +# uuid: 4d26710e-cad0-4584-8099-87403d4c43cb +# contributor: Jimmy Yuen Ho Wong +# name: propertyGet +# key: pge +# -- + +get ${1:propertyName}() { + return this.${2:propertyName} +} \ No newline at end of file diff --git a/snippets/js-ts-mode/prom b/snippets/js-ts-mode/prom new file mode 100644 index 000000000..6d2ca4fee --- /dev/null +++ b/snippets/js-ts-mode/prom @@ -0,0 +1,10 @@ +# -*- mode: snippet -*- +# uuid: 1f2ca8a4-dda2-4b88-9377-23ec10760aec +# contributor: Jimmy Yuen Ho Wong +# name: promise +# key: prom +# -- + +return new Promise((resolve, reject) => { + ${1} +}) \ No newline at end of file diff --git a/snippets/js-ts-mode/pse b/snippets/js-ts-mode/pse new file mode 100644 index 000000000..0ab567be1 --- /dev/null +++ b/snippets/js-ts-mode/pse @@ -0,0 +1,10 @@ +# -*- mode: snippet -*- +# uuid: b33dbf56-f2ad-489e-bc7b-1b4c2d1657ea +# contributor: Jimmy Yuen Ho Wong +# name: propertyset +# key: pse +# -- + +set ${1:propertyName}(${2:value}) { + $0 +} \ No newline at end of file diff --git a/snippets/js-ts-mode/return-comment b/snippets/js-ts-mode/return-comment new file mode 100644 index 000000000..95280316b --- /dev/null +++ b/snippets/js-ts-mode/return-comment @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: return-comment +# key: *@r +#condition: (= (js2-node-type (js2-node-at-point)) js2-COMMENT) +# -- +* @return {${type}} \ No newline at end of file diff --git a/snippets/js-ts-mode/sti b/snippets/js-ts-mode/sti new file mode 100644 index 000000000..afa8f05cf --- /dev/null +++ b/snippets/js-ts-mode/sti @@ -0,0 +1,10 @@ +# -*- mode: snippet -*- +# uuid: 596c0e05-ee02-4d02-85e0-64252296629d +# contributor: Jimmy Yuen Ho Wong +# name: setInterval +# key: sti +# -- + +setInterval(() => { + ${2} +}, ${0:intervalInms}) \ No newline at end of file diff --git a/snippets/js-ts-mode/sto b/snippets/js-ts-mode/sto new file mode 100644 index 000000000..492cb6987 --- /dev/null +++ b/snippets/js-ts-mode/sto @@ -0,0 +1,10 @@ +# -*- mode: snippet -*- +# uuid: 6ead1d1a-bf84-4a3d-94fb-59ad97d55414 +# contributor: Jimmy Yuen Ho Wong +# name: setTimeOut +# key: sto +# -- + +setTimeout(() => { + ${2} +}, ${1:delayInms}) \ No newline at end of file diff --git a/snippets/js-ts-mode/switch b/snippets/js-ts-mode/switch new file mode 100644 index 000000000..646d67232 --- /dev/null +++ b/snippets/js-ts-mode/switch @@ -0,0 +1,10 @@ +# -*- mode: snippet; require-final-newline: nil -*- +# name: switch +# key: sw +# -- +switch (${1:condition}) { + case ${2:expression}: + $0 + break; + default: +} \ No newline at end of file diff --git a/snippets/js-ts-mode/try-catch b/snippets/js-ts-mode/try-catch new file mode 100644 index 000000000..30f26d05d --- /dev/null +++ b/snippets/js-ts-mode/try-catch @@ -0,0 +1,11 @@ +# -*- mode: snippet; require-final-newline: nil -*- +# name: try...catch statement +# key: try +# -- +try { + $1 +} catch (err) { + $2 +}${3: finally { + $4 +}} \ No newline at end of file diff --git a/snippets/js-ts-mode/type-inline-comment b/snippets/js-ts-mode/type-inline-comment new file mode 100644 index 000000000..9b148f289 --- /dev/null +++ b/snippets/js-ts-mode/type-inline-comment @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: type-inline-comment +# key: @ty +#condition: (not (= (js2-node-type (js2-node-at-point)) js2-COMMENT)) +# -- +/** @type {${type}} */ \ No newline at end of file diff --git a/snippets/js-ts-mode/type-multiline-comment b/snippets/js-ts-mode/type-multiline-comment new file mode 100644 index 000000000..09cbea99e --- /dev/null +++ b/snippets/js-ts-mode/type-multiline-comment @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: type-multiline-comment +# key: *ty +#condition: (= (js2-node-type (js2-node-at-point)) js2-COMMENT) +# -- +* @type {${type}} \ No newline at end of file diff --git a/snippets/julia-ts-mode/atype b/snippets/julia-ts-mode/atype new file mode 100644 index 000000000..9721a046a --- /dev/null +++ b/snippets/julia-ts-mode/atype @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: abstract type ... end +# key: atype +# contributor: hankail05 +# -- +abstract type ${1:${2:type} <: ${3:supertype}} end$0 \ No newline at end of file diff --git a/snippets/julia-ts-mode/begin b/snippets/julia-ts-mode/begin new file mode 100644 index 000000000..0bbc6732c --- /dev/null +++ b/snippets/julia-ts-mode/begin @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: begin ... end +# key: begin +# contributor: hankail05 +# -- +begin + $0 +end \ No newline at end of file diff --git a/snippets/julia-ts-mode/do b/snippets/julia-ts-mode/do new file mode 100644 index 000000000..80cbabbd3 --- /dev/null +++ b/snippets/julia-ts-mode/do @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: do ... ... end +# key: do +# contributor: hankail05 +# -- +do ${1:x} + $0 +end \ No newline at end of file diff --git a/snippets/julia-ts-mode/for b/snippets/julia-ts-mode/for new file mode 100644 index 000000000..44067bd98 --- /dev/null +++ b/snippets/julia-ts-mode/for @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: for ... ... end +# key: for +# contributor: hankail05 +# -- +for ${1:i} ${2:$$(yas-julia-iteration-keyword-choice)} ${3:1:n} + $0 +end \ No newline at end of file diff --git a/snippets/julia-ts-mode/fun b/snippets/julia-ts-mode/fun new file mode 100644 index 000000000..2235d301a --- /dev/null +++ b/snippets/julia-ts-mode/fun @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: function(...) ... end +# key: fun +# contributor: hankail05 +# -- +function ${1:fun}(${2:args}) + $0 +end \ No newline at end of file diff --git a/snippets/julia-ts-mode/if b/snippets/julia-ts-mode/if new file mode 100644 index 000000000..632730c6f --- /dev/null +++ b/snippets/julia-ts-mode/if @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: if ... ... end +# key: if +# contributor: hankail05 +# -- +if ${1:cond} + $0 +end \ No newline at end of file diff --git a/snippets/julia-ts-mode/ife b/snippets/julia-ts-mode/ife new file mode 100644 index 000000000..f2578d404 --- /dev/null +++ b/snippets/julia-ts-mode/ife @@ -0,0 +1,11 @@ +# -*- mode: snippet -*- +# name: if ... ... else ... end +# key: ife +# contributor: hankail05 +# -- +if ${1:cond} + ${2:true} +else + ${3:false} +end +$0 \ No newline at end of file diff --git a/snippets/julia-ts-mode/let b/snippets/julia-ts-mode/let new file mode 100644 index 000000000..6e95a85fa --- /dev/null +++ b/snippets/julia-ts-mode/let @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: let ... ... end +# key: let +# contributor: hankail05 +# -- +let ${1:x = 0} + $0 +end \ No newline at end of file diff --git a/snippets/julia-ts-mode/macro b/snippets/julia-ts-mode/macro new file mode 100644 index 000000000..e082d4bfa --- /dev/null +++ b/snippets/julia-ts-mode/macro @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: macro(...) ... end +# key: macro +# contributor: hankail05 +# -- +macro ${1:macro}(${2:args}) + $0 +end \ No newline at end of file diff --git a/snippets/julia-ts-mode/module b/snippets/julia-ts-mode/module new file mode 100644 index 000000000..099e7f337 --- /dev/null +++ b/snippets/julia-ts-mode/module @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: module ... ... end +# key: module +# contributor: hankail05 +# -- +module ${1:name} +$0 +end \ No newline at end of file diff --git a/snippets/julia-ts-mode/mutstr b/snippets/julia-ts-mode/mutstr new file mode 100644 index 000000000..e8a3f93b3 --- /dev/null +++ b/snippets/julia-ts-mode/mutstr @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: mutable struct ... end +# key: mutstr +# contributor: hankail05 +# -- +mutable struct ${1:name} + $0 +end \ No newline at end of file diff --git a/snippets/julia-ts-mode/ptype b/snippets/julia-ts-mode/ptype new file mode 100644 index 000000000..d40dd0995 --- /dev/null +++ b/snippets/julia-ts-mode/ptype @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: primitive type ... end +# key: ptype +# contributor: hankail05 +# -- +primitive type ${1:${2:type} <: ${3:supertype}} ${4:bits} end$0 diff --git a/snippets/julia-ts-mode/quote b/snippets/julia-ts-mode/quote new file mode 100644 index 000000000..cc3a2e0bc --- /dev/null +++ b/snippets/julia-ts-mode/quote @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# name: quote ... end +# key: quote +# contributor: hankail05 +# -- +quote + ${1:expr} +end +$0 \ No newline at end of file diff --git a/snippets/julia-ts-mode/struct b/snippets/julia-ts-mode/struct new file mode 100644 index 000000000..37fd6427e --- /dev/null +++ b/snippets/julia-ts-mode/struct @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: struct ... end +# key: struct +# contributor: hankail05 +# -- +struct ${1:name} + $0 +end \ No newline at end of file diff --git a/snippets/julia-ts-mode/try b/snippets/julia-ts-mode/try new file mode 100644 index 000000000..932c86c6c --- /dev/null +++ b/snippets/julia-ts-mode/try @@ -0,0 +1,11 @@ +# -*- mode: snippet -*- +# name: try ... catch ... end +# key: try +# contributor: hankail05 +# -- +try + ${1:expr} +catch ${2:error} + ${3:e_expr} +end +$0 diff --git a/snippets/julia-ts-mode/tryf b/snippets/julia-ts-mode/tryf new file mode 100644 index 000000000..0ebb5e132 --- /dev/null +++ b/snippets/julia-ts-mode/tryf @@ -0,0 +1,13 @@ +# -*- mode: snippet -*- +# name: try ... catch ... finally ... end +# key: try +# contributor: hankail05 +# -- +try + ${1:expr} +catch ${2:error} + ${3:e_expr} +finally + ${4:f_expr} +end +$0 diff --git a/snippets/julia-ts-mode/using b/snippets/julia-ts-mode/using new file mode 100644 index 000000000..cdc8ad4bf --- /dev/null +++ b/snippets/julia-ts-mode/using @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: using ... +# key: using +# contributor: hankail05 +# -- +using ${1:${2:package}:}$0 diff --git a/snippets/julia-ts-mode/while b/snippets/julia-ts-mode/while new file mode 100644 index 000000000..c613e5991 --- /dev/null +++ b/snippets/julia-ts-mode/while @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: while ... ... end +# key: while +# contributor: hankail05 +# -- +while ${1:cond} + $0 +end \ No newline at end of file diff --git a/snippets/markdown-ts-mode/back-quote b/snippets/markdown-ts-mode/back-quote new file mode 100644 index 000000000..519fe1484 --- /dev/null +++ b/snippets/markdown-ts-mode/back-quote @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: Inline Code +# contributor: Peng Deng +# key: ` +# -- +\`${1:Code}\` $0 \ No newline at end of file diff --git a/snippets/markdown-ts-mode/code b/snippets/markdown-ts-mode/code new file mode 100644 index 000000000..4289e72ad --- /dev/null +++ b/snippets/markdown-ts-mode/code @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: Code block +# key: code +# -- +\`\`\`$1 +$0 +\`\`\` diff --git a/snippets/markdown-ts-mode/emphasis b/snippets/markdown-ts-mode/emphasis new file mode 100644 index 000000000..0ef687839 --- /dev/null +++ b/snippets/markdown-ts-mode/emphasis @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: Emphasis +# contributor: Peng Deng +# key: _ +# -- +_${1:Text}_ $0 \ No newline at end of file diff --git a/snippets/markdown-ts-mode/h1.1 b/snippets/markdown-ts-mode/h1.1 new file mode 100644 index 000000000..534337a0b --- /dev/null +++ b/snippets/markdown-ts-mode/h1.1 @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: Header 1 (#) +# contributor: Peng Deng +# key: h1 +# -- +# ${1:Header 1} # + +$0 \ No newline at end of file diff --git a/snippets/markdown-ts-mode/h1.2 b/snippets/markdown-ts-mode/h1.2 new file mode 100644 index 000000000..dbf567c82 --- /dev/null +++ b/snippets/markdown-ts-mode/h1.2 @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# name: Header 1 (=) +# contributor: Peng Deng +# key: h1 +# -- +${1:Header 1} +${1:$(make-string (string-width yas-text) ?\=)} + +$0 \ No newline at end of file diff --git a/snippets/markdown-ts-mode/h2.1 b/snippets/markdown-ts-mode/h2.1 new file mode 100644 index 000000000..7830c97fc --- /dev/null +++ b/snippets/markdown-ts-mode/h2.1 @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: Header 2 (##) +# contributor: Peng Deng +# key: h2 +# -- +## ${1:Header 1} ## + +$0 \ No newline at end of file diff --git a/snippets/markdown-ts-mode/h2.2 b/snippets/markdown-ts-mode/h2.2 new file mode 100644 index 000000000..16baba968 --- /dev/null +++ b/snippets/markdown-ts-mode/h2.2 @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# name: Header 2 (-) +# contributor: Peng Deng +# key: h2 +# -- +${1:Header 2} +${1:$(make-string (string-width yas-text) ?\-)} + +$0 \ No newline at end of file diff --git a/snippets/markdown-ts-mode/h3 b/snippets/markdown-ts-mode/h3 new file mode 100644 index 000000000..ba2a5528c --- /dev/null +++ b/snippets/markdown-ts-mode/h3 @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: Header 3 +# contributor: Peng Deng +# key: h3 +# -- +### ${1:Header 3} ### + +$0 \ No newline at end of file diff --git a/snippets/markdown-ts-mode/h4 b/snippets/markdown-ts-mode/h4 new file mode 100644 index 000000000..d9f5ec6e5 --- /dev/null +++ b/snippets/markdown-ts-mode/h4 @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: Header 4 +# contributor: Peng Deng +# key: h4 +# -- +#### ${1:Header 4} #### + +$0 \ No newline at end of file diff --git a/snippets/markdown-ts-mode/h5 b/snippets/markdown-ts-mode/h5 new file mode 100644 index 000000000..08fc8f17c --- /dev/null +++ b/snippets/markdown-ts-mode/h5 @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: Header 5 +# contributor: Peng Deng +# key: h5 +# -- +##### ${1:Header 5} ##### + +$0 \ No newline at end of file diff --git a/snippets/markdown-ts-mode/h6 b/snippets/markdown-ts-mode/h6 new file mode 100644 index 000000000..24b974d23 --- /dev/null +++ b/snippets/markdown-ts-mode/h6 @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: Header 6 +# contributor: Peng Deng +# key: h6 +# -- +###### ${1:Header 6} ###### + +$0 \ No newline at end of file diff --git a/snippets/markdown-ts-mode/highlight b/snippets/markdown-ts-mode/highlight new file mode 100644 index 000000000..2e47e1815 --- /dev/null +++ b/snippets/markdown-ts-mode/highlight @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: Highlight +# contributor: nguyenvinhlinh +# key: highlight +# -- +{% highlight ${1:language} %} +${0:content} +{% endhighlight %} \ No newline at end of file diff --git a/snippets/markdown-ts-mode/hr.1 b/snippets/markdown-ts-mode/hr.1 new file mode 100644 index 000000000..579ba01ca --- /dev/null +++ b/snippets/markdown-ts-mode/hr.1 @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# name: Horizontal Rule (-) +# contributor: Peng Deng +# key: hr +# -- + +---------- + +$0 \ No newline at end of file diff --git a/snippets/markdown-ts-mode/hr.2 b/snippets/markdown-ts-mode/hr.2 new file mode 100644 index 000000000..4d34e2fa4 --- /dev/null +++ b/snippets/markdown-ts-mode/hr.2 @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# name: Horizontal Rule (*) +# contributor: Peng Deng +# key: hr +# -- + +******* + +$0 \ No newline at end of file diff --git a/snippets/markdown-ts-mode/hyphen b/snippets/markdown-ts-mode/hyphen new file mode 100644 index 000000000..8827292c3 --- /dev/null +++ b/snippets/markdown-ts-mode/hyphen @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: Unordered List - +# contributor: Peng Deng +# key: - +# -- +- ${1:Text} +- $0 diff --git a/snippets/markdown-ts-mode/img b/snippets/markdown-ts-mode/img new file mode 100644 index 000000000..9a0db4fab --- /dev/null +++ b/snippets/markdown-ts-mode/img @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: Image +# contributor: Peng Deng +# key: img +# -- +![${1:Alt Text}](${2:URL} $3) $0 \ No newline at end of file diff --git a/snippets/markdown-ts-mode/link b/snippets/markdown-ts-mode/link new file mode 100644 index 000000000..2b96f56b6 --- /dev/null +++ b/snippets/markdown-ts-mode/link @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: Link +# contributor: Peng Deng +# key: link +# -- +[${1:Link Text}](${2:URL} $3) $0 \ No newline at end of file diff --git a/snippets/markdown-ts-mode/ordered-list b/snippets/markdown-ts-mode/ordered-list new file mode 100644 index 000000000..beb0f2857 --- /dev/null +++ b/snippets/markdown-ts-mode/ordered-list @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: Ordered List +# contributor: Peng Deng +# key: ol +# -- +${1:1}. ${2:Text} +${1:$(number-to-string (1+ (string-to-number yas-text)))}. $0 \ No newline at end of file diff --git a/snippets/markdown-ts-mode/plus b/snippets/markdown-ts-mode/plus new file mode 100644 index 000000000..ebcaab156 --- /dev/null +++ b/snippets/markdown-ts-mode/plus @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: Unordered List + +# contributor: Peng Deng +# key: + +# -- ++ ${1:Text} ++$0 \ No newline at end of file diff --git a/snippets/markdown-ts-mode/rimg b/snippets/markdown-ts-mode/rimg new file mode 100644 index 000000000..85046e4a3 --- /dev/null +++ b/snippets/markdown-ts-mode/rimg @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: Referenced Image +# contributor: Peng Deng +# key: rimg +# -- +![${1:Alt Text}][$2] $0 \ No newline at end of file diff --git a/snippets/markdown-ts-mode/rlb b/snippets/markdown-ts-mode/rlb new file mode 100644 index 000000000..6aabc4a23 --- /dev/null +++ b/snippets/markdown-ts-mode/rlb @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: Reference Label +# contributor: Peng Deng +# key: rlb +# -- +[${1:Reference}]: ${2:URL} $3 +$0 \ No newline at end of file diff --git a/snippets/markdown-ts-mode/rlink b/snippets/markdown-ts-mode/rlink new file mode 100644 index 000000000..cce2e1ad3 --- /dev/null +++ b/snippets/markdown-ts-mode/rlink @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: Reference Link +# contributor: Peng Deng +# key: rlink +# -- +[${1:Link Text}][$2] $0 \ No newline at end of file diff --git a/snippets/markdown-ts-mode/strong-emphasis b/snippets/markdown-ts-mode/strong-emphasis new file mode 100644 index 000000000..bcef3f9e5 --- /dev/null +++ b/snippets/markdown-ts-mode/strong-emphasis @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: Strong emphasis +# contributor: Peng Deng +# key: __ +# -- +**${1:Text}** $0 \ No newline at end of file diff --git a/snippets/markdown-ts-mode/utf8 b/snippets/markdown-ts-mode/utf8 new file mode 100644 index 000000000..0b39d881f --- /dev/null +++ b/snippets/markdown-ts-mode/utf8 @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: UTF-8 encoding +# key: utf8 +# contributor: Thiago Perrotta +# -- + +$0 \ No newline at end of file diff --git a/snippets/nix-ts-mode/buildPhase b/snippets/nix-ts-mode/buildPhase new file mode 100644 index 000000000..b41d8a3b7 --- /dev/null +++ b/snippets/nix-ts-mode/buildPhase @@ -0,0 +1,10 @@ +# -*- mode: snippet -*- +# name: buildPhase +# key: bp +# -- +buildPhase= '' + runHook preBuild +$1 + runHook postBuild +''; +$0 \ No newline at end of file diff --git a/snippets/nix-ts-mode/callPackage b/snippets/nix-ts-mode/callPackage new file mode 100644 index 000000000..eda1fae83 --- /dev/null +++ b/snippets/nix-ts-mode/callPackage @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: callPackage +# key: ca +# -- + $1 = callPackage ../$2/$1 { }; +$0 \ No newline at end of file diff --git a/snippets/nix-ts-mode/checkPhase b/snippets/nix-ts-mode/checkPhase new file mode 100644 index 000000000..20ba6f06d --- /dev/null +++ b/snippets/nix-ts-mode/checkPhase @@ -0,0 +1,10 @@ +# -*- mode: snippet -*- +# name: checkPhase +# key: ch +# -- +checkPhase= '' + runHook preCheck +$1 + runHook postCheck +''; +$0 \ No newline at end of file diff --git a/snippets/nix-ts-mode/configurePhase b/snippets/nix-ts-mode/configurePhase new file mode 100644 index 000000000..b02f70395 --- /dev/null +++ b/snippets/nix-ts-mode/configurePhase @@ -0,0 +1,10 @@ +# -*- mode: snippet -*- +# name: configurePhase +# key: cp +# -- +configurePhase= '' + runHook preConfigure +$1 + runHook postConfigure +''; +$0 \ No newline at end of file diff --git a/snippets/nix-ts-mode/distPhase b/snippets/nix-ts-mode/distPhase new file mode 100644 index 000000000..77872b359 --- /dev/null +++ b/snippets/nix-ts-mode/distPhase @@ -0,0 +1,10 @@ +# -*- mode: snippet -*- +# name: distPhase +# key: dp +# -- +distPhase= '' + runHook preDist +$1 + runHook postDist +''; +$0 \ No newline at end of file diff --git a/snippets/nix-ts-mode/doCheck b/snippets/nix-ts-mode/doCheck new file mode 100644 index 000000000..32316f114 --- /dev/null +++ b/snippets/nix-ts-mode/doCheck @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: doCheck +# key: dc +# -- +doCheck = ${1:$$(yas-auto-next + (yas-choose-value + '("stdenv.buildPlatform.canExecute stdenv.hostPlatform;" + "false;")))} diff --git a/snippets/nix-ts-mode/fixupPhase b/snippets/nix-ts-mode/fixupPhase new file mode 100644 index 000000000..d45091b41 --- /dev/null +++ b/snippets/nix-ts-mode/fixupPhase @@ -0,0 +1,10 @@ +# -*- mode: snippet -*- +# name: fixPhase +# key: fp +# -- +fixupPhase= '' + runHook preFixup +$1 + runHook postFixup +''; +$0 \ No newline at end of file diff --git a/snippets/nix-ts-mode/installCheckPhase b/snippets/nix-ts-mode/installCheckPhase new file mode 100644 index 000000000..47c16df75 --- /dev/null +++ b/snippets/nix-ts-mode/installCheckPhase @@ -0,0 +1,10 @@ +# -*- mode: snippet -*- +# name: installCheckPhase +# key: ic +# -- +installCheckPhase= '' + runHook preInstallCheck +$1 + runHook postInstallCheck +''; +$0 \ No newline at end of file diff --git a/snippets/nix-ts-mode/installPhase b/snippets/nix-ts-mode/installPhase new file mode 100644 index 000000000..261eaf0d6 --- /dev/null +++ b/snippets/nix-ts-mode/installPhase @@ -0,0 +1,14 @@ +# -*- mode: snippet -*- +# name: installPhase +# key: ip +# -- +installPhase= '' + runHook preInstall +${1: mkdir -p \$out/bin + for f in \$(find . -executable -type f); + do + cp \$f \$out/bin/ + done} + runHook postInstall +''; +$0 \ No newline at end of file diff --git a/snippets/nix-ts-mode/package_github b/snippets/nix-ts-mode/package_github new file mode 100644 index 000000000..82ab2efd2 --- /dev/null +++ b/snippets/nix-ts-mode/package_github @@ -0,0 +1,82 @@ +# -*- mode: snippet -*- +# name: package github +# key: pg +# -- +{ lib +, stdenv +, fetchFromGitHub +, $1 +, $2 +}: + +stdenv.mkDerivation rec { + pname = "$3"; + version = "$4"; + + src = fetchFromGitHub { + owner = "$5"; + repo = ${6:pname}; + rev = "${7:v\$\{version\}}"; + sha256 = "${8:\$\{lib.fakeSha256\}}"; + }; + + nativeBuildInputs = [ ${1:$(replace-regexp-in-string " *" " "(subst-char-in-string ?, ? yas-text))} ]; + buildInputs = [ + ${2:$(replace-regexp-in-string " *" " "(subst-char-in-string ?, ? yas-text))} + ]; + + meta = with lib; { + homepage = "https://${9:github.com/$5/$3}"; + description = "$10"; + longDescription = '' + $11 + ''; + license = licenses.${12:$$ + (yas-choose-value '( + "agpl3" + "asl20" + "bsd1" + "bsd2" + "bsd3" + "free" + "gpl2" + "gpl2Only" + "gpl2Plus" + "gpl3" + "gpl3Only" + "gpl3Plus" + "isc" + "lgpl21Only" + "lgpl21Plus" + "lgpl2Only" + "lgpl2Plus" + "lgpl3" + "lgpl3Only" + "mit" + "mpl20" + "ofl" + "unfree" + ))}; + maintainers = with maintainers; [ $12 ]; + platforms = platforms.${13:$$ + (yas-choose-value '( + "all" + "allBut" + "arm" + "cygwin" + "darwin" + "freebsd" + "gnu" + "i686" + "illumos" + "linux" + "mesaPlatforms" + "mips" + "netbsd" + "none" + "openbsd" + "unix" + "x86" + ))}; + }; +} diff --git a/snippets/nix-ts-mode/package_url b/snippets/nix-ts-mode/package_url new file mode 100644 index 000000000..4a2c8d99b --- /dev/null +++ b/snippets/nix-ts-mode/package_url @@ -0,0 +1,80 @@ +# -*- mode: snippet -*- +# name: package url +# key: pu +# -- +{ lib +, stdenv +, fetchurl +$1 +$2 +}: + +stdenv.mkDerivation rec { + pname = "$3"; + version = "$4"; + + src = fetchurl { + url = "$5"; + sha256 = "${6:\$\{lib.fakeSha256\}}"; + }; + + nativeBuildInputs = [ ${1:$(replace-regexp-in-string " *" " "(subst-char-in-string ?, ? yas-text))} ]; + buildInputs = [ + ${2:$(replace-regexp-in-string " *" " "(subst-char-in-string ?, ? yas-text))} + ]; + + meta = with lib; { + homepage = "https://$7"; + description = "$8"; + longDescription = '' + $9 + ''; + license = licenses.${10:$$ + (yas-choose-value '( + "agpl3" + "asl20" + "bsd1" + "bsd2" + "bsd3" + "free" + "gpl2" + "gpl2Only" + "gpl2Plus" + "gpl3" + "gpl3Only" + "gpl3Plus" + "isc" + "lgpl21Only" + "lgpl21Plus" + "lgpl2Only" + "lgpl2Plus" + "lgpl3" + "lgpl3Only" + "mit" + "mpl20" + "ofl" + "unfree" + ))}; + maintainers = with maintainers; [ $11 ]; + platforms = platforms.${12:$$ + (yas-choose-value '( + "all" + "allBut" + "arm" + "cygwin" + "darwin" + "freebsd" + "gnu" + "i686" + "illumos" + "linux" + "mesaPlatforms" + "mips" + "netbsd" + "none" + "openbsd" + "unix" + "x86" + ))}; + }; +} diff --git a/snippets/nix-ts-mode/passthru_update b/snippets/nix-ts-mode/passthru_update new file mode 100644 index 000000000..965cd1d00 --- /dev/null +++ b/snippets/nix-ts-mode/passthru_update @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: passthru_update +# key: pu +# -- +passthru.updateScript = nix-update-script { }; diff --git a/snippets/nix-ts-mode/patchPhase b/snippets/nix-ts-mode/patchPhase new file mode 100644 index 000000000..311444199 --- /dev/null +++ b/snippets/nix-ts-mode/patchPhase @@ -0,0 +1,10 @@ +# -*- mode: snippet -*- +# name: patchPhase +# key: pp +# -- +patchPhase = '' + runHook prePatch + $1 + runHook postPatch +''; +$0 \ No newline at end of file diff --git a/snippets/nix-ts-mode/phases b/snippets/nix-ts-mode/phases new file mode 100644 index 000000000..50326f29d --- /dev/null +++ b/snippets/nix-ts-mode/phases @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: phases +# key: ph +# -- + phases="${1:\$prePhases unpackPhase patchPhase \$preConfigurePhases configurePhase \$preBuildPhases buildPhase checkPhase \$preInstallPhases installPhase fixupPhase installCheckPhase \$preDistPhases distPhase \$postPhases}"; diff --git a/snippets/nix-ts-mode/pkgs_mkshell b/snippets/nix-ts-mode/pkgs_mkshell new file mode 100644 index 000000000..4cbb25015 --- /dev/null +++ b/snippets/nix-ts-mode/pkgs_mkshell @@ -0,0 +1,13 @@ +# -*- mode: snippet -*- +# name: pkgs_mkshell +# key: pms +# -- +pkgs.${1:$$(yas-auto-next (yas-choose-value '("mkShell" "mkShellNoCC")))} { + inputsFrom = [ $3 ]; + + packages = [ $2 ]; + + shellHook = '' + $4 + ''; +}$0 \ No newline at end of file diff --git a/snippets/nix-ts-mode/unpackPhase b/snippets/nix-ts-mode/unpackPhase new file mode 100644 index 000000000..27a7460dc --- /dev/null +++ b/snippets/nix-ts-mode/unpackPhase @@ -0,0 +1,10 @@ +# -*- mode: snippet -*- +# name: unpackPhase +# key: up +# -- +unpackPhase = '' + runHook preUnpack + $1 + runHook postUnpack +''; +$0 diff --git a/snippets/php-ts-mode/__call b/snippets/php-ts-mode/__call new file mode 100644 index 000000000..84e924c54 --- /dev/null +++ b/snippets/php-ts-mode/__call @@ -0,0 +1,10 @@ +# -*- mode: snippet -*- +# contributor: USAMI Kenta +# name: __call() +# key: __call +# group: Magic Methods +# -- +public function __call($name, $args) +{ + $0 +} \ No newline at end of file diff --git a/snippets/php-ts-mode/__callStatic b/snippets/php-ts-mode/__callStatic new file mode 100644 index 000000000..04fb928bf --- /dev/null +++ b/snippets/php-ts-mode/__callStatic @@ -0,0 +1,10 @@ +# -*- mode: snippet -*- +# contributor: USAMI Kenta +# name: __callStatic() +# key: __callStatic +# group: Magic Methods +# -- +public function __callStatic($name, $args) +{ + $0 +} \ No newline at end of file diff --git a/snippets/php-ts-mode/catch b/snippets/php-ts-mode/catch new file mode 100644 index 000000000..dad1821ee --- /dev/null +++ b/snippets/php-ts-mode/catch @@ -0,0 +1,10 @@ +# -*- mode: snippet -*- +# contributor: USAMI Kenta +# name: catch +# key: catch +# group : control structure +# -- +catch (${1:\PDOException} ${2:$e}) { + ${3: + throw $e;} +} \ No newline at end of file diff --git a/snippets/php-ts-mode/cls b/snippets/php-ts-mode/cls new file mode 100644 index 000000000..05d584611 --- /dev/null +++ b/snippets/php-ts-mode/cls @@ -0,0 +1,10 @@ +# -*- mode: snippet -*- +# contributor: USAMI Kenta +# name: class +# key: cls +# group: definitions +# -- +class ${1:`(yas-php-get-class-name-by-file-name)`} +{ + $0 +} \ No newline at end of file diff --git a/snippets/php-ts-mode/clse b/snippets/php-ts-mode/clse new file mode 100644 index 000000000..ceb4330ae --- /dev/null +++ b/snippets/php-ts-mode/clse @@ -0,0 +1,10 @@ +# -*- mode: snippet -*- +# contributor: USAMI Kenta +# name: class extends +# key: clse +# group: definitions +# -- +class ${1:`(yas-php-get-class-name-by-file-name)`} extends ${2:ParentClass} +{ + $0 +} \ No newline at end of file diff --git a/snippets/php-ts-mode/clsi b/snippets/php-ts-mode/clsi new file mode 100644 index 000000000..cc2d39a3e --- /dev/null +++ b/snippets/php-ts-mode/clsi @@ -0,0 +1,10 @@ +# -*- mode: snippet -*- +# contributor: USAMI Kenta +# name: class implements +# key: clsi +# group: definitions +# -- +class ${1:`(yas-php-get-class-name-by-file-name)`} implements ${interface} +{ + $0 +} \ No newline at end of file diff --git a/snippets/php-ts-mode/const b/snippets/php-ts-mode/const new file mode 100644 index 000000000..cdfa62e84 --- /dev/null +++ b/snippets/php-ts-mode/const @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# contributor: USAMI Kenta +# name: const +# key: const +# group: definitions +# -- +const ${1:NAME} = ${2:value}; \ No newline at end of file diff --git a/snippets/php-ts-mode/define b/snippets/php-ts-mode/define new file mode 100644 index 000000000..2c8164594 --- /dev/null +++ b/snippets/php-ts-mode/define @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# contributor: USAMI Kenta +# name: define +# key: define +# group: definitions +# -- +define('${1:NAME}', ${2:value}); \ No newline at end of file diff --git a/snippets/php-ts-mode/doc-comment-multiline b/snippets/php-ts-mode/doc-comment-multiline new file mode 100644 index 000000000..5b6a55d74 --- /dev/null +++ b/snippets/php-ts-mode/doc-comment-multiline @@ -0,0 +1,11 @@ +# -*- mode: snippet -*- +# contributor: USAMI Kenta +# name: PHPDoc (multi-line) +# key: /** +# group: annotation +# -- +/** + * ${1:Summary} + * + *$0 + */ \ No newline at end of file diff --git a/snippets/php-ts-mode/doc-comment-oneline b/snippets/php-ts-mode/doc-comment-oneline new file mode 100644 index 000000000..71a31e427 --- /dev/null +++ b/snippets/php-ts-mode/doc-comment-oneline @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# contributor: USAMI Kenta +# name: Doc comment (one-line) +# key: * +# group: annotation +# -- +/** ${1:Summary} */ diff --git a/snippets/php-ts-mode/else b/snippets/php-ts-mode/else new file mode 100644 index 000000000..7bdbfd349 --- /dev/null +++ b/snippets/php-ts-mode/else @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# contributor: USAMI Kenta +# name: else +# key: else +# group: control structure +# -- +else { + $0 +} \ No newline at end of file diff --git a/snippets/php-ts-mode/elseif b/snippets/php-ts-mode/elseif new file mode 100644 index 000000000..4dcbd8018 --- /dev/null +++ b/snippets/php-ts-mode/elseif @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# contributor: USAMI Kenta +# name: elseif +# key: elseif +# group : control structure +# -- +elseif (${1:condition}) { + $0 +} \ No newline at end of file diff --git a/snippets/php-ts-mode/enum b/snippets/php-ts-mode/enum new file mode 100644 index 000000000..e94b592cb --- /dev/null +++ b/snippets/php-ts-mode/enum @@ -0,0 +1,11 @@ +# -*- mode: snippet -*- +# contributor: takeo obara +# name: enum +# key: enum +# group : definitions +# -- +enum ${1:Name}${2:: type} { + case: ${3:One}; + case: ${4:Two}; +$0 +} diff --git a/snippets/php-ts-mode/fn b/snippets/php-ts-mode/fn new file mode 100644 index 000000000..bb280ccb9 --- /dev/null +++ b/snippets/php-ts-mode/fn @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# contributor: USAMI Kenta +# name: function expr (closure) +# key: fn +# group: definitions +# -- +function (${2:$arg, ...}) ${3:use ($var) }{ + $0 +}`(if (eq (point) (line-end-position)) ";" "")` \ No newline at end of file diff --git a/snippets/php-ts-mode/foreach b/snippets/php-ts-mode/foreach new file mode 100644 index 000000000..769c7d042 --- /dev/null +++ b/snippets/php-ts-mode/foreach @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# contributor: USAMI Kenta +# name: foreach +# key: foreach +# group : control structure +# -- +foreach (${1:$expression} as \$${2:value}) { + $0 +} \ No newline at end of file diff --git a/snippets/php-ts-mode/foreach_value b/snippets/php-ts-mode/foreach_value new file mode 100644 index 000000000..f30958350 --- /dev/null +++ b/snippets/php-ts-mode/foreach_value @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# contributor: USAMI Kenta +# name: foreach (array as $key => $value) +# key: foreach=> +# group : control structure +# -- +foreach (${1:$expression} as \$${2:key} => \$${3:value}) { + $0 +} \ No newline at end of file diff --git a/snippets/php-ts-mode/function b/snippets/php-ts-mode/function new file mode 100644 index 000000000..4d928187d --- /dev/null +++ b/snippets/php-ts-mode/function @@ -0,0 +1,10 @@ +# -*- mode: snippet -*- +# contributor: USAMI Kenta +# name: function statement +# key: function +# group: definitions +# -- +${4:public }function ${1:name}(${2:$arg, ...}) +{ + $0 +} \ No newline at end of file diff --git a/snippets/php-ts-mode/function-return-type b/snippets/php-ts-mode/function-return-type new file mode 100644 index 000000000..c3203a4ea --- /dev/null +++ b/snippets/php-ts-mode/function-return-type @@ -0,0 +1,10 @@ +# -*- mode: snippet -*- +# contributor: USAMI Kenta +# name: function :type +# key: function: +# group : control structure +# -- +${4:public }function ${1:name}(${2:$arg, ...}): ${3:type} +{ + $0 +} \ No newline at end of file diff --git a/snippets/php-ts-mode/get b/snippets/php-ts-mode/get new file mode 100644 index 000000000..82418393f --- /dev/null +++ b/snippets/php-ts-mode/get @@ -0,0 +1,10 @@ +# -*- mode: snippet -*- +# contributor: Robin de Rooij +# name: get +# key: get +# group: definitions +# -- +public function get${1:$(upcase-initials yas-text)}() +{ + return \$this->$1; +} \ No newline at end of file diff --git a/snippets/php-ts-mode/if b/snippets/php-ts-mode/if new file mode 100644 index 000000000..8b0b3b89c --- /dev/null +++ b/snippets/php-ts-mode/if @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# contributor: USAMI Kenta +# name: if +# key: if +# group : control structure +# -- +if (${1:condition}) { + $0 +} \ No newline at end of file diff --git a/snippets/php-ts-mode/interface b/snippets/php-ts-mode/interface new file mode 100644 index 000000000..b8b3a9820 --- /dev/null +++ b/snippets/php-ts-mode/interface @@ -0,0 +1,10 @@ +# -*- mode: snippet -*- +# contributor: USAMI Kenta +# name: interface +# key: interface +# group : definitions +# -- +interface ${1:`(yas-php-get-class-name-by-file-name)`} +{ + $0 +} \ No newline at end of file diff --git a/snippets/php-ts-mode/license-doc b/snippets/php-ts-mode/license-doc new file mode 100644 index 000000000..019d9b35d --- /dev/null +++ b/snippets/php-ts-mode/license-doc @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# contributor: USAMI Kenta +# name: PHPDoc @license +# key: *license +# group: annotation +# -- +* @license ${1:https://www.gnu.org/licenses/gpl-3.0.html} ${2:GPL-3.0}${0: +*} \ No newline at end of file diff --git a/snippets/php-ts-mode/license-doc-apache b/snippets/php-ts-mode/license-doc-apache new file mode 100644 index 000000000..f44526529 --- /dev/null +++ b/snippets/php-ts-mode/license-doc-apache @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# contributor: USAMI Kenta +# name: PHPDoc @license Apache License +# key: *license-apache +# group: annotation +# -- +* @license https://www.apache.org/licenses/LICENSE-2.0 Apache-2.0${0: +*} \ No newline at end of file diff --git a/snippets/php-ts-mode/license-doc-gplv2 b/snippets/php-ts-mode/license-doc-gplv2 new file mode 100644 index 000000000..203d702ff --- /dev/null +++ b/snippets/php-ts-mode/license-doc-gplv2 @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# contributor: USAMI Kenta +# name: PHPDoc @license GPLv2 +# key: *license-gplv2 +# group: annotation +# -- +* @license https://www.gnu.org/licenses/old-licenses/gpl-2.0.html GPL-2.0${0: +*} \ No newline at end of file diff --git a/snippets/php-ts-mode/license-doc-mit b/snippets/php-ts-mode/license-doc-mit new file mode 100644 index 000000000..263a14658 --- /dev/null +++ b/snippets/php-ts-mode/license-doc-mit @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# contributor: USAMI Kenta +# name: PHPDoc @license MIT +# key: *license-mit +# group: annotation +# -- +* @license https://opensource.org/licenses/MIT MIT${0: +*} \ No newline at end of file diff --git a/snippets/php-ts-mode/license-doc-mpl b/snippets/php-ts-mode/license-doc-mpl new file mode 100644 index 000000000..a1b383de8 --- /dev/null +++ b/snippets/php-ts-mode/license-doc-mpl @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# contributor: USAMI Kenta +# name: PHPDoc @license MPL +# key: *license-mpl +# group: annotation +# -- +* @license https://www.mozilla.org/en-US/MPL/2.0/ MPL-2.0${0: +*} \ No newline at end of file diff --git a/snippets/php-ts-mode/match b/snippets/php-ts-mode/match new file mode 100644 index 000000000..d4681118b --- /dev/null +++ b/snippets/php-ts-mode/match @@ -0,0 +1,10 @@ +# -*- mode: snippet -*- +# contributor: takeo obara +# name: match +# key: match +# group : control structure +# -- +match (${1:$var}) { + ${2:$cond} => ${3:$return}, +$0 +}; diff --git a/snippets/php-ts-mode/param-doc b/snippets/php-ts-mode/param-doc new file mode 100644 index 000000000..d1cff1a8b --- /dev/null +++ b/snippets/php-ts-mode/param-doc @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# contributor: USAMI Kenta +# name: PHPDoc @param +# key: *param +# group: annotation +# -- +* @param ${1:type} ${2:$variable} ${3:description}${0: +*} \ No newline at end of file diff --git a/snippets/php-ts-mode/property-doc b/snippets/php-ts-mode/property-doc new file mode 100644 index 000000000..3b88506c9 --- /dev/null +++ b/snippets/php-ts-mode/property-doc @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# contributor: USAMI Kenta +# name: PHPDoc @property +# key: *property +# group: annotation +# -- +* @property ${1:type} ${2:$variable} ${3:description}${0: +*} \ No newline at end of file diff --git a/snippets/php-ts-mode/psysh b/snippets/php-ts-mode/psysh new file mode 100644 index 000000000..fd6afb542 --- /dev/null +++ b/snippets/php-ts-mode/psysh @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# contributor: USAMI Kenta +# name: psysh +# key: psysh +# group: generic +# -- +eval(\Psy\sh()); \ No newline at end of file diff --git a/snippets/php-ts-mode/return-doc b/snippets/php-ts-mode/return-doc new file mode 100644 index 000000000..84f569e19 --- /dev/null +++ b/snippets/php-ts-mode/return-doc @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# contributor: USAMI Kenta +# name: PHPDoc @return +# key: *return +# group: annotation +# -- +* @return ${1:type} ${2:description} \ No newline at end of file diff --git a/snippets/php-ts-mode/set b/snippets/php-ts-mode/set new file mode 100644 index 000000000..5dcbafc5d --- /dev/null +++ b/snippets/php-ts-mode/set @@ -0,0 +1,10 @@ +# -*- mode: snippet -*- +# contributor: Robin de Rooij +# name: set +# key: set +# group: definitions +# -- +public function set${1:$(upcase-initials yas-text)}(\$$1) +{ + \$this->$1 = \$$1; +} \ No newline at end of file diff --git a/snippets/php-ts-mode/stdout b/snippets/php-ts-mode/stdout new file mode 100644 index 000000000..ca3e7aaf5 --- /dev/null +++ b/snippets/php-ts-mode/stdout @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# contributor: USAMI Kenta +# name: fwrite(STDOUT) +# key: stdout +# group: generic +# -- +fwrite(STDOUT, ${1:$var}${2: . PHP_EOL}); \ No newline at end of file diff --git a/snippets/php-ts-mode/strict-types b/snippets/php-ts-mode/strict-types new file mode 100644 index 000000000..b4d0ea4fb --- /dev/null +++ b/snippets/php-ts-mode/strict-types @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# contributor: USAMI Kenta +# name: declare(strict_types=1) +# key: strict_types +# group: definitions +# -- +declare(strict_types=1); diff --git a/snippets/php-ts-mode/switch b/snippets/php-ts-mode/switch new file mode 100644 index 000000000..252aade57 --- /dev/null +++ b/snippets/php-ts-mode/switch @@ -0,0 +1,12 @@ +# -*- mode: snippet -*- +# contributor: USAMI Kenta +# name: switch +# key: switch +# group : control structure +# -- +switch (${1:condition}) { + case ${2:expr}: + $0 + break; + default: +} \ No newline at end of file diff --git a/snippets/php-ts-mode/trait b/snippets/php-ts-mode/trait new file mode 100644 index 000000000..0d25754e0 --- /dev/null +++ b/snippets/php-ts-mode/trait @@ -0,0 +1,10 @@ +# -*- mode: snippet -*- +# contributor: USAMI Kenta +# name: trait +# key: trait +# group : definitions +# -- +trait ${1:`(yas-php-get-class-name-by-file-name)`} +{ + $0 +} \ No newline at end of file diff --git a/snippets/php-ts-mode/try b/snippets/php-ts-mode/try new file mode 100644 index 000000000..4cb22f1a2 --- /dev/null +++ b/snippets/php-ts-mode/try @@ -0,0 +1,12 @@ +# -*- mode: snippet -*- +# contributor: USAMI Kenta +# name: try +# key: try +# group : control structure +# -- +try { + $0 +} catch (${1:\PDOException} ${2:$e}) { + ${3: + throw $e;} +} \ No newline at end of file diff --git a/snippets/php-ts-mode/var-doc b/snippets/php-ts-mode/var-doc new file mode 100644 index 000000000..52932800f --- /dev/null +++ b/snippets/php-ts-mode/var-doc @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# contributor: USAMI Kenta +# name: PHPDoc: var +# key: *var +# group: definitions +# -- +* @var ${type}${0: +*} \ No newline at end of file diff --git a/snippets/php-ts-mode/var-oneline b/snippets/php-ts-mode/var-oneline new file mode 100644 index 000000000..d0fa1b36c --- /dev/null +++ b/snippets/php-ts-mode/var-oneline @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# contributor: USAMI Kenta +# name: PHPDoc: @var (one-line) +# key: @var +# group: definitions +# -- +/** @var ${type} */ diff --git a/snippets/php-ts-mode/vd b/snippets/php-ts-mode/vd new file mode 100644 index 000000000..5a01ad751 --- /dev/null +++ b/snippets/php-ts-mode/vd @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# contributor: USAMI Kenta +# name: var_dump() +# key: vd +# group: generic +# -- +var_dump(${1:$var}); \ No newline at end of file diff --git a/snippets/php-ts-mode/vde b/snippets/php-ts-mode/vde new file mode 100644 index 000000000..998e68caa --- /dev/null +++ b/snippets/php-ts-mode/vde @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# contributor: USAMI Kenta +# name: var_dump() exit +# key: vde +# group: generic +# -- +var_dump(${1:$var});exit(1); \ No newline at end of file diff --git a/snippets/php-ts-mode/ve b/snippets/php-ts-mode/ve new file mode 100644 index 000000000..3b18c2808 --- /dev/null +++ b/snippets/php-ts-mode/ve @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# contributor: USAMI Kenta +# name: var_export() +# key: ve +# group: generic +# -- +var_export(${1:$var}${2:, true}); \ No newline at end of file diff --git a/snippets/python-ts-mode/__abs__ b/snippets/python-ts-mode/__abs__ new file mode 100644 index 000000000..67967be41 --- /dev/null +++ b/snippets/python-ts-mode/__abs__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __abs__ +# key: _abs +# group: Special methods +# -- +def __abs__(self): + return $0 diff --git a/snippets/python-ts-mode/__add__ b/snippets/python-ts-mode/__add__ new file mode 100644 index 000000000..9fef7476d --- /dev/null +++ b/snippets/python-ts-mode/__add__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __add__ +# key: _add +# group: Special methods +# -- +def __add__(self, other): + return $0 diff --git a/snippets/python-ts-mode/__aenter__ b/snippets/python-ts-mode/__aenter__ new file mode 100644 index 000000000..1e6db3bbc --- /dev/null +++ b/snippets/python-ts-mode/__aenter__ @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: __aenter__ +# key: _aenter +# group: Special methods +# -- +async def __aenter__(self): + $0 + return self diff --git a/snippets/python-ts-mode/__aexit__ b/snippets/python-ts-mode/__aexit__ new file mode 100644 index 000000000..78ab8e2be --- /dev/null +++ b/snippets/python-ts-mode/__aexit__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __aexit__ +# key: _aexit +# group: Special methods +# -- +async def __aexit__(self, exc_type, exc_value, traceback): + $0 diff --git a/snippets/python-ts-mode/__aiter__ b/snippets/python-ts-mode/__aiter__ new file mode 100644 index 000000000..3c8e08bab --- /dev/null +++ b/snippets/python-ts-mode/__aiter__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __aiter__ +# key: _aiter +# group: Special methods +# -- +def __aiter__(self): + return $0 diff --git a/snippets/python-ts-mode/__and__ b/snippets/python-ts-mode/__and__ new file mode 100644 index 000000000..74c1c2a56 --- /dev/null +++ b/snippets/python-ts-mode/__and__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __and__ +# key: _and +# group: Special methods +# -- +def __and__(self, other): + return $0 diff --git a/snippets/python-ts-mode/__anext__ b/snippets/python-ts-mode/__anext__ new file mode 100644 index 000000000..aaab2fac8 --- /dev/null +++ b/snippets/python-ts-mode/__anext__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __anext__ +# key: _anext +# group: Special methods +# -- +async def __anext__(self): + return $0 diff --git a/snippets/python-ts-mode/__await__ b/snippets/python-ts-mode/__await__ new file mode 100644 index 000000000..10463d556 --- /dev/null +++ b/snippets/python-ts-mode/__await__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __await__ +# key: _await +# group: Special methods +# -- +def __await__(self): + $0 diff --git a/snippets/python-ts-mode/__bool__ b/snippets/python-ts-mode/__bool__ new file mode 100644 index 000000000..fd53fd36d --- /dev/null +++ b/snippets/python-ts-mode/__bool__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __bool__ +# key: _bool +# group: Special methods +# -- +def __bool__(self): + return $0 diff --git a/snippets/python-ts-mode/__bytes__ b/snippets/python-ts-mode/__bytes__ new file mode 100644 index 000000000..f1ab4c963 --- /dev/null +++ b/snippets/python-ts-mode/__bytes__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __bytes__ +# key: _bytes +# group: Special methods +# -- +def __bytes__(self): + return $0 diff --git a/snippets/python-ts-mode/__call__ b/snippets/python-ts-mode/__call__ new file mode 100644 index 000000000..e807be58a --- /dev/null +++ b/snippets/python-ts-mode/__call__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __call__ +# key: _call +# group: Special methods +# -- +def __call__(self, ${1:*args}): + return $0 diff --git a/snippets/python-ts-mode/__ceil__ b/snippets/python-ts-mode/__ceil__ new file mode 100644 index 000000000..8ea4c81f4 --- /dev/null +++ b/snippets/python-ts-mode/__ceil__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __ceil__ +# key: _ceil +# group: Special methods +# -- +def __ceil__(self): + return $0 diff --git a/snippets/python-ts-mode/__class_getitem__ b/snippets/python-ts-mode/__class_getitem__ new file mode 100644 index 000000000..9a3f99f83 --- /dev/null +++ b/snippets/python-ts-mode/__class_getitem__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __class_getitem__ +# key: _class_getitem +# group: Special methods +# -- +def __class_getitem__(cls, key): + return $0 diff --git a/snippets/python-ts-mode/__cmp__ b/snippets/python-ts-mode/__cmp__ new file mode 100644 index 000000000..ed18d210a --- /dev/null +++ b/snippets/python-ts-mode/__cmp__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __cmp__ +# key: _cmp +# group: Special methods +# -- +def __cmp__(self, other): + return $0 diff --git a/snippets/python-ts-mode/__complex__ b/snippets/python-ts-mode/__complex__ new file mode 100644 index 000000000..69ced6489 --- /dev/null +++ b/snippets/python-ts-mode/__complex__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __complex__ +# key: _complex +# group: Special methods +# -- +def __complex__(self): + return $0 diff --git a/snippets/python-ts-mode/__contains__ b/snippets/python-ts-mode/__contains__ new file mode 100644 index 000000000..4fca9004f --- /dev/null +++ b/snippets/python-ts-mode/__contains__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __contains__ +# key: _contains +# group: Special methods +# -- +def __contains__(self, item): + return $0 diff --git a/snippets/python-ts-mode/__del__ b/snippets/python-ts-mode/__del__ new file mode 100644 index 000000000..1f5673c34 --- /dev/null +++ b/snippets/python-ts-mode/__del__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __del__ +# key: _del +# group: Special methods +# -- +def __del__(self): + $0 diff --git a/snippets/python-ts-mode/__delattr__ b/snippets/python-ts-mode/__delattr__ new file mode 100644 index 000000000..2c8ce9c9e --- /dev/null +++ b/snippets/python-ts-mode/__delattr__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __delattr__ +# key: _delattr +# group: Special methods +# -- +def __delattr__(self, name): + $0 diff --git a/snippets/python-ts-mode/__delete__ b/snippets/python-ts-mode/__delete__ new file mode 100644 index 000000000..700de5b1a --- /dev/null +++ b/snippets/python-ts-mode/__delete__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __delete__ +# key: _delete +# group: Special methods +# -- +def __delete__(self, instance): + $0 diff --git a/snippets/python-ts-mode/__delitem__ b/snippets/python-ts-mode/__delitem__ new file mode 100644 index 000000000..d84351993 --- /dev/null +++ b/snippets/python-ts-mode/__delitem__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __delitem__ +# key: _delitem +# group: Special methods +# -- +def __delitem__(self, key): + $0 diff --git a/snippets/python-ts-mode/__dir__ b/snippets/python-ts-mode/__dir__ new file mode 100644 index 000000000..0eef36432 --- /dev/null +++ b/snippets/python-ts-mode/__dir__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __dir__ +# key: _dir +# group: Special methods +# -- +def __dir__(self): + return $0 diff --git a/snippets/python-ts-mode/__div__ b/snippets/python-ts-mode/__div__ new file mode 100644 index 000000000..3e774f5d8 --- /dev/null +++ b/snippets/python-ts-mode/__div__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __div__ +# key: _div +# group: Special methods +# -- +def __div__(self, other): + return $0 diff --git a/snippets/python-ts-mode/__divmod__ b/snippets/python-ts-mode/__divmod__ new file mode 100644 index 000000000..b2daa769b --- /dev/null +++ b/snippets/python-ts-mode/__divmod__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __divmod__ +# key: _divmod +# group: Special methods +# -- +def __divmod__(self, other): + return $0 diff --git a/snippets/python-ts-mode/__enter__ b/snippets/python-ts-mode/__enter__ new file mode 100644 index 000000000..9508a3276 --- /dev/null +++ b/snippets/python-ts-mode/__enter__ @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# name: __enter__ +# key: _enter +# group: Special methods +# -- +def __enter__(self): + $0 + + return self diff --git a/snippets/python-ts-mode/__eq__ b/snippets/python-ts-mode/__eq__ new file mode 100644 index 000000000..7fdb0b453 --- /dev/null +++ b/snippets/python-ts-mode/__eq__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __eq__ +# key: _eq +# group: Special methods +# -- +def __eq__(self, other): + return $0 diff --git a/snippets/python-ts-mode/__exit__ b/snippets/python-ts-mode/__exit__ new file mode 100644 index 000000000..2bac6f240 --- /dev/null +++ b/snippets/python-ts-mode/__exit__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __exit__ +# key: _exit +# group: Special methods +# -- +def __exit__(self, exc_type, exc_value, traceback): + $0 diff --git a/snippets/python-ts-mode/__float__ b/snippets/python-ts-mode/__float__ new file mode 100644 index 000000000..d1f81ab18 --- /dev/null +++ b/snippets/python-ts-mode/__float__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __float__ +# key: _float +# group: Special methods +# -- +def __float__(self): + return $0 diff --git a/snippets/python-ts-mode/__floor__ b/snippets/python-ts-mode/__floor__ new file mode 100644 index 000000000..9c5941229 --- /dev/null +++ b/snippets/python-ts-mode/__floor__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __floor__ +# key: _floor +# group: Special methods +# -- +def __floor__(self): + return $0 diff --git a/snippets/python-ts-mode/__floordiv__ b/snippets/python-ts-mode/__floordiv__ new file mode 100644 index 000000000..c335b587e --- /dev/null +++ b/snippets/python-ts-mode/__floordiv__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __floordiv__ +# key: _floordiv +# group: Special methods +# -- +def __floordiv__(self, other): + return $0 diff --git a/snippets/python-ts-mode/__format__ b/snippets/python-ts-mode/__format__ new file mode 100644 index 000000000..efbe00c01 --- /dev/null +++ b/snippets/python-ts-mode/__format__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __format__ +# key: _format +# group: Special methods +# -- +def __format__(self, format_spec): + return $0 diff --git a/snippets/python-ts-mode/__ge__ b/snippets/python-ts-mode/__ge__ new file mode 100644 index 000000000..97f687303 --- /dev/null +++ b/snippets/python-ts-mode/__ge__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __ge__ +# key: _ge +# group: Special methods +# -- +def __ge__(self, other): + return $0 diff --git a/snippets/python-ts-mode/__get__ b/snippets/python-ts-mode/__get__ new file mode 100644 index 000000000..3df0d71dd --- /dev/null +++ b/snippets/python-ts-mode/__get__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __get__ +# key: _get +# group: Special methods +# -- +def __get__(self, instance, owner=None): + return $0 diff --git a/snippets/python-ts-mode/__getattr__ b/snippets/python-ts-mode/__getattr__ new file mode 100644 index 000000000..110d0d017 --- /dev/null +++ b/snippets/python-ts-mode/__getattr__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __getattr__ +# key: _getattr +# group: Special methods +# -- +def __getattr__(self, name): + return $0 diff --git a/snippets/python-ts-mode/__getattribute__ b/snippets/python-ts-mode/__getattribute__ new file mode 100644 index 000000000..22935eb8e --- /dev/null +++ b/snippets/python-ts-mode/__getattribute__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __getattribute__ +# key: _getattribute +# group: Special methods +# -- +def __getattribute__(self, name): + return $0 diff --git a/snippets/python-ts-mode/__getitem__ b/snippets/python-ts-mode/__getitem__ new file mode 100644 index 000000000..cd0877551 --- /dev/null +++ b/snippets/python-ts-mode/__getitem__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __getitem__ +# key: _getitem +# group: Special methods +# -- +def __getitem__(self, key): + return $0 diff --git a/snippets/python-ts-mode/__gt__ b/snippets/python-ts-mode/__gt__ new file mode 100644 index 000000000..527717eb7 --- /dev/null +++ b/snippets/python-ts-mode/__gt__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __gt__ +# key: _gt +# group: Special methods +# -- +def __gt__(self, other): + return $0 diff --git a/snippets/python-ts-mode/__hash__ b/snippets/python-ts-mode/__hash__ new file mode 100644 index 000000000..e059f5a82 --- /dev/null +++ b/snippets/python-ts-mode/__hash__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __hash__ +# key: _hash +# group: Special methods +# -- +def __hash__(self): + return $0 diff --git a/snippets/python-ts-mode/__iadd__ b/snippets/python-ts-mode/__iadd__ new file mode 100644 index 000000000..77108c267 --- /dev/null +++ b/snippets/python-ts-mode/__iadd__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __iadd__ +# key: _iadd +# group: Special methods +# -- +def __iadd__(self, other): + return $0 diff --git a/snippets/python-ts-mode/__iand__ b/snippets/python-ts-mode/__iand__ new file mode 100644 index 000000000..8b61e1cff --- /dev/null +++ b/snippets/python-ts-mode/__iand__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __iand__ +# key: _iand +# group: Special methods +# -- +def __iand__(self, other): + return $0 diff --git a/snippets/python-ts-mode/__idiv__ b/snippets/python-ts-mode/__idiv__ new file mode 100644 index 000000000..c9e5609f4 --- /dev/null +++ b/snippets/python-ts-mode/__idiv__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __idiv__ +# key: _idiv +# group: Special methods +# -- +def __idiv__(self, other): + return $0 diff --git a/snippets/python-ts-mode/__ifloordiv__ b/snippets/python-ts-mode/__ifloordiv__ new file mode 100644 index 000000000..fd40fd280 --- /dev/null +++ b/snippets/python-ts-mode/__ifloordiv__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __ifloordiv__ +# key: _ifloordiv +# group: Special methods +# -- +def __ifloordiv__(self, other): + return $0 diff --git a/snippets/python-ts-mode/__ilshift__ b/snippets/python-ts-mode/__ilshift__ new file mode 100644 index 000000000..8e4576337 --- /dev/null +++ b/snippets/python-ts-mode/__ilshift__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __ilshift__ +# key: _ilshift +# group: Special methods +# -- +def __ilshift__(self, other): + return $0 diff --git a/snippets/python-ts-mode/__imatmul__ b/snippets/python-ts-mode/__imatmul__ new file mode 100644 index 000000000..e162beede --- /dev/null +++ b/snippets/python-ts-mode/__imatmul__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __imatmul__ +# key: _imatmul +# group: Special methods +# -- +def __imatmul__(self, other): + return $0 diff --git a/snippets/python-ts-mode/__imod__ b/snippets/python-ts-mode/__imod__ new file mode 100644 index 000000000..5d3f70e6b --- /dev/null +++ b/snippets/python-ts-mode/__imod__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __imod__ +# key: _imod +# group: Special methods +# -- +def __imod__(self, other): + return $0 diff --git a/snippets/python-ts-mode/__imul__ b/snippets/python-ts-mode/__imul__ new file mode 100644 index 000000000..ecf66b6e6 --- /dev/null +++ b/snippets/python-ts-mode/__imul__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __imul__ +# key: _imul +# group: Special methods +# -- +def __imul__(self, other): + return $0 diff --git a/snippets/python-ts-mode/__index__ b/snippets/python-ts-mode/__index__ new file mode 100644 index 000000000..e03b1c7f0 --- /dev/null +++ b/snippets/python-ts-mode/__index__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __index__ +# key: _index +# group: Special methods +# -- +def __index__(self): + return $0 diff --git a/snippets/python-ts-mode/__init__ b/snippets/python-ts-mode/__init__ new file mode 100644 index 000000000..17fcddfd5 --- /dev/null +++ b/snippets/python-ts-mode/__init__ @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: __init__ +# key: _init +# group : definitions +# -- +def __init__(self${1:, args}): + ${2:"${3:docstring}" + }$0 diff --git a/snippets/python-ts-mode/__init_subclass__ b/snippets/python-ts-mode/__init_subclass__ new file mode 100644 index 000000000..371f264c2 --- /dev/null +++ b/snippets/python-ts-mode/__init_subclass__ @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: __init_subclass__ +# key: _init_subclass +# group: Special methods +# -- +def __init_subclass__(cls, /${1:, param}, **kwargs): + super().__init_subclass__(**kwargs) + $0 diff --git a/snippets/python-ts-mode/__instancecheck__ b/snippets/python-ts-mode/__instancecheck__ new file mode 100644 index 000000000..8a5e42975 --- /dev/null +++ b/snippets/python-ts-mode/__instancecheck__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __instancecheck__ +# key: _instancecheck +# group: Special methods +# -- +def __instancecheck__(self, instance): + return $0 diff --git a/snippets/python-ts-mode/__int__ b/snippets/python-ts-mode/__int__ new file mode 100644 index 000000000..01224927e --- /dev/null +++ b/snippets/python-ts-mode/__int__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __int__ +# key: _int +# group: Special methods +# -- +def __int__(self): + $0 diff --git a/snippets/python-ts-mode/__invert__ b/snippets/python-ts-mode/__invert__ new file mode 100644 index 000000000..e5e0a2de8 --- /dev/null +++ b/snippets/python-ts-mode/__invert__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __invert__ +# key: _invert +# group: Special methods +# -- +def __invert__(self): + return $0 diff --git a/snippets/python-ts-mode/__ior__ b/snippets/python-ts-mode/__ior__ new file mode 100644 index 000000000..07ce0dcac --- /dev/null +++ b/snippets/python-ts-mode/__ior__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __ior__ +# key: _ior +# group: Special methods +# -- +def __ior__(self, other): + return $0 diff --git a/snippets/python-ts-mode/__ipow__ b/snippets/python-ts-mode/__ipow__ new file mode 100644 index 000000000..8f0ea5d59 --- /dev/null +++ b/snippets/python-ts-mode/__ipow__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __ipow__ +# key: _ipow +# group: Special methods +# -- +def __ipow__(self, other): + return $0 diff --git a/snippets/python-ts-mode/__irshift__ b/snippets/python-ts-mode/__irshift__ new file mode 100644 index 000000000..b250a5a96 --- /dev/null +++ b/snippets/python-ts-mode/__irshift__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __irshift__ +# key: _irshift +# group: Special methods +# -- +def __irshift__(self, other): + return $0 diff --git a/snippets/python-ts-mode/__isub__ b/snippets/python-ts-mode/__isub__ new file mode 100644 index 000000000..abd0888c5 --- /dev/null +++ b/snippets/python-ts-mode/__isub__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __isub__ +# key: _isub +# group: Special methods +# -- +def __isub__(self, other): + return $0 diff --git a/snippets/python-ts-mode/__iter__ b/snippets/python-ts-mode/__iter__ new file mode 100644 index 000000000..29414ad27 --- /dev/null +++ b/snippets/python-ts-mode/__iter__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __iter__ +# key: _iter +# group: Special methods +# -- +def __iter__(self): + $0 diff --git a/snippets/python-ts-mode/__itruediv__ b/snippets/python-ts-mode/__itruediv__ new file mode 100644 index 000000000..3332f321e --- /dev/null +++ b/snippets/python-ts-mode/__itruediv__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __itruediv__ +# key: _itruediv +# group: Special methods +# -- +def __itruediv__(self, other): + return $0 diff --git a/snippets/python-ts-mode/__ixor__ b/snippets/python-ts-mode/__ixor__ new file mode 100644 index 000000000..dae309506 --- /dev/null +++ b/snippets/python-ts-mode/__ixor__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __ixor__ +# key: _ixor +# group: Special methods +# -- +def __ixor__(self, other): + return $0 diff --git a/snippets/python-ts-mode/__le__ b/snippets/python-ts-mode/__le__ new file mode 100644 index 000000000..774188b25 --- /dev/null +++ b/snippets/python-ts-mode/__le__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __le__ +# key: _le +# group: Special methods +# -- +def __le__(self, other): + return $0 diff --git a/snippets/python-ts-mode/__len__ b/snippets/python-ts-mode/__len__ new file mode 100644 index 000000000..e5544cb24 --- /dev/null +++ b/snippets/python-ts-mode/__len__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __len__ +# key: _len +# group: Special methods +# -- +def __len__(self): + return $0 diff --git a/snippets/python-ts-mode/__length_hint__ b/snippets/python-ts-mode/__length_hint__ new file mode 100644 index 000000000..4725963ac --- /dev/null +++ b/snippets/python-ts-mode/__length_hint__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __length_hint__ +# key: _length_hint +# group: Special methods +# -- +def __length_hint__(self): + return $0 diff --git a/snippets/python-ts-mode/__lshift__ b/snippets/python-ts-mode/__lshift__ new file mode 100644 index 000000000..bfb4cc2d9 --- /dev/null +++ b/snippets/python-ts-mode/__lshift__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __lshift__ +# key: _lshift +# group: Special methods +# -- +def __lshift__(self, other): + return $0 diff --git a/snippets/python-ts-mode/__lt__ b/snippets/python-ts-mode/__lt__ new file mode 100644 index 000000000..8c34b05d5 --- /dev/null +++ b/snippets/python-ts-mode/__lt__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __lt__ +# key: _lt +# group: Special methods +# -- +def __lt__(self, other): + return $0 diff --git a/snippets/python-ts-mode/__matmul__ b/snippets/python-ts-mode/__matmul__ new file mode 100644 index 000000000..983d29bc5 --- /dev/null +++ b/snippets/python-ts-mode/__matmul__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __matmul__ +# key: _matmul +# group: Special methods +# -- +def __matmul__(self, other): + return $0 diff --git a/snippets/python-ts-mode/__missing__ b/snippets/python-ts-mode/__missing__ new file mode 100644 index 000000000..2a239a077 --- /dev/null +++ b/snippets/python-ts-mode/__missing__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __missing__ +# key: _missing +# group: Special methods +# -- +def __missing__(self, key): + return $0 diff --git a/snippets/python-ts-mode/__mod__ b/snippets/python-ts-mode/__mod__ new file mode 100644 index 000000000..22a987e48 --- /dev/null +++ b/snippets/python-ts-mode/__mod__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __mod__ +# key: _mod +# group: Special methods +# -- +def __mod__(self, other): + return $0 diff --git a/snippets/python-ts-mode/__mul__ b/snippets/python-ts-mode/__mul__ new file mode 100644 index 000000000..d8fae7c45 --- /dev/null +++ b/snippets/python-ts-mode/__mul__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __mul__ +# key: _mul +# group: Special methods +# -- +def __mul__(self, other): + return $0 diff --git a/snippets/python-ts-mode/__ne__ b/snippets/python-ts-mode/__ne__ new file mode 100644 index 000000000..0ed5f8f62 --- /dev/null +++ b/snippets/python-ts-mode/__ne__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __ne__ +# key: _ne +# group: Special methods +# -- +def __ne__(self, other): + return $0 diff --git a/snippets/python-ts-mode/__neg__ b/snippets/python-ts-mode/__neg__ new file mode 100644 index 000000000..7e56f6b51 --- /dev/null +++ b/snippets/python-ts-mode/__neg__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __neg__ +# key: _neg +# group: Special methods +# -- +def __neg__(self): + return $0 diff --git a/snippets/python-ts-mode/__new__ b/snippets/python-ts-mode/__new__ new file mode 100644 index 000000000..28ccc0b3e --- /dev/null +++ b/snippets/python-ts-mode/__new__ @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: __new__ +# key: _new +# group: Special methods +# -- +def __new__(mcs, name, bases, dct): + $0 + return type.__new__(mcs, name, bases, dct) diff --git a/snippets/python-ts-mode/__next__ b/snippets/python-ts-mode/__next__ new file mode 100644 index 000000000..2f22eff76 --- /dev/null +++ b/snippets/python-ts-mode/__next__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __next__ +# key: _next +# group: Special methods +# -- +def __next__(self): + $0 diff --git a/snippets/python-ts-mode/__or__ b/snippets/python-ts-mode/__or__ new file mode 100644 index 000000000..f6589061a --- /dev/null +++ b/snippets/python-ts-mode/__or__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __or__ +# key: _or +# group: Special methods +# -- +def __or__(self, other): + return $0 diff --git a/snippets/python-ts-mode/__pos__ b/snippets/python-ts-mode/__pos__ new file mode 100644 index 000000000..de08b0975 --- /dev/null +++ b/snippets/python-ts-mode/__pos__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __pos__ +# key: _pos +# group: Special methods +# -- +def __pos__(self): + return $0 diff --git a/snippets/python-ts-mode/__pow__ b/snippets/python-ts-mode/__pow__ new file mode 100644 index 000000000..4006c0a0e --- /dev/null +++ b/snippets/python-ts-mode/__pow__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __pow__ +# key: _pow +# group: Special methods +# -- +def __pow__(self, other, modulo=None): + return $0 diff --git a/snippets/python-ts-mode/__prepare__ b/snippets/python-ts-mode/__prepare__ new file mode 100644 index 000000000..0041ab06b --- /dev/null +++ b/snippets/python-ts-mode/__prepare__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __prepare__ +# key: _prepare +# group: Special methods +# -- +def __prepare__(name, bases, **kwds): + return ${0:\{\}} diff --git a/snippets/python-ts-mode/__radd__ b/snippets/python-ts-mode/__radd__ new file mode 100644 index 000000000..5fa27d13e --- /dev/null +++ b/snippets/python-ts-mode/__radd__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __radd__ +# key: _radd +# group: Special methods +# -- +def __radd__(self, other): + return $0 diff --git a/snippets/python-ts-mode/__rand__ b/snippets/python-ts-mode/__rand__ new file mode 100644 index 000000000..e3156ef71 --- /dev/null +++ b/snippets/python-ts-mode/__rand__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __rand__ +# key: _rand +# group: Special methods +# -- +def __rand__(self, other): + return $0 diff --git a/snippets/python-ts-mode/__rdivmod__ b/snippets/python-ts-mode/__rdivmod__ new file mode 100644 index 000000000..4fc1ccb39 --- /dev/null +++ b/snippets/python-ts-mode/__rdivmod__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __rdivmod__ +# key: _rdivmod +# group: Special methods +# -- +def __rdivmod__(self, other): + return $0 diff --git a/snippets/python-ts-mode/__repr__ b/snippets/python-ts-mode/__repr__ new file mode 100644 index 000000000..85cb80f04 --- /dev/null +++ b/snippets/python-ts-mode/__repr__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __repr__ +# key: _repr +# group: Special methods +# -- +def __repr__(self): + return $0 diff --git a/snippets/python-ts-mode/__reversed__ b/snippets/python-ts-mode/__reversed__ new file mode 100644 index 000000000..ff2a5a12a --- /dev/null +++ b/snippets/python-ts-mode/__reversed__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __reversed__ +# key: _reversed +# group: Special methods +# -- +def __reversed__(self): + return $0 diff --git a/snippets/python-ts-mode/__rfloordiv__ b/snippets/python-ts-mode/__rfloordiv__ new file mode 100644 index 000000000..cb5375df6 --- /dev/null +++ b/snippets/python-ts-mode/__rfloordiv__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __rfloordiv__ +# key: _rfloordiv +# group: Special methods +# -- +def __rfloordiv__(self, other): + return $0 diff --git a/snippets/python-ts-mode/__rlshift__ b/snippets/python-ts-mode/__rlshift__ new file mode 100644 index 000000000..64a676196 --- /dev/null +++ b/snippets/python-ts-mode/__rlshift__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __rlshift__ +# key: _rlshift +# group: Special methods +# -- +def __rlshift__(self, other): + return $0 diff --git a/snippets/python-ts-mode/__rmatmul__ b/snippets/python-ts-mode/__rmatmul__ new file mode 100644 index 000000000..2acfe418f --- /dev/null +++ b/snippets/python-ts-mode/__rmatmul__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __rmatmul__ +# key: _rmatmul +# group: Special methods +# -- +def __rmatmul__(self, other): + return $0 diff --git a/snippets/python-ts-mode/__rmod__ b/snippets/python-ts-mode/__rmod__ new file mode 100644 index 000000000..1b4e035ef --- /dev/null +++ b/snippets/python-ts-mode/__rmod__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __rmod__ +# key: _rmod +# group: Special methods +# -- +def __rmod__(self, other): + return $0 diff --git a/snippets/python-ts-mode/__rmul__ b/snippets/python-ts-mode/__rmul__ new file mode 100644 index 000000000..459d5323e --- /dev/null +++ b/snippets/python-ts-mode/__rmul__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __rmul__ +# key: _rmul +# group: Special methods +# -- +def __rmul__(self, other): + return $0 diff --git a/snippets/python-ts-mode/__ror__ b/snippets/python-ts-mode/__ror__ new file mode 100644 index 000000000..91293cbd6 --- /dev/null +++ b/snippets/python-ts-mode/__ror__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __ror__ +# key: _ror +# group: Special methods +# -- +def __ror__(self, other): + return $0 diff --git a/snippets/python-ts-mode/__round__ b/snippets/python-ts-mode/__round__ new file mode 100644 index 000000000..5d6c3f1da --- /dev/null +++ b/snippets/python-ts-mode/__round__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __round__ +# key: _round +# group: Special methods +# -- +def __round__(self, ndigits=None): + return $0 diff --git a/snippets/python-ts-mode/__rpow__ b/snippets/python-ts-mode/__rpow__ new file mode 100644 index 000000000..2521f161c --- /dev/null +++ b/snippets/python-ts-mode/__rpow__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __rpow__ +# key: _rpow +# group: Special methods +# -- +def __rpow__(self, other): + return $0 diff --git a/snippets/python-ts-mode/__rrshift__ b/snippets/python-ts-mode/__rrshift__ new file mode 100644 index 000000000..78f4ae7e9 --- /dev/null +++ b/snippets/python-ts-mode/__rrshift__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __rrshift__ +# key: _rrshift +# group: Special methods +# -- +def __rrshift__(self, other): + return $0 diff --git a/snippets/python-ts-mode/__rshift__ b/snippets/python-ts-mode/__rshift__ new file mode 100644 index 000000000..061c396b8 --- /dev/null +++ b/snippets/python-ts-mode/__rshift__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __rshift__ +# key: _rshift +# group: Special methods +# -- +def __rshift__(self, other): + return $0 diff --git a/snippets/python-ts-mode/__rsub__ b/snippets/python-ts-mode/__rsub__ new file mode 100644 index 000000000..1d7b24325 --- /dev/null +++ b/snippets/python-ts-mode/__rsub__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __rsub__ +# key: _rsub +# group: Special methods +# -- +def __rsub__(self, other): + return $0 diff --git a/snippets/python-ts-mode/__rtruediv__ b/snippets/python-ts-mode/__rtruediv__ new file mode 100644 index 000000000..a0cba2cd4 --- /dev/null +++ b/snippets/python-ts-mode/__rtruediv__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __rtruediv__ +# key: _rtruediv +# group: Special methods +# -- +def __rtruediv__(self, other): + return $0 diff --git a/snippets/python-ts-mode/__rxor__ b/snippets/python-ts-mode/__rxor__ new file mode 100644 index 000000000..b5473ad25 --- /dev/null +++ b/snippets/python-ts-mode/__rxor__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __rxor__ +# key: _rxor +# group: Special methods +# -- +def __rxor__(self, other): + return $0 diff --git a/snippets/python-ts-mode/__set__ b/snippets/python-ts-mode/__set__ new file mode 100644 index 000000000..19572c15f --- /dev/null +++ b/snippets/python-ts-mode/__set__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __set__ +# key: _set +# group: Special methods +# -- +def __set__(self, instance, value): + $0 diff --git a/snippets/python-ts-mode/__set_name__ b/snippets/python-ts-mode/__set_name__ new file mode 100644 index 000000000..5bba1fec6 --- /dev/null +++ b/snippets/python-ts-mode/__set_name__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __set_name__ +# key: _set_name +# group: Special methods +# -- +def __set_name__(self, owner, name): + $0 diff --git a/snippets/python-ts-mode/__setattr__ b/snippets/python-ts-mode/__setattr__ new file mode 100644 index 000000000..5311cf0ee --- /dev/null +++ b/snippets/python-ts-mode/__setattr__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __setattr__ +# key: _setattr +# group: Special methods +# -- +def __setattr__(self, name, value): + $0 diff --git a/snippets/python-ts-mode/__setitem__ b/snippets/python-ts-mode/__setitem__ new file mode 100644 index 000000000..0287f0e5f --- /dev/null +++ b/snippets/python-ts-mode/__setitem__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __setitem__ +# key: _setitem +# group: Special methods +# -- +def __setitem__(self, key, value): + $0 diff --git a/snippets/python-ts-mode/__slots__ b/snippets/python-ts-mode/__slots__ new file mode 100644 index 000000000..e7ea51e50 --- /dev/null +++ b/snippets/python-ts-mode/__slots__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __slots__ +# key: _slots +# group: Class attributes +# -- +__slots__ = ($1) +$0 diff --git a/snippets/python-ts-mode/__str__ b/snippets/python-ts-mode/__str__ new file mode 100644 index 000000000..f623df7ee --- /dev/null +++ b/snippets/python-ts-mode/__str__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __str__ +# key: _str +# group: Special methods +# -- +def __str__(self): + return $0 diff --git a/snippets/python-ts-mode/__sub__ b/snippets/python-ts-mode/__sub__ new file mode 100644 index 000000000..d21d13c9c --- /dev/null +++ b/snippets/python-ts-mode/__sub__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __sub__ +# key: _sub +# group: Special methods +# -- +def __sub__(self, other): + return $0 diff --git a/snippets/python-ts-mode/__subclasscheck__ b/snippets/python-ts-mode/__subclasscheck__ new file mode 100644 index 000000000..0f3a61d42 --- /dev/null +++ b/snippets/python-ts-mode/__subclasscheck__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __subclasscheck__ +# key: _subclasscheck +# group: Special methods +# -- +def __subclasscheck__(self, instance): + return $0 diff --git a/snippets/python-ts-mode/__truediv__ b/snippets/python-ts-mode/__truediv__ new file mode 100644 index 000000000..00181b14d --- /dev/null +++ b/snippets/python-ts-mode/__truediv__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __truediv__ +# key: _truediv +# group: Special methods +# -- +def __truediv__(self, other): + return $0 diff --git a/snippets/python-ts-mode/__trunc__ b/snippets/python-ts-mode/__trunc__ new file mode 100644 index 000000000..52401bf1e --- /dev/null +++ b/snippets/python-ts-mode/__trunc__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __trunc__ +# key: _trunc +# group: Special methods +# -- +def __trunc__(self): + return $0 diff --git a/snippets/python-ts-mode/__xor__ b/snippets/python-ts-mode/__xor__ new file mode 100644 index 000000000..d84b99ff9 --- /dev/null +++ b/snippets/python-ts-mode/__xor__ @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: __xor__ +# key: _xor +# group: Special methods +# -- +def __xor__(self, other): + return $0 diff --git a/snippets/python-ts-mode/all b/snippets/python-ts-mode/all new file mode 100644 index 000000000..3ef233e18 --- /dev/null +++ b/snippets/python-ts-mode/all @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: all +# key: all +# expand-env: ((yas-indent-line 'fixed)) +# -- +__all__ = [ + $0 +] diff --git a/snippets/python-ts-mode/arg b/snippets/python-ts-mode/arg new file mode 100644 index 000000000..f5145ec5e --- /dev/null +++ b/snippets/python-ts-mode/arg @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: arg +# key: arg +# group: argparser +# -- +parser.add_argument('-$1', '--$2', + $0) diff --git a/snippets/python-ts-mode/arg_positional b/snippets/python-ts-mode/arg_positional new file mode 100644 index 000000000..2e43a8a97 --- /dev/null +++ b/snippets/python-ts-mode/arg_positional @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: arg_positional +# key: posarg +# group: argparser +# -- +parser.add_argument('${1:varname}', $0) diff --git a/snippets/python-ts-mode/ase b/snippets/python-ts-mode/ase new file mode 100644 index 000000000..867554748 --- /dev/null +++ b/snippets/python-ts-mode/ase @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: Assert Equal +# key: ase +# group: testing +# -- +self.assertEqual(${1:expected}, ${2:actual}) diff --git a/snippets/python-ts-mode/asne b/snippets/python-ts-mode/asne new file mode 100644 index 000000000..bccff3e30 --- /dev/null +++ b/snippets/python-ts-mode/asne @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: Assert Not Equal +# key: asne +# group: testing +# -- +self.assertNotEqual(${1:expected}, ${2:actual}) diff --git a/snippets/python-ts-mode/asr b/snippets/python-ts-mode/asr new file mode 100644 index 000000000..21a10df71 --- /dev/null +++ b/snippets/python-ts-mode/asr @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: Assert Raises +# key: asr +# group: testing +# -- +with self.assertRaises(${1:Exception}): + $0 diff --git a/snippets/python-ts-mode/assert b/snippets/python-ts-mode/assert new file mode 100644 index 000000000..dfd707f68 --- /dev/null +++ b/snippets/python-ts-mode/assert @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: assert +# key: ass +# group: testing +# -- +assert $0 diff --git a/snippets/python-ts-mode/assertEqual b/snippets/python-ts-mode/assertEqual new file mode 100644 index 000000000..64be83b55 --- /dev/null +++ b/snippets/python-ts-mode/assertEqual @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: assertEqual +# key: ae +# group: testing +# -- +self.assertEqual($1, $2) diff --git a/snippets/python-ts-mode/assertFalse b/snippets/python-ts-mode/assertFalse new file mode 100644 index 000000000..3c21b3668 --- /dev/null +++ b/snippets/python-ts-mode/assertFalse @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: assertFalse +# key: af +# group: testing +# -- +self.assertFalse($0) diff --git a/snippets/python-ts-mode/assertIn b/snippets/python-ts-mode/assertIn new file mode 100644 index 000000000..5ef11cad7 --- /dev/null +++ b/snippets/python-ts-mode/assertIn @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: assertIn +# key: ai +# group: testing +# -- +self.assertIn(${1:member}, ${2:container}) diff --git a/snippets/python-ts-mode/assertNotEqual b/snippets/python-ts-mode/assertNotEqual new file mode 100644 index 000000000..4cb759b2f --- /dev/null +++ b/snippets/python-ts-mode/assertNotEqual @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: assertNotEqual +# key: ane +# group: testing +# -- +self.assertNotEqual($1, $2) diff --git a/snippets/python-ts-mode/assertNotIn b/snippets/python-ts-mode/assertNotIn new file mode 100644 index 000000000..d59f88604 --- /dev/null +++ b/snippets/python-ts-mode/assertNotIn @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: assetNotIn +# key: an +# group: testing +# -- +self.assertNotIn(${1:member}, ${2:container}) diff --git a/snippets/python-ts-mode/assertRaises b/snippets/python-ts-mode/assertRaises new file mode 100644 index 000000000..489be0f50 --- /dev/null +++ b/snippets/python-ts-mode/assertRaises @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: assertRaises +# key: ar +# group: testing +# -- +self.assertRaises(${1:Exception}, ${2:fun}) diff --git a/snippets/python-ts-mode/assertRaises.with b/snippets/python-ts-mode/assertRaises.with new file mode 100644 index 000000000..5992127fc --- /dev/null +++ b/snippets/python-ts-mode/assertRaises.with @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: assertRaisesWith +# key: arw +# -- +with self.assertRaises(${1:Exception}): + $0 diff --git a/snippets/python-ts-mode/assertTrue b/snippets/python-ts-mode/assertTrue new file mode 100644 index 000000000..0d4b25edc --- /dev/null +++ b/snippets/python-ts-mode/assertTrue @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: assertTrue +# key: at +# group: testing +# -- +self.assertTrue($0) diff --git a/snippets/python-ts-mode/bang b/snippets/python-ts-mode/bang new file mode 100644 index 000000000..5e873f8f7 --- /dev/null +++ b/snippets/python-ts-mode/bang @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: #! +# key: #! +# contributor : @avelino +# -- +#!/usr/bin/env python diff --git a/snippets/python-ts-mode/celery_pdb b/snippets/python-ts-mode/celery_pdb new file mode 100644 index 000000000..34c67858f --- /dev/null +++ b/snippets/python-ts-mode/celery_pdb @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: celery pdb +# key: cdb +# group: debug +# -- +from celery.contrib import rdb; rdb.set_trace() diff --git a/snippets/python-ts-mode/class_doxygen_doc b/snippets/python-ts-mode/class_doxygen_doc new file mode 100644 index 000000000..fcfa0646e --- /dev/null +++ b/snippets/python-ts-mode/class_doxygen_doc @@ -0,0 +1,11 @@ +# -*- mode: snippet -*- +# contributor: Dan Pitic +# name: Class Doxygen Doc +# key: doxy_class +# group: doxygen +# -- +""" +@brief ${1:class description} + +@details ${2:detailed description} +""" diff --git a/snippets/python-ts-mode/classmethod b/snippets/python-ts-mode/classmethod new file mode 100644 index 000000000..e3121f474 --- /dev/null +++ b/snippets/python-ts-mode/classmethod @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: classmethod +# key: cm +# group: object oriented +# -- +@classmethod +def ${1:meth}(cls, $2): + $0 diff --git a/snippets/python-ts-mode/cls b/snippets/python-ts-mode/cls new file mode 100644 index 000000000..f857cdbd4 --- /dev/null +++ b/snippets/python-ts-mode/cls @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: class +# key: cls +# group: object oriented +# -- +class ${1:class}: + $0 diff --git a/snippets/python-ts-mode/dataclass b/snippets/python-ts-mode/dataclass new file mode 100644 index 000000000..c342bd17f --- /dev/null +++ b/snippets/python-ts-mode/dataclass @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: dataclass +# key: dc +# group: object oriented +# -- +@dataclass +class ${1:class}: + $0 diff --git a/snippets/python-ts-mode/dec b/snippets/python-ts-mode/dec new file mode 100644 index 000000000..b1bee7d02 --- /dev/null +++ b/snippets/python-ts-mode/dec @@ -0,0 +1,14 @@ +# -*- mode: snippet -*- +# name: dec +# key: dec +# group : definitions +# -- +def ${1:decorator}(func): + $2 + def _$1(*args, **kwargs): + $3 + ret = func(*args, **kwargs) + $4 + return ret + + return _$1 diff --git a/snippets/python-ts-mode/def b/snippets/python-ts-mode/def new file mode 100644 index 000000000..a511a7a04 --- /dev/null +++ b/snippets/python-ts-mode/def @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: def method(self, ...): +# key: def +# group: definitions +# -- +def ${1:methodname}(self, ${2:arg}): + ${3:pass} diff --git a/snippets/python-ts-mode/deftest b/snippets/python-ts-mode/deftest new file mode 100644 index 000000000..ed3ec6c6e --- /dev/null +++ b/snippets/python-ts-mode/deftest @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: deftest +# key: dt +# group: testing +# -- +def test_${1:long_name}(self): + $0 diff --git a/snippets/python-ts-mode/django_test_class b/snippets/python-ts-mode/django_test_class new file mode 100644 index 000000000..1b63ad47b --- /dev/null +++ b/snippets/python-ts-mode/django_test_class @@ -0,0 +1,7 @@ +# -*- mode: snippet; require-final-newline: nil -*- +# name: django_test_class +# key: dtcs +# group: testing +# -- +class ${1:Model}Test(TestCase): + $0 diff --git a/snippets/python-ts-mode/doc b/snippets/python-ts-mode/doc new file mode 100644 index 000000000..a7d924afe --- /dev/null +++ b/snippets/python-ts-mode/doc @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: doc +# key: d +# -- +"""$0 +""" diff --git a/snippets/python-ts-mode/doctest b/snippets/python-ts-mode/doctest new file mode 100644 index 000000000..884352a7d --- /dev/null +++ b/snippets/python-ts-mode/doctest @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: doctest +# key: doctest +# group: testing +# -- +>>> ${1:function calls} +${2:desired output} +$0 diff --git a/snippets/python-ts-mode/embed b/snippets/python-ts-mode/embed new file mode 100644 index 000000000..8d21a7c3d --- /dev/null +++ b/snippets/python-ts-mode/embed @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: embed +# key: embed +# -- +from IPython import embed; embed() diff --git a/snippets/python-ts-mode/enum b/snippets/python-ts-mode/enum new file mode 100644 index 000000000..876d82410 --- /dev/null +++ b/snippets/python-ts-mode/enum @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: enum +# key: en +# group: object oriented +# -- +class ${1:class}(Enum): + $0 diff --git a/snippets/python-ts-mode/env b/snippets/python-ts-mode/env new file mode 100644 index 000000000..d4fb804ab --- /dev/null +++ b/snippets/python-ts-mode/env @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: #!/usr/bin/env python +# key: env +# group: Header +# -- +#!/usr/bin/env python diff --git a/snippets/python-ts-mode/for b/snippets/python-ts-mode/for new file mode 100644 index 000000000..1d8b6e9d3 --- /dev/null +++ b/snippets/python-ts-mode/for @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: for ... in ... : ... +# key: for +# group : control structure +# -- +for ${var} in ${collection}: + $0 diff --git a/snippets/python-ts-mode/from b/snippets/python-ts-mode/from new file mode 100644 index 000000000..65d5050f1 --- /dev/null +++ b/snippets/python-ts-mode/from @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: from MOD import SYM +# key: from +# group: Header +# -- +from ${1:module} import ${2:symbol} +$0 diff --git a/snippets/python-ts-mode/function b/snippets/python-ts-mode/function new file mode 100644 index 000000000..d7e8f12be --- /dev/null +++ b/snippets/python-ts-mode/function @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: function +# key: f +# group: definitions +# -- +def ${1:fun}(${2:args}): + $0 diff --git a/snippets/python-ts-mode/function_docstring b/snippets/python-ts-mode/function_docstring new file mode 100644 index 000000000..045c5176d --- /dev/null +++ b/snippets/python-ts-mode/function_docstring @@ -0,0 +1,11 @@ +# -*- mode: snippet -*- +# name: function_docstring +# key: fd +# group: definitions +# Use minimum indentation, because Emacs 25+ doesn't dedent docstrings. +# -- +def ${1:name}($2): + \"\"\"$3 + ${2:$(python-args-to-docstring)} + \"\"\" + $0 diff --git a/snippets/python-ts-mode/function_docstring_numpy b/snippets/python-ts-mode/function_docstring_numpy new file mode 100644 index 000000000..4be347b7c --- /dev/null +++ b/snippets/python-ts-mode/function_docstring_numpy @@ -0,0 +1,12 @@ +# -*- mode: snippet -*- +# contributor: Egor Panfilov +# name: function_docstring_numpy +# key: fdn +# group: definitions +# -- +def ${1:name}($2): + \"\"\"$3 + +${2:$(python-args-to-docstring-numpy)} + \"\"\" + $0 diff --git a/snippets/python-ts-mode/function_doxygen_doc b/snippets/python-ts-mode/function_doxygen_doc new file mode 100644 index 000000000..8b7ba64b2 --- /dev/null +++ b/snippets/python-ts-mode/function_doxygen_doc @@ -0,0 +1,15 @@ +# -*- mode: snippet -*- +# contributor: Dan Pitic +# name: Function Doxygen Doc +# key: doxy_func +# group: doxygen +# -- +""" +@brief ${1:function description} + +@details ${2:detailed description} + +@param ${3:param} + +@return ${4:return type} +""" diff --git a/snippets/python-ts-mode/ic.py b/snippets/python-ts-mode/ic.py new file mode 100644 index 000000000..3410c8176 --- /dev/null +++ b/snippets/python-ts-mode/ic.py @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: ic +# key: ic +# -- +from icecream import ic +ic($1) diff --git a/snippets/python-ts-mode/if b/snippets/python-ts-mode/if new file mode 100644 index 000000000..d1538a967 --- /dev/null +++ b/snippets/python-ts-mode/if @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: if +# key: if +# group : control structure +# -- +if ${1:cond}: + $0 diff --git a/snippets/python-ts-mode/ife b/snippets/python-ts-mode/ife new file mode 100644 index 000000000..e1b34f081 --- /dev/null +++ b/snippets/python-ts-mode/ife @@ -0,0 +1,10 @@ +# -*- mode: snippet -*- +# name: ife +# key: ife +# expand-env: ((yas-indent-line 'fixed)) +# group : control structure +# -- +if $1: + $2 +else: + $0 diff --git a/snippets/python-ts-mode/ifmain b/snippets/python-ts-mode/ifmain new file mode 100644 index 000000000..cb74405c9 --- /dev/null +++ b/snippets/python-ts-mode/ifmain @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: ifmain +# key: ifm +# -- +if __name__ == '__main__': + ${1:main()} diff --git a/snippets/python-ts-mode/import b/snippets/python-ts-mode/import new file mode 100644 index 000000000..1ff1ca8d0 --- /dev/null +++ b/snippets/python-ts-mode/import @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: import +# key: imp +# group : general +# -- +import ${1:lib}${2: as ${3:alias}} +$0 diff --git a/snippets/python-ts-mode/init_docstring b/snippets/python-ts-mode/init_docstring new file mode 100644 index 000000000..7256541a4 --- /dev/null +++ b/snippets/python-ts-mode/init_docstring @@ -0,0 +1,10 @@ +# -*- mode: snippet -*- +# name: init_docstring +# key: id +# group : definitions +# -- +def __init__(self$1): + \"\"\"$2 + ${1:$(python-args-to-docstring)} + \"\"\" + $0 diff --git a/snippets/python-ts-mode/init_docstring_numpy b/snippets/python-ts-mode/init_docstring_numpy new file mode 100644 index 000000000..0766d1354 --- /dev/null +++ b/snippets/python-ts-mode/init_docstring_numpy @@ -0,0 +1,11 @@ +# -*- mode: snippet -*- +# contributor: quazgar +# name: init_docstring_numpy +# key: idn +# group : definitions +# -- +def __init__(self$1): + \"\"\"$2 + ${1:$(python-args-to-docstring-numpy)} + \"\"\" + $0 diff --git a/snippets/python-ts-mode/interact b/snippets/python-ts-mode/interact new file mode 100644 index 000000000..07bed2728 --- /dev/null +++ b/snippets/python-ts-mode/interact @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: interact +# key: int +# -- +import code; code.interact(local=locals()) diff --git a/snippets/python-ts-mode/ipdb b/snippets/python-ts-mode/ipdb new file mode 100644 index 000000000..8f5b2adc6 --- /dev/null +++ b/snippets/python-ts-mode/ipdb @@ -0,0 +1,6 @@ +# -*- mode: snippet; require-final-newline: nil -*- +# name: ipdb trace +# key: ipdb +# group: debug +# -- +import ipdb; ipdb.set_trace() diff --git a/snippets/python-ts-mode/lambda b/snippets/python-ts-mode/lambda new file mode 100644 index 000000000..c3e9879c7 --- /dev/null +++ b/snippets/python-ts-mode/lambda @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: lambda +# key: lam +# -- +lambda ${1:x}: $0 diff --git a/snippets/python-ts-mode/list b/snippets/python-ts-mode/list new file mode 100644 index 000000000..8da114ef9 --- /dev/null +++ b/snippets/python-ts-mode/list @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: list +# key: li +# group : definitions +# -- +[${1:el} for $1 in ${2:list}] +$0 diff --git a/snippets/python-ts-mode/logger_name b/snippets/python-ts-mode/logger_name new file mode 100644 index 000000000..1cdcc9eda --- /dev/null +++ b/snippets/python-ts-mode/logger_name @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: logger_name +# key: ln +# -- +logger = logging.getLogger(${1:__name__}) diff --git a/snippets/python-ts-mode/logging b/snippets/python-ts-mode/logging new file mode 100644 index 000000000..568eeea5b --- /dev/null +++ b/snippets/python-ts-mode/logging @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: logging +# key: log +# -- +logger = logging.getLogger("${1:name}") +logger.setLevel(logging.${2:level}) diff --git a/snippets/python-ts-mode/main b/snippets/python-ts-mode/main new file mode 100644 index 000000000..df753e3b1 --- /dev/null +++ b/snippets/python-ts-mode/main @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: main +# key: main +# -- +def main(): + $0 diff --git a/snippets/python-ts-mode/method b/snippets/python-ts-mode/method new file mode 100644 index 000000000..dd969d1de --- /dev/null +++ b/snippets/python-ts-mode/method @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: method +# key: m +# group: object oriented +# -- +def ${1:method}(self${2:, $3}): + $0 diff --git a/snippets/python-ts-mode/method_docstring b/snippets/python-ts-mode/method_docstring new file mode 100644 index 000000000..affc63d4e --- /dev/null +++ b/snippets/python-ts-mode/method_docstring @@ -0,0 +1,10 @@ +# -*- mode: snippet -*- +# name: method_docstring +# key: md +# group: object oriented +# -- +def ${1:name}(self$2): + \"\"\"$3 + ${2:$(python-args-to-docstring)} + \"\"\" + $0 diff --git a/snippets/python-ts-mode/method_docstring_numpy b/snippets/python-ts-mode/method_docstring_numpy new file mode 100644 index 000000000..8c2910a22 --- /dev/null +++ b/snippets/python-ts-mode/method_docstring_numpy @@ -0,0 +1,11 @@ +# -*- mode: snippet -*- +# contributor: quazgar +# name: method_docstring_numpy +# key: mdn +# group: object oriented +# -- +def ${1:name}(self$2): + \"\"\"$3 + ${2:$(python-args-to-docstring-numpy)} + \"\"\" + $0 diff --git a/snippets/python-ts-mode/not_impl b/snippets/python-ts-mode/not_impl new file mode 100644 index 000000000..2d35c4581 --- /dev/null +++ b/snippets/python-ts-mode/not_impl @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: not_impl +# key: not_impl +# -- +raise NotImplementedError diff --git a/snippets/python-ts-mode/np b/snippets/python-ts-mode/np new file mode 100644 index 000000000..aa6bff8fc --- /dev/null +++ b/snippets/python-ts-mode/np @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: np +# key: np +# group : general +# -- +import numpy as np +$0 diff --git a/snippets/python-ts-mode/parse_args b/snippets/python-ts-mode/parse_args new file mode 100644 index 000000000..89c8b971f --- /dev/null +++ b/snippets/python-ts-mode/parse_args @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# name: parse_args +# key: pargs +# group: argparser +# -- +def parse_arguments(): + parser = argparse.ArgumentParser(description='$1') + $0 + return parser.parse_args() diff --git a/snippets/python-ts-mode/parser b/snippets/python-ts-mode/parser new file mode 100644 index 000000000..c52e1791b --- /dev/null +++ b/snippets/python-ts-mode/parser @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: parser +# key: pars +# group: argparser +# -- +parser = argparse.ArgumentParser(description='$1') +$0 diff --git a/snippets/python-ts-mode/pass b/snippets/python-ts-mode/pass new file mode 100644 index 000000000..9e8818953 --- /dev/null +++ b/snippets/python-ts-mode/pass @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: pass +# key: ps +# -- +pass diff --git a/snippets/python-ts-mode/pdb b/snippets/python-ts-mode/pdb new file mode 100644 index 000000000..65d2db40e --- /dev/null +++ b/snippets/python-ts-mode/pdb @@ -0,0 +1,6 @@ +# -*- mode: snippet; require-final-newline: nil -*- +# name: pdb trace +# key: pdb +# group: debug +# -- +breakpoint() diff --git a/snippets/python-ts-mode/pl b/snippets/python-ts-mode/pl new file mode 100644 index 000000000..f0fdd05e7 --- /dev/null +++ b/snippets/python-ts-mode/pl @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: Import pyplot +# key: plt +# group : general +# -- +import matplotlib.pyplot as plt +$0 diff --git a/snippets/python-ts-mode/print b/snippets/python-ts-mode/print new file mode 100644 index 000000000..2f908990f --- /dev/null +++ b/snippets/python-ts-mode/print @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: print +# key: p +# -- +print($0) diff --git a/snippets/python-ts-mode/prop b/snippets/python-ts-mode/prop new file mode 100644 index 000000000..a2eb1bd3d --- /dev/null +++ b/snippets/python-ts-mode/prop @@ -0,0 +1,19 @@ +# -*- mode: snippet -*- +# contributor: Mads D. Kristensen +# name: prop +# expand-env: ((yas-indent-line 'fixed)) +# -- +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/snippets/python-ts-mode/pudb b/snippets/python-ts-mode/pudb new file mode 100644 index 000000000..fff108685 --- /dev/null +++ b/snippets/python-ts-mode/pudb @@ -0,0 +1,6 @@ +# -*- mode: snippet; require-final-newline: nil -*- +# name: pudb trace +# key: pudb +# group: debug +# -- +import pudb; pudb.set_trace() diff --git a/snippets/python-ts-mode/reg b/snippets/python-ts-mode/reg new file mode 100644 index 000000000..567cb3aca --- /dev/null +++ b/snippets/python-ts-mode/reg @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: reg +# key: reg +# group : general +# -- +${1:regexp} = re.compile(r"${2:expr}") +$0 diff --git a/snippets/python-ts-mode/return b/snippets/python-ts-mode/return new file mode 100644 index 000000000..43263d2d6 --- /dev/null +++ b/snippets/python-ts-mode/return @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: return +# key: r +# -- +return $0 diff --git a/snippets/python-ts-mode/scls b/snippets/python-ts-mode/scls new file mode 100644 index 000000000..4a10e28de --- /dev/null +++ b/snippets/python-ts-mode/scls @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: subclass +# key: scls +# group: object oriented +# -- +class ${1:class}(${2:super-class}): + $0 diff --git a/snippets/python-ts-mode/script b/snippets/python-ts-mode/script new file mode 100644 index 000000000..55e42e960 --- /dev/null +++ b/snippets/python-ts-mode/script @@ -0,0 +1,11 @@ +# -*- mode: snippet -*- +# name: script +# key: script +# -- +#!/usr/bin/env python + +def main(): + pass + +if __name__ == '__main__': + main() diff --git a/snippets/python-ts-mode/self b/snippets/python-ts-mode/self new file mode 100644 index 000000000..9928c5a72 --- /dev/null +++ b/snippets/python-ts-mode/self @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: self +# key: . +# group: object oriented +# -- +self.$0 diff --git a/snippets/python-ts-mode/self_without_dot b/snippets/python-ts-mode/self_without_dot new file mode 100644 index 000000000..81178b8fe --- /dev/null +++ b/snippets/python-ts-mode/self_without_dot @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: self_without_dot +# key: s +# group: object oriented +# -- +self diff --git a/snippets/python-ts-mode/selfassign b/snippets/python-ts-mode/selfassign new file mode 100644 index 000000000..bc37fabf9 --- /dev/null +++ b/snippets/python-ts-mode/selfassign @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: selfassign +# key: sn +# group: object oriented +# -- +self.$1 = $1 diff --git a/snippets/python-ts-mode/setdef b/snippets/python-ts-mode/setdef new file mode 100644 index 000000000..71b56d974 --- /dev/null +++ b/snippets/python-ts-mode/setdef @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: setdef +# key: setdef +# -- +${1:var}.setdefault(${2:key}, []).append(${3:value}) diff --git a/snippets/python-ts-mode/setup b/snippets/python-ts-mode/setup new file mode 100644 index 000000000..107abc112 --- /dev/null +++ b/snippets/python-ts-mode/setup @@ -0,0 +1,14 @@ +# -*- mode: snippet -*- +# name: setup +# key: setup +# group: distribute +# -- +from setuptools import setup + +package = '${1:name}' +version = '${2:0.1}' + +setup(name=package, + version=version, + description="${3:description}", + url='${4:url}'$0) diff --git a/snippets/python-ts-mode/size b/snippets/python-ts-mode/size new file mode 100644 index 000000000..a6ed6ab5e --- /dev/null +++ b/snippets/python-ts-mode/size @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: size +# key: size +# -- +sys.getsizeof($0) diff --git a/snippets/python-ts-mode/static b/snippets/python-ts-mode/static new file mode 100644 index 000000000..19c3df9da --- /dev/null +++ b/snippets/python-ts-mode/static @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: static +# key: sm +# -- +@staticmethod +def ${1:func}($0): diff --git a/snippets/python-ts-mode/test_class b/snippets/python-ts-mode/test_class new file mode 100644 index 000000000..7342c5f49 --- /dev/null +++ b/snippets/python-ts-mode/test_class @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: test_class +# key: tcs +# group : testing +# -- +class Test${1:toTest}(${2:unittest.TestCase}): + $0 diff --git a/snippets/python-ts-mode/test_file b/snippets/python-ts-mode/test_file new file mode 100644 index 000000000..3fad172fc --- /dev/null +++ b/snippets/python-ts-mode/test_file @@ -0,0 +1,12 @@ +# -*- mode: snippet -*- +# name: test_file +# key: tf +# group : testing +# -- +import unittest +${1:from ${2:test_file} import *} + +$0 + +if __name__ == '__main__': + unittest.main() diff --git a/snippets/python-ts-mode/try b/snippets/python-ts-mode/try new file mode 100644 index 000000000..7030eccef --- /dev/null +++ b/snippets/python-ts-mode/try @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# name: try +# key: try +# expand-env: ((yas-indent-line 'fixed)) +# -- +try: + $0 +except ${1:Exception}: + $2 diff --git a/snippets/python-ts-mode/tryelse b/snippets/python-ts-mode/tryelse new file mode 100644 index 000000000..30537d62c --- /dev/null +++ b/snippets/python-ts-mode/tryelse @@ -0,0 +1,11 @@ +# -*- mode: snippet -*- +# name: tryelse +# key: tryelse +# expand-env: ((yas-indent-line 'fixed)) +# -- +try: + $0 +except $1: + $2 +else: + $3 diff --git a/snippets/python-ts-mode/utf8 b/snippets/python-ts-mode/utf8 new file mode 100644 index 000000000..2ebd82ec8 --- /dev/null +++ b/snippets/python-ts-mode/utf8 @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: utf-8 encoding +# key: utf8 +# -- +# -*- coding: utf-8 -*- diff --git a/snippets/python-ts-mode/uv-script b/snippets/python-ts-mode/uv-script new file mode 100644 index 000000000..c4dafcb73 --- /dev/null +++ b/snippets/python-ts-mode/uv-script @@ -0,0 +1,11 @@ +# -*- mode: snippet -*- +# name: uv-script +# key: uv +# -- +#!/usr/bin/uv run +# /// script +# dependencies = [ +# $1 +# ] +# /// +$0 \ No newline at end of file diff --git a/snippets/python-ts-mode/while b/snippets/python-ts-mode/while new file mode 100644 index 000000000..a482fac06 --- /dev/null +++ b/snippets/python-ts-mode/while @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: while +# key: wh +# group: control structure +# -- +while ${1:True}: + $0 diff --git a/snippets/python-ts-mode/with b/snippets/python-ts-mode/with new file mode 100644 index 000000000..e17133cc6 --- /dev/null +++ b/snippets/python-ts-mode/with @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: with +# key: with +# group : control structure +# -- +with ${1:expr}${2: as ${3:alias}}: + $0 diff --git a/snippets/python-ts-mode/with-open b/snippets/python-ts-mode/with-open new file mode 100644 index 000000000..a2ccdb301 --- /dev/null +++ b/snippets/python-ts-mode/with-open @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: with-open +# key: wo +# group : control structure +# contributor: Quazgar +# -- +with open(${1:"filename"}${2:, encoding="${3:utf-8}"}${4:, mode="${5:w}"}) as ${6:myfile}: + $0 \ No newline at end of file diff --git a/snippets/ruby-ts-mode/# b/snippets/ruby-ts-mode/# new file mode 100644 index 000000000..96ca384c4 --- /dev/null +++ b/snippets/ruby-ts-mode/# @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: # => +# group : general +# -- +# => \ No newline at end of file diff --git a/snippets/ruby-ts-mode/=b b/snippets/ruby-ts-mode/=b new file mode 100644 index 000000000..ac9e0334f --- /dev/null +++ b/snippets/ruby-ts-mode/=b @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: =begin rdoc ... =end +# group : general +# -- +=begin rdoc + $0 +=end \ No newline at end of file diff --git a/snippets/ruby-ts-mode/Comp b/snippets/ruby-ts-mode/Comp new file mode 100644 index 000000000..3655d16fe --- /dev/null +++ b/snippets/ruby-ts-mode/Comp @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# name: include Comparable; def <=> ... end +# group : definitions +# -- +include Comparable + +def <=> other + $0 +end \ No newline at end of file diff --git a/snippets/ruby-ts-mode/Enum b/snippets/ruby-ts-mode/Enum new file mode 100644 index 000000000..9804bd677 --- /dev/null +++ b/snippets/ruby-ts-mode/Enum @@ -0,0 +1,10 @@ +# -*- mode: snippet -*- +# name: include Enumerable +# key: Enum +# group: collections +# -- +include Enumerable + +def each${1:(&block)} + $0 +end diff --git a/snippets/ruby-ts-mode/GLOB b/snippets/ruby-ts-mode/GLOB new file mode 100644 index 000000000..66672540a --- /dev/null +++ b/snippets/ruby-ts-mode/GLOB @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: GLOB +# key: $ +# -- +$${1:GLOBAL} = $0 \ No newline at end of file diff --git a/snippets/ruby-ts-mode/all b/snippets/ruby-ts-mode/all new file mode 100644 index 000000000..dda847b33 --- /dev/null +++ b/snippets/ruby-ts-mode/all @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: all? { |...| ... } +# group : collections +# -- +all? { |${e}| $0 } \ No newline at end of file diff --git a/snippets/ruby-ts-mode/am b/snippets/ruby-ts-mode/am new file mode 100644 index 000000000..0a610b019 --- /dev/null +++ b/snippets/ruby-ts-mode/am @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: alias_method new, old +# group : definitions +# -- +alias_method :${new_name}, :${old_name} \ No newline at end of file diff --git a/snippets/ruby-ts-mode/any b/snippets/ruby-ts-mode/any new file mode 100644 index 000000000..d41f68ab9 --- /dev/null +++ b/snippets/ruby-ts-mode/any @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: any? { |...| ... } +# group : collections +# -- +any? { |${e}| $0 } \ No newline at end of file diff --git a/snippets/ruby-ts-mode/app b/snippets/ruby-ts-mode/app new file mode 100644 index 000000000..33a842533 --- /dev/null +++ b/snippets/ruby-ts-mode/app @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: if __FILE__ == $PROGRAM_NAME ... end +# group : general +# -- +if __FILE__ == $PROGRAM_NAME + $0 +end \ No newline at end of file diff --git a/snippets/ruby-ts-mode/attribute b/snippets/ruby-ts-mode/attribute new file mode 100644 index 000000000..4e8e37a74 --- /dev/null +++ b/snippets/ruby-ts-mode/attribute @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: attribute +# key: @ +# -- +@${1:attr} = $0 \ No newline at end of file diff --git a/snippets/ruby-ts-mode/bang b/snippets/ruby-ts-mode/bang new file mode 100644 index 000000000..12db84534 --- /dev/null +++ b/snippets/ruby-ts-mode/bang @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: #! +# key: #! +# -- +#!/usr/bin/env ruby diff --git a/snippets/ruby-ts-mode/bench b/snippets/ruby-ts-mode/bench new file mode 100644 index 000000000..e440919c5 --- /dev/null +++ b/snippets/ruby-ts-mode/bench @@ -0,0 +1,10 @@ +# -*- mode: snippet -*- +# name: bench +# key: bench +# -- +require "benchmark" + +TESTS = ${1:1_000} +Benchmark.bmbm do |x| + x.report("${2:var}") {} +end diff --git a/snippets/ruby-ts-mode/bm b/snippets/ruby-ts-mode/bm new file mode 100644 index 000000000..9da6fcd5e --- /dev/null +++ b/snippets/ruby-ts-mode/bm @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: Benchmark.bmbm(...) do ... end +# group : general +# -- +Benchmark.bmbm(${1:10}) do |x| + $0 +end \ No newline at end of file diff --git a/snippets/ruby-ts-mode/case b/snippets/ruby-ts-mode/case new file mode 100644 index 000000000..706e2d579 --- /dev/null +++ b/snippets/ruby-ts-mode/case @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: case ... end +# group : general +# -- +case ${1:object} +when ${2:condition} + $0 +end \ No newline at end of file diff --git a/snippets/ruby-ts-mode/cla b/snippets/ruby-ts-mode/cla new file mode 100644 index 000000000..87e95e6b1 --- /dev/null +++ b/snippets/ruby-ts-mode/cla @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: class << self ... end +# group : definitions +# -- +class << ${self} + $0 +end \ No newline at end of file diff --git a/snippets/ruby-ts-mode/cls b/snippets/ruby-ts-mode/cls new file mode 100644 index 000000000..e65d8d9b0 --- /dev/null +++ b/snippets/ruby-ts-mode/cls @@ -0,0 +1,12 @@ +# -*- mode: snippet -*- +# name: class ... end +# contributor : hitesh +# group : definitions +# -- +class ${1:`(let ((fn (capitalize (file-name-nondirectory + (file-name-sans-extension + (or (buffer-file-name) + (buffer-name (current-buffer)))))))) + (replace-regexp-in-string "_" "" fn t t))`} + $0 +end \ No newline at end of file diff --git a/snippets/ruby-ts-mode/collect b/snippets/ruby-ts-mode/collect new file mode 100644 index 000000000..07db843f4 --- /dev/null +++ b/snippets/ruby-ts-mode/collect @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: collect { |...| ... } +# group : collections +# -- +collect { |${e}| $0 } \ No newline at end of file diff --git a/snippets/ruby-ts-mode/dee b/snippets/ruby-ts-mode/dee new file mode 100644 index 000000000..63d129da3 --- /dev/null +++ b/snippets/ruby-ts-mode/dee @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: deep_copy(...) +# group : general +# -- +Marshal.load(Marshal.dump($0)) \ No newline at end of file diff --git a/snippets/ruby-ts-mode/def b/snippets/ruby-ts-mode/def new file mode 100644 index 000000000..875f0ff2e --- /dev/null +++ b/snippets/ruby-ts-mode/def @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: def ... end +# key: def +# -- +def ${1:method}${2:(${3:args})} + $0 +end \ No newline at end of file diff --git a/snippets/ruby-ts-mode/deli b/snippets/ruby-ts-mode/deli new file mode 100644 index 000000000..fb2aa79f4 --- /dev/null +++ b/snippets/ruby-ts-mode/deli @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: delete_if { |...| ... } +# group : collections +# -- +delete_if { |${e}| $0 } \ No newline at end of file diff --git a/snippets/ruby-ts-mode/det b/snippets/ruby-ts-mode/det new file mode 100644 index 000000000..8b05990b1 --- /dev/null +++ b/snippets/ruby-ts-mode/det @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: detect { |...| ... } +# group : collections +# -- +detect { |${e}| $0 } \ No newline at end of file diff --git a/snippets/ruby-ts-mode/dow b/snippets/ruby-ts-mode/dow new file mode 100644 index 000000000..a57e1f1ae --- /dev/null +++ b/snippets/ruby-ts-mode/dow @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: downto(...) { |n| ... } +# group : control structure +# -- +downto(${0}) { |${n}| + $0 +} \ No newline at end of file diff --git a/snippets/ruby-ts-mode/ea b/snippets/ruby-ts-mode/ea new file mode 100644 index 000000000..794d13ba8 --- /dev/null +++ b/snippets/ruby-ts-mode/ea @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: each { |...| ... } +# group : collections +# -- +each { |${e}| $0 } \ No newline at end of file diff --git a/snippets/ruby-ts-mode/eac b/snippets/ruby-ts-mode/eac new file mode 100644 index 000000000..e52f83e3a --- /dev/null +++ b/snippets/ruby-ts-mode/eac @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: each_cons(...) { |...| ... } +# group : collections +# -- +each_cons(${1:2}) { |${group}| $0 } \ No newline at end of file diff --git a/snippets/ruby-ts-mode/eai b/snippets/ruby-ts-mode/eai new file mode 100644 index 000000000..9a9f8e9c2 --- /dev/null +++ b/snippets/ruby-ts-mode/eai @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: each_index { |i| ... } +# group : collections +# -- +each_index { |${i}| $0 } \ No newline at end of file diff --git a/snippets/ruby-ts-mode/eav b/snippets/ruby-ts-mode/eav new file mode 100644 index 000000000..6ea956f94 --- /dev/null +++ b/snippets/ruby-ts-mode/eav @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: each_value { |val| ... } +# group : collections +# -- +each_value { |${val}| $0 } \ No newline at end of file diff --git a/snippets/ruby-ts-mode/eawi b/snippets/ruby-ts-mode/eawi new file mode 100644 index 000000000..068e1d4c0 --- /dev/null +++ b/snippets/ruby-ts-mode/eawi @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: each_with_index { |e, i| ... } +# group : collections +# -- +each_with_index { |${e}, ${i}| $0 } \ No newline at end of file diff --git a/snippets/ruby-ts-mode/for b/snippets/ruby-ts-mode/for new file mode 100644 index 000000000..03dd82c09 --- /dev/null +++ b/snippets/ruby-ts-mode/for @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: for +# key: for +# -- +for ${1:el} in ${2:collection} + $0 +end \ No newline at end of file diff --git a/snippets/ruby-ts-mode/forin b/snippets/ruby-ts-mode/forin new file mode 100644 index 000000000..15b94f806 --- /dev/null +++ b/snippets/ruby-ts-mode/forin @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: for ... in ...; ... end +# group : control structure +# -- +for ${1:element} in ${2:collection} + $0 +end \ No newline at end of file diff --git a/snippets/ruby-ts-mode/formula b/snippets/ruby-ts-mode/formula new file mode 100644 index 000000000..735b0d1ce --- /dev/null +++ b/snippets/ruby-ts-mode/formula @@ -0,0 +1,16 @@ +# -*- mode: snippet -*- +# name: formula +# key: form +# -- +require 'formula' + +class ${1:Name} , jimeh +# key: mod +# -- +module ${1:`(let ((fn (capitalize (file-name-nondirectory + (file-name-sans-extension + (or (buffer-file-name) + (buffer-name (current-buffer)))))))) + (while (string-match "_" fn) + (setq fn (replace-match "" nil nil fn))) + fn)`} + $0 +end \ No newline at end of file diff --git a/snippets/ruby-ts-mode/proc b/snippets/ruby-ts-mode/proc new file mode 100644 index 000000000..b108bed68 --- /dev/null +++ b/snippets/ruby-ts-mode/proc @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: Proc.new { |...| ... } +# key: proc +# contributor: Valery Zajkov +# -- +Proc.new { |${1:argument}| $0 } \ No newline at end of file diff --git a/snippets/ruby-ts-mode/pry b/snippets/ruby-ts-mode/pry new file mode 100644 index 000000000..cea3988ef --- /dev/null +++ b/snippets/ruby-ts-mode/pry @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: binding.pry +# key: pry +# -- +require 'pry'; binding.pry diff --git a/snippets/ruby-ts-mode/r b/snippets/ruby-ts-mode/r new file mode 100644 index 000000000..eb2b6a61e --- /dev/null +++ b/snippets/ruby-ts-mode/r @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: attr_reader ... +# group : definitions +# -- +attr_reader : \ No newline at end of file diff --git a/snippets/ruby-ts-mode/rb b/snippets/ruby-ts-mode/rb new file mode 100644 index 000000000..2c1dab752 --- /dev/null +++ b/snippets/ruby-ts-mode/rb @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: /usr/bin/ruby -wU +# group : general +# -- +#!/usr/bin/ruby -wU \ No newline at end of file diff --git a/snippets/ruby-ts-mode/red b/snippets/ruby-ts-mode/red new file mode 100644 index 000000000..173eb7bf4 --- /dev/null +++ b/snippets/ruby-ts-mode/red @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: reduce(...) { |...| ... } +# group : collections +# -- +reduce(${1:0}) { |${2:accumulator}, ${3:element}| $0 } \ No newline at end of file diff --git a/snippets/ruby-ts-mode/reject b/snippets/ruby-ts-mode/reject new file mode 100644 index 000000000..75afef3d7 --- /dev/null +++ b/snippets/ruby-ts-mode/reject @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: reject { |...| ... } +# group : collections +# -- +reject { |${1:element}| $0 } \ No newline at end of file diff --git a/snippets/ruby-ts-mode/rel b/snippets/ruby-ts-mode/rel new file mode 100644 index 000000000..d11bd7840 --- /dev/null +++ b/snippets/ruby-ts-mode/rel @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: require_relative +# group : general +# -- +require_relative '$0' \ No newline at end of file diff --git a/snippets/ruby-ts-mode/req b/snippets/ruby-ts-mode/req new file mode 100644 index 000000000..0eb5102c8 --- /dev/null +++ b/snippets/ruby-ts-mode/req @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: require "..." +# group : general +# -- +require '$0' \ No newline at end of file diff --git a/snippets/ruby-ts-mode/rpry b/snippets/ruby-ts-mode/rpry new file mode 100644 index 000000000..d93221fb6 --- /dev/null +++ b/snippets/ruby-ts-mode/rpry @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: binding.pry_remote +# key: rpry +# -- +require 'pry-remote'; binding.remote_pry \ No newline at end of file diff --git a/snippets/ruby-ts-mode/rw b/snippets/ruby-ts-mode/rw new file mode 100644 index 000000000..836881eb4 --- /dev/null +++ b/snippets/ruby-ts-mode/rw @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: attr_accessor ... +# group : definitions +# -- +attr_accessor : \ No newline at end of file diff --git a/snippets/ruby-ts-mode/select b/snippets/ruby-ts-mode/select new file mode 100644 index 000000000..f279c170c --- /dev/null +++ b/snippets/ruby-ts-mode/select @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: select { |...| ... } +# group : collections +# -- +select { |${1:element}| $0 } \ No newline at end of file diff --git a/snippets/ruby-ts-mode/str b/snippets/ruby-ts-mode/str new file mode 100644 index 000000000..733cef520 --- /dev/null +++ b/snippets/ruby-ts-mode/str @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: str +# key: s +# -- +#{$0} \ No newline at end of file diff --git a/snippets/ruby-ts-mode/test class b/snippets/ruby-ts-mode/test class new file mode 100644 index 000000000..1f7fb91ba --- /dev/null +++ b/snippets/ruby-ts-mode/test class @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: test class +# key: tc +# -- +class TC_${1:Class} < Test::Unit::TestCase + $0 +end \ No newline at end of file diff --git a/snippets/ruby-ts-mode/tim b/snippets/ruby-ts-mode/tim new file mode 100644 index 000000000..2a9115e97 --- /dev/null +++ b/snippets/ruby-ts-mode/tim @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: times { |n| ... } +# group : control structure +# -- +times { |${n}| $0 } \ No newline at end of file diff --git a/snippets/ruby-ts-mode/to_ b/snippets/ruby-ts-mode/to_ new file mode 100644 index 000000000..a2f9cde03 --- /dev/null +++ b/snippets/ruby-ts-mode/to_ @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: to_ +# key: to_ +# -- +def to_s + "${1:string}" +end +$0 \ No newline at end of file diff --git a/snippets/ruby-ts-mode/tu b/snippets/ruby-ts-mode/tu new file mode 100644 index 000000000..b9244b6e9 --- /dev/null +++ b/snippets/ruby-ts-mode/tu @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: tu +# key: tu +# -- +require 'test/unit' \ No newline at end of file diff --git a/snippets/ruby-ts-mode/unless b/snippets/ruby-ts-mode/unless new file mode 100644 index 000000000..f3a546a3f --- /dev/null +++ b/snippets/ruby-ts-mode/unless @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# name: unless ... end +# group: control structure +# key: unless +# contributor: Valery Zajkov +# -- +unless ${1:condition} + $0 +end \ No newline at end of file diff --git a/snippets/ruby-ts-mode/until b/snippets/ruby-ts-mode/until new file mode 100644 index 000000000..9e32cdc72 --- /dev/null +++ b/snippets/ruby-ts-mode/until @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: until ... end +# group: control structure +# -- +until ${condition} + $0 +end \ No newline at end of file diff --git a/snippets/ruby-ts-mode/upt b/snippets/ruby-ts-mode/upt new file mode 100644 index 000000000..820b08923 --- /dev/null +++ b/snippets/ruby-ts-mode/upt @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: upto(...) { |n| ... } +# group : control structure +# -- +upto(${n}) { |${i}| + $0 +} \ No newline at end of file diff --git a/snippets/ruby-ts-mode/w b/snippets/ruby-ts-mode/w new file mode 100644 index 000000000..8df25b6b2 --- /dev/null +++ b/snippets/ruby-ts-mode/w @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: attr_writer ... +# group : definitions +# -- +attr_writer : \ No newline at end of file diff --git a/snippets/ruby-ts-mode/when b/snippets/ruby-ts-mode/when new file mode 100644 index 000000000..55d3433c3 --- /dev/null +++ b/snippets/ruby-ts-mode/when @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: when ... end +# group : control structure +# -- +when ${condition} + $0 +end \ No newline at end of file diff --git a/snippets/ruby-ts-mode/while b/snippets/ruby-ts-mode/while new file mode 100644 index 000000000..a1f1317e8 --- /dev/null +++ b/snippets/ruby-ts-mode/while @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: while ... end +# group : control structure +# -- +while ${condition} + $0 +end \ No newline at end of file diff --git a/snippets/ruby-ts-mode/y b/snippets/ruby-ts-mode/y new file mode 100644 index 000000000..967606104 --- /dev/null +++ b/snippets/ruby-ts-mode/y @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: :yields: arguments (rdoc) +# group : general +# -- +:yields: $0 \ No newline at end of file diff --git a/snippets/ruby-ts-mode/zip b/snippets/ruby-ts-mode/zip new file mode 100644 index 000000000..a2f30c6f1 --- /dev/null +++ b/snippets/ruby-ts-mode/zip @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: zip(...) { |...| ... } +# group : collections +# -- +zip(${enums}) { |${row}| $0 } \ No newline at end of file diff --git a/snippets/rust-ts-mode/afn b/snippets/rust-ts-mode/afn new file mode 100644 index 000000000..9ed1d9c76 --- /dev/null +++ b/snippets/rust-ts-mode/afn @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: async fn name() { ... } +# key: afn +# -- +async fn ${1:name}($2) { + $0 +} \ No newline at end of file diff --git a/snippets/rust-ts-mode/afnr b/snippets/rust-ts-mode/afnr new file mode 100644 index 000000000..71cbbbd49 --- /dev/null +++ b/snippets/rust-ts-mode/afnr @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: async fn name() -> Type { ... } +# key: afnr +# -- +async fn ${1:name}($2) -> ${3:Type} { + $0 +} \ No newline at end of file diff --git a/snippets/rust-ts-mode/afns b/snippets/rust-ts-mode/afns new file mode 100644 index 000000000..c88e67228 --- /dev/null +++ b/snippets/rust-ts-mode/afns @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: async fn name(&self) -> Type { ... } +# key: afns +# -- +async fn ${1:name}(${2:&self}) -> ${3:Type} { + $0 +} \ No newline at end of file diff --git a/snippets/rust-ts-mode/afnw b/snippets/rust-ts-mode/afnw new file mode 100644 index 000000000..3c358f88a --- /dev/null +++ b/snippets/rust-ts-mode/afnw @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: async fn name(x: T) where T: Clone { ... } +# key: afnw +# -- +async fn ${1:name}<${2:T}>(${3:x: T}) where ${4:T: Clone} { + $0 +} \ No newline at end of file diff --git a/snippets/rust-ts-mode/allow b/snippets/rust-ts-mode/allow new file mode 100644 index 000000000..c30c1e831 --- /dev/null +++ b/snippets/rust-ts-mode/allow @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: #[allow(lint)] +# key: allow +# -- +#[allow(${1:lint})] \ No newline at end of file diff --git a/snippets/rust-ts-mode/allow! b/snippets/rust-ts-mode/allow! new file mode 100644 index 000000000..cfb0c7d8a --- /dev/null +++ b/snippets/rust-ts-mode/allow! @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: #![allow(lint)] +# key: allow! +# -- +#![allow(${1:lint})] \ No newline at end of file diff --git a/snippets/rust-ts-mode/assert b/snippets/rust-ts-mode/assert new file mode 100644 index 000000000..d1252d0f2 --- /dev/null +++ b/snippets/rust-ts-mode/assert @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: assert!(predicate); +# key: ass +# -- +assert!(${1:predicate}); \ No newline at end of file diff --git a/snippets/rust-ts-mode/asserteq b/snippets/rust-ts-mode/asserteq new file mode 100644 index 000000000..7bfafd286 --- /dev/null +++ b/snippets/rust-ts-mode/asserteq @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: assert_eq!(expected, actual); +# key: asseq +# -- +assert_eq!(${1:expected}, ${2:actual}); \ No newline at end of file diff --git a/snippets/rust-ts-mode/case b/snippets/rust-ts-mode/case new file mode 100644 index 000000000..9ea660986 --- /dev/null +++ b/snippets/rust-ts-mode/case @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: pattern => expression, +# key: case +# -- +${1:pattern} => ${2:expression}, \ No newline at end of file diff --git a/snippets/rust-ts-mode/cfg b/snippets/rust-ts-mode/cfg new file mode 100644 index 000000000..583e02123 --- /dev/null +++ b/snippets/rust-ts-mode/cfg @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: #[cfg(option)] +# key: cfg +# -- +#[cfg(${1:option})] \ No newline at end of file diff --git a/snippets/rust-ts-mode/cfg= b/snippets/rust-ts-mode/cfg= new file mode 100644 index 000000000..b01a458ae --- /dev/null +++ b/snippets/rust-ts-mode/cfg= @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: #[cfg(option = "value")] +# key: cfg= +# -- +#[cfg(${1:option} = "${2:value}")] \ No newline at end of file diff --git a/snippets/rust-ts-mode/closure b/snippets/rust-ts-mode/closure new file mode 100644 index 000000000..1624d5700 --- /dev/null +++ b/snippets/rust-ts-mode/closure @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: closure +# key: || +# -- +|${1:arguments}| { + $0 +} diff --git a/snippets/rust-ts-mode/crate b/snippets/rust-ts-mode/crate new file mode 100644 index 000000000..ee9371e88 --- /dev/null +++ b/snippets/rust-ts-mode/crate @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: extern crate +# key: ec +# -- +extern crate ${1:name}; diff --git a/snippets/rust-ts-mode/deny b/snippets/rust-ts-mode/deny new file mode 100644 index 000000000..5b7f3d99b --- /dev/null +++ b/snippets/rust-ts-mode/deny @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: #[deny(lint)] +# key: deny +# -- +#[deny(${1:lint})] \ No newline at end of file diff --git a/snippets/rust-ts-mode/deny! b/snippets/rust-ts-mode/deny! new file mode 100644 index 000000000..232dfbcea --- /dev/null +++ b/snippets/rust-ts-mode/deny! @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: #![deny(lint)] +# key: deny! +# -- +#![deny(${1:lint})] \ No newline at end of file diff --git a/snippets/rust-ts-mode/derive b/snippets/rust-ts-mode/derive new file mode 100644 index 000000000..581c86fa4 --- /dev/null +++ b/snippets/rust-ts-mode/derive @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: #[derive(Trait)] +# key: derive +# -- +#[derive(${1:Trait})] \ No newline at end of file diff --git a/snippets/rust-ts-mode/display b/snippets/rust-ts-mode/display new file mode 100644 index 000000000..1764f6709 --- /dev/null +++ b/snippets/rust-ts-mode/display @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# name: impl Display for Type { fn fmt (...) } +# key: display +# -- +impl Display for ${1:Type} { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, "$0") + } +} diff --git a/snippets/rust-ts-mode/drop b/snippets/rust-ts-mode/drop new file mode 100644 index 000000000..ba23a5b0f --- /dev/null +++ b/snippets/rust-ts-mode/drop @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# name: impl Drop for Type { fn drop(...) } +# key: drop +# -- +impl Drop for ${1:Type} { + fn drop(&mut self) { + $0 + } +} diff --git a/snippets/rust-ts-mode/enum b/snippets/rust-ts-mode/enum new file mode 100644 index 000000000..acf919b87 --- /dev/null +++ b/snippets/rust-ts-mode/enum @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: enum Type { ... } +# key: enum +# -- +enum ${1:Type} { + $0 +} diff --git a/snippets/rust-ts-mode/eprint b/snippets/rust-ts-mode/eprint new file mode 100644 index 000000000..a40a749ec --- /dev/null +++ b/snippets/rust-ts-mode/eprint @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: eprint!("{}", value); +# key: eprint +# -- +eprint!("${1:{\}}", $2); diff --git a/snippets/rust-ts-mode/eprintln b/snippets/rust-ts-mode/eprintln new file mode 100644 index 000000000..0806251f0 --- /dev/null +++ b/snippets/rust-ts-mode/eprintln @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: eprintln!("{}", value); +# key: eprintln +# -- +eprintln!("${1:{\}}", $2); diff --git a/snippets/rust-ts-mode/fn b/snippets/rust-ts-mode/fn new file mode 100644 index 000000000..459fd496c --- /dev/null +++ b/snippets/rust-ts-mode/fn @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: fn name() { ... } +# key: fn +# -- +fn ${1:name}($2) { + $0 +} \ No newline at end of file diff --git a/snippets/rust-ts-mode/fnr b/snippets/rust-ts-mode/fnr new file mode 100644 index 000000000..fa98eb201 --- /dev/null +++ b/snippets/rust-ts-mode/fnr @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: fn name() -> Type { ... } +# key: fnr +# -- +fn ${1:name}($2) -> ${3:Type} { + $0 +} diff --git a/snippets/rust-ts-mode/fns b/snippets/rust-ts-mode/fns new file mode 100644 index 000000000..23fada7a9 --- /dev/null +++ b/snippets/rust-ts-mode/fns @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: fn name(&self) -> Type { ... } +# key: fns +# -- +fn ${1:name}(${2:&self}) -> ${3:Type} { + $0 +} \ No newline at end of file diff --git a/snippets/rust-ts-mode/fnw b/snippets/rust-ts-mode/fnw new file mode 100644 index 000000000..321c29217 --- /dev/null +++ b/snippets/rust-ts-mode/fnw @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: fn name(x: T) where T: Clone { ... } +# key: fnw +# -- +fn ${1:name}<${2:T}>(${3:x: T}) where ${4:T: Clone} { + $0 +} diff --git a/snippets/rust-ts-mode/for b/snippets/rust-ts-mode/for new file mode 100644 index 000000000..66dca093b --- /dev/null +++ b/snippets/rust-ts-mode/for @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: for var in iterable { ... } +# key: for +# -- +for ${1:var} in ${2:iterable} { + $0 +} \ No newline at end of file diff --git a/snippets/rust-ts-mode/from b/snippets/rust-ts-mode/from new file mode 100644 index 000000000..9e86209e3 --- /dev/null +++ b/snippets/rust-ts-mode/from @@ -0,0 +1,10 @@ +# -*- mode: snippet -*- +# name: impl From for Type { fn from(...) } +# key: from +# -- +impl From<${1:From}> for ${2:Type} { + fn from(source: $1) -> Self { + $0 + Self { } + } +} diff --git a/snippets/rust-ts-mode/fromstr b/snippets/rust-ts-mode/fromstr new file mode 100644 index 000000000..891751c0e --- /dev/null +++ b/snippets/rust-ts-mode/fromstr @@ -0,0 +1,11 @@ +# -*- mode: snippet -*- +# name: impl FromStr for Type { fn from_str(...) } +# key: fromstr +# -- +impl FromStr for ${1:Type} { + type Err = ${2:Error}; + + fn from_str(s: &str) -> Result { + Ok(Self{}) + } +} diff --git a/snippets/rust-ts-mode/if b/snippets/rust-ts-mode/if new file mode 100644 index 000000000..c793acea9 --- /dev/null +++ b/snippets/rust-ts-mode/if @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: if expr { ... } +# key: if +# -- +if ${1:expression} { + $0 +} \ No newline at end of file diff --git a/snippets/rust-ts-mode/ife b/snippets/rust-ts-mode/ife new file mode 100644 index 000000000..12f2b56e8 --- /dev/null +++ b/snippets/rust-ts-mode/ife @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# name: if expression { ... } else { .. } +# key: ife +# -- +if ${1:expression} { + $0 +} else { + +} diff --git a/snippets/rust-ts-mode/ifl b/snippets/rust-ts-mode/ifl new file mode 100644 index 000000000..e4febb8ac --- /dev/null +++ b/snippets/rust-ts-mode/ifl @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: if let pattern = expression { ... }; +# key: ifl +# -- +if let ${1:pattern} = ${2:expression} { + $0 +}; diff --git a/snippets/rust-ts-mode/impl b/snippets/rust-ts-mode/impl new file mode 100644 index 000000000..14bb06f7c --- /dev/null +++ b/snippets/rust-ts-mode/impl @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: impl Type { ... } +# key: impl +# -- +impl ${1:Type} { + $0 +} diff --git a/snippets/rust-ts-mode/implt b/snippets/rust-ts-mode/implt new file mode 100644 index 000000000..0ed9b7dd5 --- /dev/null +++ b/snippets/rust-ts-mode/implt @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: impl Trait for Type { ... } +# key: implt +# -- +impl ${1:Trait} for ${2:Type} { + $0 +} diff --git a/snippets/rust-ts-mode/let b/snippets/rust-ts-mode/let new file mode 100644 index 000000000..9f603eaf7 --- /dev/null +++ b/snippets/rust-ts-mode/let @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: let pattern = expression; +# key: let +# -- +let ${1:pattern} = ${2:expression}; \ No newline at end of file diff --git a/snippets/rust-ts-mode/letm b/snippets/rust-ts-mode/letm new file mode 100644 index 000000000..b07d6733b --- /dev/null +++ b/snippets/rust-ts-mode/letm @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: let mut pattern = expression; +# key: letm +# -- +let mut ${1:pattern} = ${2:expression}; \ No newline at end of file diff --git a/snippets/rust-ts-mode/lett b/snippets/rust-ts-mode/lett new file mode 100644 index 000000000..10a7fa6e7 --- /dev/null +++ b/snippets/rust-ts-mode/lett @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: let pattern: type = expression; +# key: lett +# -- +let ${1:pattern}: ${2:type} = ${3:expression}; \ No newline at end of file diff --git a/snippets/rust-ts-mode/lettm b/snippets/rust-ts-mode/lettm new file mode 100644 index 000000000..9ceb8c343 --- /dev/null +++ b/snippets/rust-ts-mode/lettm @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: let mut pattern: type = expression; +# key: lettm +# -- +let mut ${1:pattern}: ${2:type} = ${3:expression}; \ No newline at end of file diff --git a/snippets/rust-ts-mode/loop b/snippets/rust-ts-mode/loop new file mode 100644 index 000000000..e24ae616a --- /dev/null +++ b/snippets/rust-ts-mode/loop @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: loop { ... } +# key: loop +# -- +loop { + $0 +} diff --git a/snippets/rust-ts-mode/macro b/snippets/rust-ts-mode/macro new file mode 100644 index 000000000..410c1329b --- /dev/null +++ b/snippets/rust-ts-mode/macro @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: macro_rules! name { (..) => (..); } +# key: macro +# -- +macro_rules! ${1:name} { + ($2) => ($3); +} diff --git a/snippets/rust-ts-mode/main b/snippets/rust-ts-mode/main new file mode 100644 index 000000000..3f9fe318a --- /dev/null +++ b/snippets/rust-ts-mode/main @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: fn main() { ... } +# key: main +# -- +fn main() { + $0 +} diff --git a/snippets/rust-ts-mode/match b/snippets/rust-ts-mode/match new file mode 100644 index 000000000..9dc802f11 --- /dev/null +++ b/snippets/rust-ts-mode/match @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: match expression { ... } +# key: match +# -- +match ${1:expression} { + $0 +} diff --git a/snippets/rust-ts-mode/new b/snippets/rust-ts-mode/new new file mode 100644 index 000000000..c5f21c13a --- /dev/null +++ b/snippets/rust-ts-mode/new @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: pub fn new() { ... } +# key: new +# -- +pub fn new($1) -> ${2:Name} { + $2 { ${3} } +} diff --git a/snippets/rust-ts-mode/pafn b/snippets/rust-ts-mode/pafn new file mode 100644 index 000000000..13edd5ccc --- /dev/null +++ b/snippets/rust-ts-mode/pafn @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: pub async fn name() { ... } +# key: pafn +# -- +pub async fn ${1:name}($2) { + $0 +} \ No newline at end of file diff --git a/snippets/rust-ts-mode/pafnr b/snippets/rust-ts-mode/pafnr new file mode 100644 index 000000000..3ce96818f --- /dev/null +++ b/snippets/rust-ts-mode/pafnr @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: pub async fn name() -> Type { ... } +# key: pafnr +# -- +pub async fn ${1:name}($2) -> ${3:Type} { + $0 +} \ No newline at end of file diff --git a/snippets/rust-ts-mode/pafns b/snippets/rust-ts-mode/pafns new file mode 100644 index 000000000..ad223f904 --- /dev/null +++ b/snippets/rust-ts-mode/pafns @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: pub async fn name(&self) -> Type { ... } +# key: pafns +# -- +pub async fn ${1:name}(${2:&self}) -> ${3:Type} { + $0 +} \ No newline at end of file diff --git a/snippets/rust-ts-mode/pafnw b/snippets/rust-ts-mode/pafnw new file mode 100644 index 000000000..bea6dd2d8 --- /dev/null +++ b/snippets/rust-ts-mode/pafnw @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: pub async fn name(x: T) where T: Clone { ... } +# key: pafnw +# -- +pub async fn ${1:name}<${2:T}>(${3:x: T}) where ${4:T: Clone} { + $0 +} \ No newline at end of file diff --git a/snippets/rust-ts-mode/pfn b/snippets/rust-ts-mode/pfn new file mode 100644 index 000000000..5f7513154 --- /dev/null +++ b/snippets/rust-ts-mode/pfn @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: pub fn name() { ... } +# key: pfn +# -- +pub fn ${1:name}($2) { + $0 +} \ No newline at end of file diff --git a/snippets/rust-ts-mode/pfnr b/snippets/rust-ts-mode/pfnr new file mode 100644 index 000000000..4fdd2610c --- /dev/null +++ b/snippets/rust-ts-mode/pfnr @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: pub fn name() -> Type { ... } +# key: pfnr +# -- +pub fn ${1:name}($2) -> ${3:Type} { + $0 +} diff --git a/snippets/rust-ts-mode/pfns b/snippets/rust-ts-mode/pfns new file mode 100644 index 000000000..4ad120fc3 --- /dev/null +++ b/snippets/rust-ts-mode/pfns @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: pub fn name(&self) -> Type { ... } +# key: pfns +# -- +pub fn ${1:name}(${2:&self}) -> ${3:Type} { + $0 +} \ No newline at end of file diff --git a/snippets/rust-ts-mode/pfnw b/snippets/rust-ts-mode/pfnw new file mode 100644 index 000000000..c26440060 --- /dev/null +++ b/snippets/rust-ts-mode/pfnw @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: pub fn name(x: T) where T: Clone { ... } +# key: pfnw +# -- +pub fn ${1:name}<${2:T}>(${3:x: T}) where ${4:T: Clone} { + $0 +} diff --git a/snippets/rust-ts-mode/print b/snippets/rust-ts-mode/print new file mode 100644 index 000000000..403ffd95f --- /dev/null +++ b/snippets/rust-ts-mode/print @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: print!("{}", value); +# key: print +# -- +print!("${1:{\}}", $2); \ No newline at end of file diff --git a/snippets/rust-ts-mode/println b/snippets/rust-ts-mode/println new file mode 100644 index 000000000..9d35fc593 --- /dev/null +++ b/snippets/rust-ts-mode/println @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: println!("{}", value); +# key: println +# -- +println!("${1:{\}}", $2); \ No newline at end of file diff --git a/snippets/rust-ts-mode/result b/snippets/rust-ts-mode/result new file mode 100644 index 000000000..6996dd460 --- /dev/null +++ b/snippets/rust-ts-mode/result @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: Result +# key: result +# -- +Result<${1:Type}, ${2:failure::Error}> \ No newline at end of file diff --git a/snippets/rust-ts-mode/spawn b/snippets/rust-ts-mode/spawn new file mode 100644 index 000000000..c5b74456a --- /dev/null +++ b/snippets/rust-ts-mode/spawn @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: spawn(proc() { ... }); +# key: spawn +# -- +spawn(proc() { + $0 +}); diff --git a/snippets/rust-ts-mode/static b/snippets/rust-ts-mode/static new file mode 100644 index 000000000..eef8072d0 --- /dev/null +++ b/snippets/rust-ts-mode/static @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: CONSTANT: Type = value; +# key: static +# -- +static ${1:CONSTANT}: ${2:Type} = ${3:value}; \ No newline at end of file diff --git a/snippets/rust-ts-mode/struct b/snippets/rust-ts-mode/struct new file mode 100644 index 000000000..7de2ffa77 --- /dev/null +++ b/snippets/rust-ts-mode/struct @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: struct TypeName { .. } +# key: struct +# -- +struct ${1:TypeName} { + $0 +} diff --git a/snippets/rust-ts-mode/test b/snippets/rust-ts-mode/test new file mode 100644 index 000000000..26efca13e --- /dev/null +++ b/snippets/rust-ts-mode/test @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: #[test] fn test_name() { .. } +# key: test +# -- +#[test] +fn ${1:test_name}() { + $0 +} diff --git a/snippets/rust-ts-mode/testmod b/snippets/rust-ts-mode/testmod new file mode 100644 index 000000000..d3494b702 --- /dev/null +++ b/snippets/rust-ts-mode/testmod @@ -0,0 +1,13 @@ +# -*- mode: snippet -*- +# name: test module +# key: testmod +# -- +#[cfg(test)] +mod ${1:tests} { + use super::*; + + #[test] + fn ${2:test_name}() { + $0 + } +} diff --git a/snippets/rust-ts-mode/trait b/snippets/rust-ts-mode/trait new file mode 100644 index 000000000..724df7f5f --- /dev/null +++ b/snippets/rust-ts-mode/trait @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: trait Type { ... } +# key: trait +# -- +trait ${1:Type} { + $0 +} diff --git a/snippets/rust-ts-mode/type b/snippets/rust-ts-mode/type new file mode 100644 index 000000000..584a08911 --- /dev/null +++ b/snippets/rust-ts-mode/type @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: type TypeName = TypeName; +# key: type +# -- +type ${1:TypeName} = ${2:TypeName}; \ No newline at end of file diff --git a/snippets/rust-ts-mode/union b/snippets/rust-ts-mode/union new file mode 100644 index 000000000..92585a265 --- /dev/null +++ b/snippets/rust-ts-mode/union @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: union Type { ... } +# key: union +# -- +union ${1:Type} { + $0 +} diff --git a/snippets/rust-ts-mode/warn b/snippets/rust-ts-mode/warn new file mode 100644 index 000000000..acf5c5c50 --- /dev/null +++ b/snippets/rust-ts-mode/warn @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: #[warn(lint)] +# key: warn +# -- +#[warn(${1:lint})] \ No newline at end of file diff --git a/snippets/rust-ts-mode/warn! b/snippets/rust-ts-mode/warn! new file mode 100644 index 000000000..2f4885dfd --- /dev/null +++ b/snippets/rust-ts-mode/warn! @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: #![warn(lint)] +# key: warn! +# -- +#![warn(${1:lint})] \ No newline at end of file diff --git a/snippets/rust-ts-mode/while b/snippets/rust-ts-mode/while new file mode 100644 index 000000000..dbb366391 --- /dev/null +++ b/snippets/rust-ts-mode/while @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: while expression { ... } +# key: while +# -- +while ${1:expression} { + $0 +} diff --git a/snippets/rust-ts-mode/whilel b/snippets/rust-ts-mode/whilel new file mode 100644 index 000000000..91370147d --- /dev/null +++ b/snippets/rust-ts-mode/whilel @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: while let pattern = expression { ... } +# key: whilel +# -- +while let ${1:pattern} = ${2:expression} { + $0 +} diff --git a/snippets/scala-ts-mode/app b/snippets/scala-ts-mode/app new file mode 100644 index 000000000..b21cdb5cb --- /dev/null +++ b/snippets/scala-ts-mode/app @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# contributor: Anders Bach Nielsen +# name: object name extends App +# key: app +# -- +object ${1:name} extends App { + $0 +} \ No newline at end of file diff --git a/snippets/scala-ts-mode/case b/snippets/scala-ts-mode/case new file mode 100644 index 000000000..5e0366087 --- /dev/null +++ b/snippets/scala-ts-mode/case @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# contributor: Jonas Bonèr +# name: case pattern => +# key: case +# -- +case ${1:_} => $0 \ No newline at end of file diff --git a/snippets/scala-ts-mode/cc b/snippets/scala-ts-mode/cc new file mode 100644 index 000000000..95ff430ee --- /dev/null +++ b/snippets/scala-ts-mode/cc @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# contributor: Sam Halliday +# name: case class T(arg: A) +# key: cc +# -- +case class ${1:Name}( + ${2:arg}: ${3:Type} +) \ No newline at end of file diff --git a/snippets/scala-ts-mode/co b/snippets/scala-ts-mode/co new file mode 100644 index 000000000..8bbafc0de --- /dev/null +++ b/snippets/scala-ts-mode/co @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# contributor: Jonas Bonèr +# name: case object T +# key: co +# -- +case object ${1:name} $0 \ No newline at end of file diff --git a/snippets/scala-ts-mode/cons b/snippets/scala-ts-mode/cons new file mode 100644 index 000000000..2acdaffae --- /dev/null +++ b/snippets/scala-ts-mode/cons @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# contributor: Jonas Bonèr +# name: element1 :: element2 +# key: cons +# -- +${1:element1} :: ${2:element2} $0 \ No newline at end of file diff --git a/snippets/scala-ts-mode/def b/snippets/scala-ts-mode/def new file mode 100644 index 000000000..a1dcc7f46 --- /dev/null +++ b/snippets/scala-ts-mode/def @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# contributor: Jonas Bonèr +# name: def f(arg: T): R = {...} +# key: def +# -- +def ${1:name}(${2:args}): ${3:Unit} = { + $0 +} \ No newline at end of file diff --git a/snippets/scala-ts-mode/doc b/snippets/scala-ts-mode/doc new file mode 100644 index 000000000..00e5f071f --- /dev/null +++ b/snippets/scala-ts-mode/doc @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# contributor: Anders Bach Nielsen +# name: /** ... */ +# key: doc +# -- +/** + * ${1:description} + * $0 + */ \ No newline at end of file diff --git a/snippets/scala-ts-mode/docfun b/snippets/scala-ts-mode/docfun new file mode 100644 index 000000000..bffc75de8 --- /dev/null +++ b/snippets/scala-ts-mode/docfun @@ -0,0 +1,40 @@ +# -*- mode: snippet -*- +# -*- coding: utf-8 -*- +# name: docstring function +# contributor: Andrea Giugliano +# key: docfun +# inspired by a snippet by Tibor Simko et al. +# -- +/** + * $1 + * ${3:$ + (let* ((indent + (concat "\n * ")) + (args + (mapconcat + '(lambda (x) + (if (not (string= (nth 0 x) "")) + ;; in Scala I get a separator : for the type + (let ((par-type (mapcar 'string-trim (split-string (nth 0 x) ":")))) (concat "@param " (first par-type) indent "@tparam " (second par-type) indent)) + )) + (mapcar + '(lambda (x) + (mapcar + '(lambda (x) + (replace-regexp-in-string "[[:blank:]]*$" "" + (replace-regexp-in-string "^[[:blank:]]*" "" x))) + x)) + (mapcar '(lambda (x) (split-string x "=")) + (split-string yas-text ","))) + indent))) + (if (string= args "") + (concat indent "@return: " indent "@rtype: " indent (make-string 3 34)) + (mapconcat + 'identity + (list "" args ) + indent))) + } + * @return ${4:$(yas-text)} + * + **/ +def ${2:name}($3): $4 = $0 \ No newline at end of file diff --git a/snippets/scala-ts-mode/for b/snippets/scala-ts-mode/for new file mode 100644 index 000000000..34c1b27d7 --- /dev/null +++ b/snippets/scala-ts-mode/for @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# contributor: Sam Halliday +# name: for { x <- xs } yield +# key: for +# -- +for { + ${1:x} <- ${2:xs} +} yield ${3:x} \ No newline at end of file diff --git a/snippets/scala-ts-mode/if b/snippets/scala-ts-mode/if new file mode 100644 index 000000000..65979e100 --- /dev/null +++ b/snippets/scala-ts-mode/if @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# contributor: Jonas Bonèr +# name: if (cond) { .. } +# key: if +# -- +if (${1:condition}) { + $0 +} \ No newline at end of file diff --git a/snippets/scala-ts-mode/ls b/snippets/scala-ts-mode/ls new file mode 100644 index 000000000..4445fb273 --- /dev/null +++ b/snippets/scala-ts-mode/ls @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# contributor: Jonas Bonèr +# name: List(..) +# key: ls +# -- +List(${1:args}, ${2:args}) $0 \ No newline at end of file diff --git a/snippets/scala-ts-mode/main b/snippets/scala-ts-mode/main new file mode 100644 index 000000000..4121c2bfb --- /dev/null +++ b/snippets/scala-ts-mode/main @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# contributor: Jonas Bonèr +# name: def main(args: Array[String]) = { ... } +# key: main +# -- +def main(args: Array[String]) = { + $0 +} \ No newline at end of file diff --git a/snippets/scala-ts-mode/match b/snippets/scala-ts-mode/match new file mode 100644 index 000000000..30c694eae --- /dev/null +++ b/snippets/scala-ts-mode/match @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# contributor: Jonas Bonèr +# name: cc match { .. } +# key: match +# -- +${1:cc} match { + case ${2:pattern} => $0 +} \ No newline at end of file diff --git a/snippets/scala-ts-mode/ob b/snippets/scala-ts-mode/ob new file mode 100644 index 000000000..306372054 --- /dev/null +++ b/snippets/scala-ts-mode/ob @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# contributor: Jonas Bonèr +# name: object name extends T +# key: ob +# -- +object ${1:name} extends ${2:type} $0 \ No newline at end of file diff --git a/snippets/scala-ts-mode/throw b/snippets/scala-ts-mode/throw new file mode 100644 index 000000000..c05fd88c3 --- /dev/null +++ b/snippets/scala-ts-mode/throw @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# contributor: Jonas Bonèr +# name: throw new Exception +# key: throw +# -- +throw new ${1:Exception}(${2:msg}) $0 \ No newline at end of file diff --git a/snippets/scala-ts-mode/try b/snippets/scala-ts-mode/try new file mode 100644 index 000000000..b02fcff3e --- /dev/null +++ b/snippets/scala-ts-mode/try @@ -0,0 +1,11 @@ +# -*- mode: snippet -*- +# contributor: Sam Halliday +# name: try { .. } catch { case e => ..} +# key: try +# -- +try { + $0 +} catch { + case e: ${1:Throwable} => + ${2:// TODO: handle exception} +} \ No newline at end of file diff --git a/snippets/scala-ts-mode/valueclass b/snippets/scala-ts-mode/valueclass new file mode 100644 index 000000000..5adecf4ef --- /dev/null +++ b/snippets/scala-ts-mode/valueclass @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# contributor: Michael Pollmeier +# name: value class +# key: vc +# -- +case class ${1:Name}(value: ${2:Type}) extends AnyVal diff --git a/snippets/sh-ts-mode/args b/snippets/sh-ts-mode/args new file mode 100644 index 000000000..018f60a90 --- /dev/null +++ b/snippets/sh-ts-mode/args @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: args +# key: args +# -- +if [ $# -lt ${1:2} ] + then $0 +fi \ No newline at end of file diff --git a/snippets/sh-ts-mode/bang b/snippets/sh-ts-mode/bang new file mode 100644 index 000000000..5e11f0ebc --- /dev/null +++ b/snippets/sh-ts-mode/bang @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: bang +# key: ! +# -- +#!/usr/bin/env bash +$0 \ No newline at end of file diff --git a/snippets/sh-ts-mode/case b/snippets/sh-ts-mode/case new file mode 100644 index 000000000..648daef4b --- /dev/null +++ b/snippets/sh-ts-mode/case @@ -0,0 +1,10 @@ +# -*- mode: snippet -*- +# name: case +# key: case +# -- +case ${1:cond} in + ${2:pattern} ) + ${3:stuff} + ;; + $0 +esac diff --git a/snippets/sh-ts-mode/for loop b/snippets/sh-ts-mode/for loop new file mode 100644 index 000000000..438706beb --- /dev/null +++ b/snippets/sh-ts-mode/for loop @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: for loop +# key: for +# -- +for ${1:var} in ${2:stuff}; do + $0 +done \ No newline at end of file diff --git a/snippets/sh-ts-mode/function b/snippets/sh-ts-mode/function new file mode 100644 index 000000000..c0f670aa2 --- /dev/null +++ b/snippets/sh-ts-mode/function @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: function +# key: f +# -- +function ${1:name} { + $0 +} \ No newline at end of file diff --git a/snippets/sh-ts-mode/if b/snippets/sh-ts-mode/if new file mode 100644 index 000000000..2dc537ddd --- /dev/null +++ b/snippets/sh-ts-mode/if @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: if +# key: if +# -- +if ${1:[ -f file]} + then ${2:do} +fi +$0 \ No newline at end of file diff --git a/snippets/sh-ts-mode/ife b/snippets/sh-ts-mode/ife new file mode 100644 index 000000000..f046a3e51 --- /dev/null +++ b/snippets/sh-ts-mode/ife @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# name: ife +# key: ife +# -- +if ${1:cond} +then ${2:stuff} +else ${3:other} +fi +$0 \ No newline at end of file diff --git a/snippets/sh-ts-mode/safe-bang b/snippets/sh-ts-mode/safe-bang new file mode 100644 index 000000000..ef93a83d6 --- /dev/null +++ b/snippets/sh-ts-mode/safe-bang @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# name: safer bash settings for scripts +# key: s! +# -- +#!/usr/bin/env bash +set -euo pipefail +IFS=$'\n\t' + +$0 \ No newline at end of file diff --git a/snippets/sh-ts-mode/script-dir b/snippets/sh-ts-mode/script-dir new file mode 100644 index 000000000..49cf35eae --- /dev/null +++ b/snippets/sh-ts-mode/script-dir @@ -0,0 +1,14 @@ +# -*- mode: snippet -*- +# name: the currently executing/sourced script's directory +# key: script-dir +# -- +# See https://stackoverflow.com/a/246128/3561275 +SOURCE="\${BASH_SOURCE[0]}" +while [ -h "\$SOURCE" ]; do # resolve \$SOURCE until the file is no longer a symlink + DIR="\$( cd -P "\$( dirname "\$SOURCE" )" >/dev/null 2>&1 && pwd )" + SOURCE="\$(readlink "\$SOURCE")" + [[ \$SOURCE != /* ]] && SOURCE="\$DIR/\$SOURCE" # if \$SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located +done +DIR="\$( cd -P "\$( dirname "\$SOURCE" )" >/dev/null 2>&1 && pwd )" + +$0 \ No newline at end of file diff --git a/snippets/sh-ts-mode/select b/snippets/sh-ts-mode/select new file mode 100644 index 000000000..794971066 --- /dev/null +++ b/snippets/sh-ts-mode/select @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: select +# key: select +# -- +select ${1:var} in ${2:stuff}; do + $0 +done diff --git a/snippets/sh-ts-mode/until b/snippets/sh-ts-mode/until new file mode 100644 index 000000000..a99709cc2 --- /dev/null +++ b/snippets/sh-ts-mode/until @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: until loop +# key: until +# -- +until ${1:cond}; do + $0 +done \ No newline at end of file diff --git a/snippets/sh-ts-mode/while b/snippets/sh-ts-mode/while new file mode 100644 index 000000000..16b147c19 --- /dev/null +++ b/snippets/sh-ts-mode/while @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: while loop +# key: while +# -- +while ${1:cond}; do + $0 +done \ No newline at end of file diff --git a/snippets/swift-ts-mode/available b/snippets/swift-ts-mode/available new file mode 100644 index 000000000..6f2d944cd --- /dev/null +++ b/snippets/swift-ts-mode/available @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: available +# key: available +# -- +@available(iOS $1, *) \ No newline at end of file diff --git a/snippets/swift-ts-mode/checkversion b/snippets/swift-ts-mode/checkversion new file mode 100644 index 000000000..7442b38b6 --- /dev/null +++ b/snippets/swift-ts-mode/checkversion @@ -0,0 +1,11 @@ +# -*- mode: snippet -*- +# name: checkversion +# key: checkversion +# -- +#if swift(>=3.0) + $0 +#elseif swift(>=2.2) + $2 +#elseif swift(>=2.1) + $2 +#endif \ No newline at end of file diff --git a/snippets/swift-ts-mode/dispatchafter b/snippets/swift-ts-mode/dispatchafter new file mode 100644 index 000000000..b44418f40 --- /dev/null +++ b/snippets/swift-ts-mode/dispatchafter @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: dispatchAfter +# key: dispatchAfter +# -- +DispatchQueue.main.asyncAfter(deadline: .now() + .seconds($1)) { + $0 +} \ No newline at end of file diff --git a/snippets/swift-ts-mode/dispatchasync b/snippets/swift-ts-mode/dispatchasync new file mode 100644 index 000000000..065484fbd --- /dev/null +++ b/snippets/swift-ts-mode/dispatchasync @@ -0,0 +1,10 @@ +# -*- mode: snippet -*- +# name: dispatchAsync +# key: dispatchAsync +# -- +DispatchQueue.global(qos: .default).async { + $1 + DispatchQueue.main.async { + $0 + } +} \ No newline at end of file diff --git a/snippets/swift-ts-mode/dispatchmain b/snippets/swift-ts-mode/dispatchmain new file mode 100644 index 000000000..6994da617 --- /dev/null +++ b/snippets/swift-ts-mode/dispatchmain @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: dispatchMain +# key: dispatchMain +# -- +DispatchQueue.main.async(execute: { () -> Void in + $0 +}) \ No newline at end of file diff --git a/snippets/swift-ts-mode/documentdirectory b/snippets/swift-ts-mode/documentdirectory new file mode 100644 index 000000000..d1fe73407 --- /dev/null +++ b/snippets/swift-ts-mode/documentdirectory @@ -0,0 +1,10 @@ +# -*- mode: snippet -*- +# name: documentDirectory +# key: documentDirectory +# -- +if let path = + NSSearchPathForDirectoriesInDomains( + FileManager.SearchPathDirectory.documentDirectory, + FileManager.SearchPathDomainMask.userDomainMask, true).first { + let documentsDirectoryURL = NSURL.fileURL(withPath: path) +} \ No newline at end of file diff --git a/snippets/swift-ts-mode/forcase b/snippets/swift-ts-mode/forcase new file mode 100644 index 000000000..7e04f3255 --- /dev/null +++ b/snippets/swift-ts-mode/forcase @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: forcase +# key: forcase +# -- +for case let $1 in $2 as $3 { + $0 +} \ No newline at end of file diff --git a/snippets/swift-ts-mode/fori b/snippets/swift-ts-mode/fori new file mode 100644 index 000000000..520be27b6 --- /dev/null +++ b/snippets/swift-ts-mode/fori @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: fori +# key: fori +# -- +for $1 in $2 { + $0 +} \ No newline at end of file diff --git a/snippets/swift-ts-mode/func b/snippets/swift-ts-mode/func new file mode 100644 index 000000000..aba9b08d0 --- /dev/null +++ b/snippets/swift-ts-mode/func @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: func +# key: func +# -- +func $1() -> $2 { + $0 +} \ No newline at end of file diff --git a/snippets/swift-ts-mode/if b/snippets/swift-ts-mode/if new file mode 100644 index 000000000..748cec205 --- /dev/null +++ b/snippets/swift-ts-mode/if @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: if (...) { ... } +# key: if +# -- +if $1 { + $0 +} \ No newline at end of file diff --git a/snippets/swift-ts-mode/initcoder b/snippets/swift-ts-mode/initcoder new file mode 100644 index 000000000..5f0c30fbc --- /dev/null +++ b/snippets/swift-ts-mode/initcoder @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: initcoder +# key: initcoder +# -- +public required init?(coder aDecoder: NSCoder) { + fatalError("init(coder:) has not been implemented") +} \ No newline at end of file diff --git a/snippets/swift-ts-mode/let b/snippets/swift-ts-mode/let new file mode 100644 index 000000000..a9333fb2c --- /dev/null +++ b/snippets/swift-ts-mode/let @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: let +# key: let +# -- +let $1: $2 = $0 \ No newline at end of file diff --git a/snippets/swift-ts-mode/mark b/snippets/swift-ts-mode/mark new file mode 100644 index 000000000..8abacfd42 --- /dev/null +++ b/snippets/swift-ts-mode/mark @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: mark +# key: mark +# -- +// MARK: - $1 \ No newline at end of file diff --git a/snippets/swift-ts-mode/prop b/snippets/swift-ts-mode/prop new file mode 100644 index 000000000..2600c3ed9 --- /dev/null +++ b/snippets/swift-ts-mode/prop @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: prop-getset +# key: prop-getset +# -- +var $1: $2 { + get {$3} + set {$3 = value } +} \ No newline at end of file diff --git a/snippets/swift-ts-mode/sortarrayofstrings b/snippets/swift-ts-mode/sortarrayofstrings new file mode 100644 index 000000000..1ed97e7ab --- /dev/null +++ b/snippets/swift-ts-mode/sortarrayofstrings @@ -0,0 +1,11 @@ +# -*- mode: snippet -*- +# name: sortarrayofstrings +# key: sortarrayofstrings +# -- +$1.sorted { (a, b) -> Bool in + let comparisonResult = a.compare(b, + options: [], + range: a.range(of: a), + locale: Locale.current) + return comparisonResult == .orderedSame +} \ No newline at end of file diff --git a/snippets/swift-ts-mode/trycatch b/snippets/swift-ts-mode/trycatch new file mode 100644 index 000000000..1e417e534 --- /dev/null +++ b/snippets/swift-ts-mode/trycatch @@ -0,0 +1,11 @@ +# -*- mode: snippet -*- +# name: trycatch +# key: trycatch +# -- +do { + try $1 +} catch $2 { + $3 +} catch $4 { + $5 +} \ No newline at end of file diff --git a/snippets/swift-ts-mode/uialertcontroller b/snippets/swift-ts-mode/uialertcontroller new file mode 100644 index 000000000..13b650f34 --- /dev/null +++ b/snippets/swift-ts-mode/uialertcontroller @@ -0,0 +1,17 @@ +# -*- mode: snippet -*- +# name: uialertController +# key: uialertController +# -- +let alert = + UIAlertController(title: $1, + message: $2, + preferredStyle: .alert) + alert.addAction(UIAlertAction(title: "", + style: .default, + handler: { (action) in + alert.dismiss(animated: true, completion: { + $0 + }) +})) + +self.presentViewController(alert, animated: true, completion: nil) \ No newline at end of file diff --git a/snippets/swift-ts-mode/uicollectionviewdatasource b/snippets/swift-ts-mode/uicollectionviewdatasource new file mode 100644 index 000000000..4ccaa63a4 --- /dev/null +++ b/snippets/swift-ts-mode/uicollectionviewdatasource @@ -0,0 +1,37 @@ +# -*- mode: snippet -*- +# name: uicollectionViewDataSource +# key: uicollectionViewDataSource +# -- +// MARK: UICollectionViewDataSource + +func numberOfSections(in collectionView: UICollectionView) -> Int { + return $1 +} + +func collectionView(_ collectionView: UICollectionView, + numberOfItemsInSection section: Int) -> Int { + // TODO:- Required Method + return $2 +} + +func collectionView(_ collectionView: UICollectionView, + cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { + let cell = + collectionView.dequeueReusableCell(withReuseIdentifier: $3, for: indexPath) + configureCell(cell: cell, forItemAt: indexPath) + // TODO:- Required Method + return cell +} + +func configureCell(cell: UICollectionViewCell, forItemAt indexPath: IndexPath) { + +} + +func collectionView(_ collectionView: UICollectionView, + viewForSupplementaryElementOfKind kind: String, + at indexPath: IndexPath) -> UICollectionReusableView { + let view = collectionView.dequeueReusableSupplementaryView( + ofKind: UICollectionElementKindSectionHeader, + withReuseIdentifier: $3, for: indexPath) as UIView + return view +} \ No newline at end of file diff --git a/snippets/swift-ts-mode/uicollectionviewdelegate b/snippets/swift-ts-mode/uicollectionviewdelegate new file mode 100644 index 000000000..abdbc0df0 --- /dev/null +++ b/snippets/swift-ts-mode/uicollectionviewdelegate @@ -0,0 +1,15 @@ +# -*- mode: snippet -*- +# name: uiCollectionViewDelegate +# key: uiCollectionViewDelegate +# -- +// MARK: UICollectionViewDelegate + +func collectionView(_ collectionView: UICollectionView, + didSelectItemAt indexPath: IndexPath) { + +} + +func collectionView(_ collectionView: UICollectionView, + didDeselectItemAt indexPath: IndexPath) { + +} \ No newline at end of file diff --git a/snippets/swift-ts-mode/uitableviewdatasource b/snippets/swift-ts-mode/uitableviewdatasource new file mode 100644 index 000000000..f386e10fa --- /dev/null +++ b/snippets/swift-ts-mode/uitableviewdatasource @@ -0,0 +1,26 @@ +# -*- mode: snippet -*- +# name: uitableViewDataSource +# key: uitableViewDataSource +# -- +// MARK: UITableViewDataSource + +func numberOfSections(in tableView: UITableView) -> Int { + return $1 +} + +func tableView(_ tableView: UITableView, + numberOfRowsInSection section: Int) -> Int { + return $2 +} + +func tableView(_ tableView: UITableView, + cellForRowAt indexPath: IndexPath) -> UITableViewCell { + let cell = tableView.dequeueReusableCell(withIdentifier: $3, + for: indexPath) + configureCell(cell: cell, forRowAt: indexPath) + return cell +} + +func configureCell(cell: UITableViewCell, forRowAt indexPath: IndexPath) { + +} \ No newline at end of file diff --git a/snippets/swift-ts-mode/uitableviewdelegate b/snippets/swift-ts-mode/uitableviewdelegate new file mode 100644 index 000000000..d013f3f28 --- /dev/null +++ b/snippets/swift-ts-mode/uitableviewdelegate @@ -0,0 +1,34 @@ +# -*- mode: snippet -*- +# name: uiTableViewDelegate +# key: uitableViewDelegate +# -- +// MARK: UITableViewDelegate + +func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { + +} + +func tableView(_ tableView: UITableView, + heightForRowAt indexPath: IndexPath) -> CGFloat { + +} + +func tableView(_ tableView: UITableView, + heightForHeaderInSection section: Int) -> CGFloat { + +} + +func tableView(_ tableView: UITableView, + heightForFooterInSection section: Int) -> CGFloat { + +} + +func tableView(_ tableView: UITableView, + viewForHeaderInSection section: Int) -> UIView? { + +} + +func tableView(_ tableView: UITableView, + viewForFooterInSection section: Int) -> UIView? { + +} \ No newline at end of file diff --git a/snippets/swift-ts-mode/uiviewcontrollerlifecycle b/snippets/swift-ts-mode/uiviewcontrollerlifecycle new file mode 100644 index 000000000..44e95d73c --- /dev/null +++ b/snippets/swift-ts-mode/uiviewcontrollerlifecycle @@ -0,0 +1,25 @@ +# -*- mode: snippet -*- +# name: uiViewControllerLifecycle +# key: uiViewControllerLifecycle +# -- +// MARK: UIViewController lifecycle + +override func viewDidLoad() { + super.viewDidLoad() +} + +override func viewWillAppear(_ animated: Bool) { + super.viewWillAppear(animated) +} + +override func viewDidAppear(_ animated: Bool) { + super.viewDidAppear(animated) +} + +override func viewWillDisappear(_ animated: Bool) { + super.viewWillDisappear(animated) +} + +override func viewDidDisappear(_ animated: Bool) { + super.viewDidDisappear(animated) +} \ No newline at end of file diff --git a/snippets/swift-ts-mode/var b/snippets/swift-ts-mode/var new file mode 100644 index 000000000..55e19b6f6 --- /dev/null +++ b/snippets/swift-ts-mode/var @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: var +# key: var +# -- +var $1: $2 = $0 \ No newline at end of file diff --git a/snippets/swift-ts-mode/while b/snippets/swift-ts-mode/while new file mode 100644 index 000000000..30518b1c0 --- /dev/null +++ b/snippets/swift-ts-mode/while @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: while +# key: while +# -- +while $1 { + $0 +} \ No newline at end of file