diff options
author | Alberto Luaces <aluaces@udc.es> | 2016-12-01 14:02:56 +0100 |
---|---|---|
committer | Alberto Luaces <aluaces@udc.es> | 2016-12-01 14:02:56 +0100 |
commit | 83355faf3e530fb36fcb32750ebedda19e1927ef (patch) | |
tree | ff9f7eb3cfb4842c41173e67b3a6614332343b24 | |
parent | 632df2ede2712994b12ee499abfc948e6dc3f9ae (diff) | |
parent | 12b385f3badb51bd3689a1a0986cc9410ea416c5 (diff) |
Merge latest upstream.
532 files changed, 2115 insertions, 874 deletions
@@ -5,24 +5,24 @@ This repository contains the official snippets for [yasnippet](http://github.com # How to install -There are two options, if you have checked out *yasnippet* already, the only thing you need to do is to run *git submodule update --init* +There are two options, if you have checked out *yasnippet* already, the only thing you need to do is to run `git submodule update --init` and it will checkout automatically this repository, at the last version it was synchronized too. Otherwise if you want the latest and greatest snippets collection proceed as follows: 1. clone this repository 2. add to your .emacs the following - - (add-to-list 'yas/root-directory "$DIRECTORY_WHERE_YOU_CLONED") - - (yas/initialize) + - `(add-to-list 'yas-snippet-dirs "$$DIRECTORY_WHERE_YOU_CLONED")` + - and in case you want to enable yasnippet globally: `(yas-global-mode t)` -3. M-x yas/reload-all to activate them +3. `M-x yas-reload-all` to activate them # Contributing This repository has now become the default snippets repository (as a submodule) in yasnippet. So if you have any useful snippets for any language or framework please feel free to contribute. -To study the current snippets I suggest to use M-x yas/describe-tables +To study the current snippets I suggest to use `M-x yas-describe-tables` which will gave a table representation of all the snippets available in the current mode. diff --git a/c++-mode/.yas-setup.el b/c++-mode/.yas-setup.el new file mode 100644 index 0000000..59c0295 --- /dev/null +++ b/c++-mode/.yas-setup.el @@ -0,0 +1,12 @@ +(require 'yasnippet) + +(defun yas-c++-class-name (str) + "Search for a class name like `DerivedClass' in STR +(which may look like `DerivedClass : ParentClass1, ParentClass2, ...') + +If found, the class name is returned, otherwise STR is returned" + (yas-substr str "[^: ]*")) + +(defun yas-c++-class-method-declare-choice () + "Choose and return the end of a C++11 class method declaration" + (yas-choose-value '(";" " = default;" " = delete;"))) diff --git a/c++-mode/acl b/c++-mode/acl new file mode 100644 index 0000000..9d5d042 --- /dev/null +++ b/c++-mode/acl @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: accumulate +# key: acl +# -- +auto sum = std::accumulate(std::begin(${1:container}), std::end($1), 0, [](int total, $2) { + $3 +}); +$0 diff --git a/c++-mode/acm b/c++-mode/acm new file mode 100644 index 0000000..6e885bc --- /dev/null +++ b/c++-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/c++-mode/ajf b/c++-mode/ajf new file mode 100644 index 0000000..105419e --- /dev/null +++ b/c++-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/c++-mode/alo b/c++-mode/alo new file mode 100644 index 0000000..f16ad54 --- /dev/null +++ b/c++-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/c++-mode/ano b/c++-mode/ano new file mode 100644 index 0000000..36e017f --- /dev/null +++ b/c++-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/c++-mode/class11 b/c++-mode/class11 new file mode 100644 index 0000000..8151299 --- /dev/null +++ b/c++-mode/class11 @@ -0,0 +1,44 @@ +# -*- mode: snippet -*- +# name: class11 +# key: cls11 +# group: c++11 +# uuid: d7c41f87-9b8a-479d-bb12-89f4cbdd46a7 +# contributor: Ved Vyas +# desc: 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/c++-mode/cni b/c++-mode/cni new file mode 100644 index 0000000..e8694d2 --- /dev/null +++ b/c++-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/c++-mode/cnt b/c++-mode/cnt new file mode 100644 index 0000000..0004798 --- /dev/null +++ b/c++-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/c++-mode/cout b/c++-mode/cout index a1a151b..6975775 100644 --- a/c++-mode/cout +++ b/c++-mode/cout @@ -5,4 +5,4 @@ # -- `(progn (save-excursion) (goto-char (point-min)) (unless (re-search-forward "^using\\s-+namespace std;" nil 'no-errer) "std::")) -`cout << $0${1: << '${2:\n}'};
\ No newline at end of file +`cout << $0${1: << "${2:\n}"};
\ No newline at end of file diff --git a/c++-mode/cpb b/c++-mode/cpb new file mode 100644 index 0000000..0ca826c --- /dev/null +++ b/c++-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/c++-mode/cpi b/c++-mode/cpi new file mode 100644 index 0000000..4c17712 --- /dev/null +++ b/c++-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/c++-mode/cpn b/c++-mode/cpn new file mode 100644 index 0000000..a96996e --- /dev/null +++ b/c++-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/c++-mode/cpy b/c++-mode/cpy new file mode 100644 index 0000000..14b36b6 --- /dev/null +++ b/c++-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/c++-mode/eql b/c++-mode/eql new file mode 100644 index 0000000..01368cc --- /dev/null +++ b/c++-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/c++-mode/erm b/c++-mode/erm new file mode 100644 index 0000000..16b8f36 --- /dev/null +++ b/c++-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/c++-mode/ffo b/c++-mode/ffo new file mode 100644 index 0000000..36c6894 --- /dev/null +++ b/c++-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/c++-mode/fil b/c++-mode/fil new file mode 100644 index 0000000..12d065a --- /dev/null +++ b/c++-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/c++-mode/fin b/c++-mode/fin new file mode 100644 index 0000000..41eaf6c --- /dev/null +++ b/c++-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/c++-mode/fln b/c++-mode/fln new file mode 100644 index 0000000..ef2028a --- /dev/null +++ b/c++-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/c++-mode/fnd b/c++-mode/fnd new file mode 100644 index 0000000..6009138 --- /dev/null +++ b/c++-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/c++-mode/fne b/c++-mode/fne new file mode 100644 index 0000000..7f27e7a --- /dev/null +++ b/c++-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/c++-mode/fni b/c++-mode/fni new file mode 100644 index 0000000..de0a6e8 --- /dev/null +++ b/c++-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/c++-mode/fre b/c++-mode/fre new file mode 100644 index 0000000..09d1a78 --- /dev/null +++ b/c++-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/c++-mode/gnn b/c++-mode/gnn new file mode 100644 index 0000000..b3b74b5 --- /dev/null +++ b/c++-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/c++-mode/gnr b/c++-mode/gnr new file mode 100644 index 0000000..e48e7c1 --- /dev/null +++ b/c++-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/c++-mode/ihp b/c++-mode/ihp new file mode 100644 index 0000000..bf975b9 --- /dev/null +++ b/c++-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/c++-mode/ihu b/c++-mode/ihu new file mode 100644 index 0000000..765508e --- /dev/null +++ b/c++-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/c++-mode/ipr b/c++-mode/ipr new file mode 100644 index 0000000..c7ffd71 --- /dev/null +++ b/c++-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/c++-mode/ipt b/c++-mode/ipt new file mode 100644 index 0000000..b7a1509 --- /dev/null +++ b/c++-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/c++-mode/iss b/c++-mode/iss new file mode 100644 index 0000000..11c4cf0 --- /dev/null +++ b/c++-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/c++-mode/isu b/c++-mode/isu new file mode 100644 index 0000000..0c443ff --- /dev/null +++ b/c++-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/c++-mode/ita b/c++-mode/ita new file mode 100644 index 0000000..45da1bc --- /dev/null +++ b/c++-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/c++-mode/ltr b/c++-mode/ltr new file mode 100644 index 0000000..1aec200 --- /dev/null +++ b/c++-mode/ltr @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: transform +# key: ltr +# -- +${1:container}.erase(0, $1.find_first_not_of(" \t\n\r")); +$0 diff --git a/c++-mode/lwr b/c++-mode/lwr new file mode 100644 index 0000000..4736a05 --- /dev/null +++ b/c++-mode/lwr @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: transform +# key: lwr +# -- +std::transform(std::begin(${1:container}), std::end($1), std::begin($1), [](char c) { +return std::tolower(c);}); +$0 diff --git a/c++-mode/lxc b/c++-mode/lxc new file mode 100644 index 0000000..d60c1e5 --- /dev/null +++ b/c++-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/c++-mode/function b/c++-mode/member_function index c947c34..8b5ee6a 100644 --- a/c++-mode/function +++ b/c++-mode/member_function @@ -1,8 +1,8 @@ # -*- mode: snippet -*- -# name: function -# key: f +# name: member_function +# key: mf # -- ${1:type} ${2:Class}::${3:name}(${4:args})${5: const} { $0 -}
\ No newline at end of file +} diff --git a/c++-mode/mkh b/c++-mode/mkh new file mode 100644 index 0000000..9d50614 --- /dev/null +++ b/c++-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/c++-mode/mme b/c++-mode/mme new file mode 100644 index 0000000..e40fa07 --- /dev/null +++ b/c++-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/c++-mode/mne b/c++-mode/mne new file mode 100644 index 0000000..0491705 --- /dev/null +++ b/c++-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/c++-mode/mpb b/c++-mode/mpb new file mode 100644 index 0000000..4ca0b09 --- /dev/null +++ b/c++-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/c++-mode/mrg b/c++-mode/mrg new file mode 100644 index 0000000..d6bbc71 --- /dev/null +++ b/c++-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/c++-mode/msm b/c++-mode/msm new file mode 100644 index 0000000..6c729f6 --- /dev/null +++ b/c++-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/c++-mode/mxe b/c++-mode/mxe new file mode 100644 index 0000000..a2ffea4 --- /dev/null +++ b/c++-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/c++-mode/nno b/c++-mode/nno new file mode 100644 index 0000000..4372782 --- /dev/null +++ b/c++-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/c++-mode/nth b/c++-mode/nth new file mode 100644 index 0000000..e0c0fba --- /dev/null +++ b/c++-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/c++-mode/nxp b/c++-mode/nxp new file mode 100644 index 0000000..46ece1e --- /dev/null +++ b/c++-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/c++-mode/oit b/c++-mode/oit new file mode 100644 index 0000000..74ad7e5 --- /dev/null +++ b/c++-mode/oit @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: copy +# key: oit +# -- +std::copy(std::begin(${1:container}), std::end($1), std::ostream_iterator<$2>{ +%\istd::cout, "$3" +}); +$0 diff --git a/c++-mode/phh b/c++-mode/phh new file mode 100644 index 0000000..4527265 --- /dev/null +++ b/c++-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/c++-mode/ppt b/c++-mode/ppt new file mode 100644 index 0000000..fc05481 --- /dev/null +++ b/c++-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/c++-mode/prp b/c++-mode/prp new file mode 100644 index 0000000..a94f0e9 --- /dev/null +++ b/c++-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/c++-mode/psc b/c++-mode/psc new file mode 100644 index 0000000..ad8ff42 --- /dev/null +++ b/c++-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/c++-mode/pst b/c++-mode/pst new file mode 100644 index 0000000..e7287e2 --- /dev/null +++ b/c++-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/c++-mode/ptc b/c++-mode/ptc new file mode 100644 index 0000000..dcd7e38 --- /dev/null +++ b/c++-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/c++-mode/ptn b/c++-mode/ptn new file mode 100644 index 0000000..44f3c42 --- /dev/null +++ b/c++-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/c++-mode/rci b/c++-mode/rci new file mode 100644 index 0000000..1149255 --- /dev/null +++ b/c++-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/c++-mode/rmc b/c++-mode/rmc new file mode 100644 index 0000000..681c10b --- /dev/null +++ b/c++-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/c++-mode/rmf b/c++-mode/rmf new file mode 100644 index 0000000..c1713ff --- /dev/null +++ b/c++-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/c++-mode/rmi b/c++-mode/rmi new file mode 100644 index 0000000..c78f926 --- /dev/null +++ b/c++-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/c++-mode/rmv b/c++-mode/rmv new file mode 100644 index 0000000..01fa9f9 --- /dev/null +++ b/c++-mode/rmv @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# name: remove +# key: rmv +# -- +auto pos = std::remove(std::begin(${1:container}), std::end($1), $2); +if (pos != std::end($1)) { + $3 +} +$0 diff --git a/c++-mode/rpc b/c++-mode/rpc new file mode 100644 index 0000000..a4116f1 --- /dev/null +++ b/c++-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/c++-mode/rpi b/c++-mode/rpi new file mode 100644 index 0000000..bc96c47 --- /dev/null +++ b/c++-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/c++-mode/rpl b/c++-mode/rpl new file mode 100644 index 0000000..9badf4b --- /dev/null +++ b/c++-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/c++-mode/rtc b/c++-mode/rtc new file mode 100644 index 0000000..373f85d --- /dev/null +++ b/c++-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/c++-mode/rte b/c++-mode/rte new file mode 100644 index 0000000..a098782 --- /dev/null +++ b/c++-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/c++-mode/rvc b/c++-mode/rvc new file mode 100644 index 0000000..2e4618d --- /dev/null +++ b/c++-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/c++-mode/rvr b/c++-mode/rvr new file mode 100644 index 0000000..71d00c5 --- /dev/null +++ b/c++-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/c++-mode/shf b/c++-mode/shf new file mode 100644 index 0000000..ef7adb1 --- /dev/null +++ b/c++-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/c++-mode/spt b/c++-mode/spt new file mode 100644 index 0000000..40ef2c8 --- /dev/null +++ b/c++-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/c++-mode/srh b/c++-mode/srh new file mode 100644 index 0000000..2c9df59 --- /dev/null +++ b/c++-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/c++-mode/srn b/c++-mode/srn new file mode 100644 index 0000000..c7d929d --- /dev/null +++ b/c++-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/c++-mode/srt b/c++-mode/srt new file mode 100644 index 0000000..8d44cfd --- /dev/null +++ b/c++-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/c++-mode/sth b/c++-mode/sth new file mode 100644 index 0000000..c8e6fb1 --- /dev/null +++ b/c++-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/c++-mode/sti b/c++-mode/sti new file mode 100644 index 0000000..37a2182 --- /dev/null +++ b/c++-mode/sti @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: cin +# key: sti +# -- +std::cin >> +$0 diff --git a/c++-mode/sto b/c++-mode/sto new file mode 100644 index 0000000..30db50b --- /dev/null +++ b/c++-mode/sto @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: cout +# key: sto +# -- +std::cout << +$0 diff --git a/c++-mode/sts b/c++-mode/sts new file mode 100644 index 0000000..a5c4d12 --- /dev/null +++ b/c++-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/c++-mode/stv b/c++-mode/stv new file mode 100644 index 0000000..1354c3d --- /dev/null +++ b/c++-mode/stv @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: vector +# key: stv +# -- +std::vector<$2> $3 +$0 diff --git a/c++-mode/swr b/c++-mode/swr new file mode 100644 index 0000000..9357578 --- /dev/null +++ b/c++-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/c++-mode/tfm b/c++-mode/tfm new file mode 100644 index 0000000..12d4881 --- /dev/null +++ b/c++-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/c++-mode/trm b/c++-mode/trm new file mode 100644 index 0000000..d7ffea1 --- /dev/null +++ b/c++-mode/trm @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: generate_n +# key: trm +# -- +${1:container}.erase($1.find_last_not_of(" \t\n\r") + 1); +$0 diff --git a/c++-mode/ucp b/c++-mode/ucp new file mode 100644 index 0000000..1dc71ff --- /dev/null +++ b/c++-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<string>(std::cout, "\n")); +$0 diff --git a/c++-mode/upr b/c++-mode/upr new file mode 100644 index 0000000..8c9e0f8 --- /dev/null +++ b/c++-mode/upr @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# name: transform +# key: upr +# -- +std::transform(std::begin(${1:container}), std::end($1), std::begin($1), [](char c) { +return std::toupper(c); +}); +$2 +$0 diff --git a/c++-mode/uqe b/c++-mode/uqe new file mode 100644 index 0000000..c35ff16 --- /dev/null +++ b/c++-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/c-mode/fopen b/c-mode/fopen deleted file mode 100644 index 0e48c21..0000000 --- a/c-mode/fopen +++ /dev/null @@ -1,4 +0,0 @@ -#name : FILE *fp = fopen(..., ...); -# key: fopen -# -- -FILE *${fp} = fopen(${"file"}, "${r}");
\ No newline at end of file diff --git a/cc-mode/file_description b/cc-mode/file_description new file mode 100644 index 0000000..5b3a1ee --- /dev/null +++ b/cc-mode/file_description @@ -0,0 +1,13 @@ +# -*- mode: snippet -*- +#cotributor: Henrique Jung <henriquenj@gmail.com> +#name: File description +#key: \file +#group: doxygen +# -- +/** + * \file ${1:`(file-name-nondirectory(buffer-file-name))`} + * \brief ${2:A Documented file.} + ${3:* + * ${4:Detailed description} + * +}*/ diff --git a/cc-mode/for b/cc-mode/for index e445f4d..dd29130 100644 --- a/cc-mode/for +++ b/cc-mode/for @@ -4,4 +4,4 @@ # -- for (${1:i = 0}; ${2:i < N}; ${3:i++}) { $0 -} +}
\ No newline at end of file diff --git a/cc-mode/function_description b/cc-mode/function_description new file mode 100644 index 0000000..1ff27ff --- /dev/null +++ b/cc-mode/function_description @@ -0,0 +1,14 @@ +# -*- mode: snippet -*- +#cotributor: Henrique Jung <henriquenj@gmail.com> +#name: Function description +#key: \brief +#group: doxygen +# -- +/** + * \brief ${1:function description} + ${2:* + * ${3:Detailed description} + * + }* \param ${4:param} + * \return ${5:return type} + */
\ No newline at end of file diff --git a/cc-mode/inc b/cc-mode/inc index 96beaa7..7760491 100644 --- a/cc-mode/inc +++ b/cc-mode/inc @@ -1,5 +1,5 @@ # -*- mode: snippet -*- # name : #include <...> -# key : inc +# key : incs # -- #include <$1>
\ No newline at end of file diff --git a/cc-mode/inc.1 b/cc-mode/inc.1 index 64a8653..95567f2 100644 --- a/cc-mode/inc.1 +++ b/cc-mode/inc.1 @@ -1,5 +1,5 @@ # -*- mode: snippet -*- # name : #include "..." -# key : inc +# key : incl # -- #include "$1"
\ No newline at end of file diff --git a/cc-mode/member_description b/cc-mode/member_description new file mode 100644 index 0000000..54f3406 --- /dev/null +++ b/cc-mode/member_description @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +#cotributor: Henrique Jung <henriquenj@gmail.com> +#name: Member description +#key: !< +#group: doxygen +# -- +/*!< ${1:Detailed description after the member} */
\ No newline at end of file diff --git a/cider-repl-mode b/cider-repl-mode deleted file mode 120000 index ad14abb..0000000 --- a/cider-repl-mode +++ /dev/null @@ -1 +0,0 @@ -clojure-mode
\ No newline at end of file diff --git a/cider-repl-mode/.yas-parents b/cider-repl-mode/.yas-parents new file mode 100644 index 0000000..b91f032 --- /dev/null +++ b/cider-repl-mode/.yas-parents @@ -0,0 +1 @@ +clojure-mode diff --git a/cmake-mode/foreach b/cmake-mode/foreach index 69aaffb..c512312 100644 --- a/cmake-mode/foreach +++ b/cmake-mode/foreach @@ -2,6 +2,6 @@ # name: foreach # key: for # -- -foreach(${1:item} \${${2:array}}) - $0 -endforeach()
\ No newline at end of file +foreach(${1:var} \${${2:array}}) + $3 +endforeach($1)$0
\ No newline at end of file diff --git a/cmake-mode/function b/cmake-mode/function index f051a70..d330315 100644 --- a/cmake-mode/function +++ b/cmake-mode/function @@ -2,6 +2,6 @@ # name: function # key: fun # -- -function (${1:name}) - $0 -endfunction()
\ No newline at end of file +function(${1:name}) + $2 +endfunction($1)$0
\ No newline at end of file diff --git a/cmake-mode/if b/cmake-mode/if index e9f3658..9f96b97 100644 --- a/cmake-mode/if +++ b/cmake-mode/if @@ -3,5 +3,5 @@ # key: if # -- if(${1:cond}) - $0 -endif()
\ No newline at end of file + $2 +endif($1)$0
\ No newline at end of file diff --git a/cmake-mode/ifelse b/cmake-mode/ifelse index 45557ba..984896f 100644 --- a/cmake-mode/ifelse +++ b/cmake-mode/ifelse @@ -6,4 +6,4 @@ if(${1:cond}) $2 else(${3:cond}) $0 -endif()
\ No newline at end of file +endif($1)$0
\ No newline at end of file diff --git a/cmake-mode/include b/cmake-mode/include index e17dfa0..caf4742 100644 --- a/cmake-mode/include +++ b/cmake-mode/include @@ -1,5 +1,5 @@ -# type: command -# key: inc +# -*- mode: snippet -*- # name: include +# key: inc # -- -include ($0) +include($0) diff --git a/cmake-mode/macro b/cmake-mode/macro index 27d691f..09652a5 100644 --- a/cmake-mode/macro +++ b/cmake-mode/macro @@ -3,5 +3,5 @@ # key: macro # -- macro(${1:name}${2: args}) - -endmacro()
\ No newline at end of file + $2 +endmacro($1)$0
\ No newline at end of file diff --git a/cmake-mode/option b/cmake-mode/option index c71f7f2..b8b51e4 100644 --- a/cmake-mode/option +++ b/cmake-mode/option @@ -2,4 +2,4 @@ # name: option # key: opt # -- -option (${1:OPT} "${2:docstring}" ${3:value})
\ No newline at end of file +option(${1:OPT} "${2:docstring}" ${3:value})
\ No newline at end of file diff --git a/cmake-mode/project b/cmake-mode/project index ed8d1a2..67b0138 100644 --- a/cmake-mode/project +++ b/cmake-mode/project @@ -2,4 +2,4 @@ # name: project # key: proj # -- -project ($0)
\ No newline at end of file +project($0)
\ No newline at end of file diff --git a/csharp-mode/fore b/csharp-mode/fore new file mode 100644 index 0000000..d45c0d0 --- /dev/null +++ b/csharp-mode/fore @@ -0,0 +1,8 @@ +#contributor : Jostein Kjønigsen <jostein@kjonigsen.net> +#name : foreach { ... } +# key: fore +# -- +foreach (${1:var} ${2:item} in ${3:list}) +{ + $0 +}
\ No newline at end of file diff --git a/dix-mode/e-in-mono-section b/dix-mode/e-in-mono-section new file mode 100644 index 0000000..9d14896 --- /dev/null +++ b/dix-mode/e-in-mono-section @@ -0,0 +1,9 @@ +# -*- mode: snippet; require-final-newline: nil -*- +# name: <e> in monodix section +# key: <e +# condition: (dix-enclosing-is-mono-section) +# binding: direct-keybinding +#TODO: remove suffix from <i> after leaving <par> +# -- +<e lm="${1:`(dix-yas-prev-lemma)`}"> <i>${1:$(dix-yas-lm-to-i)}</i> <par n="${3:$$(dix-yas-choose-pdname)}"/></e> +$0
\ No newline at end of file diff --git a/dix-mode/e-in-pardef b/dix-mode/e-in-pardef new file mode 100644 index 0000000..01292b1 --- /dev/null +++ b/dix-mode/e-in-pardef @@ -0,0 +1,7 @@ +# -*- mode: snippet; require-final-newline: nil -*- +# name: <e> in pardefs +# key: <e +# condition: (not (dix-enclosing-is-mono-section)) +# binding: direct-keybinding +# -- +<e> <p><l>$1</l> <r>$1$0</r></p> </e> diff --git a/dix-mode/p b/dix-mode/p new file mode 100644 index 0000000..11d177b --- /dev/null +++ b/dix-mode/p @@ -0,0 +1,7 @@ +# -*- mode: snippet; require-final-newline: nil -*- +# name: <p> element +# key: <p +# condition: (progn (backward-char 2) (equal (dix-enclosing-elt 'noerror) "e")) +# binding: direct-keybinding +# -- +<p><l>$1</l> <r>$1$0</r></p>
\ No newline at end of file diff --git a/dix-mode/par b/dix-mode/par new file mode 100644 index 0000000..99a2bf4 --- /dev/null +++ b/dix-mode/par @@ -0,0 +1,7 @@ +# -*- mode: snippet; require-final-newline: nil -*- +# name: <par> element +# key: <p +# condition: (progn (backward-char 2) (equal (dix-enclosing-elt 'noerror) "e")) +# binding: direct-keybinding +# -- +<par n="${1::$$(dix-yas-message-pardef (yas-choose-value (dix-pardef-suggest-for (dix-lemma-at-point))))`}"/>$0
\ No newline at end of file diff --git a/dix-mode/pardef b/dix-mode/pardef new file mode 100644 index 0000000..b048656 --- /dev/null +++ b/dix-mode/pardef @@ -0,0 +1,12 @@ +# -*- mode: snippet; require-final-newline: nil -*- +# name: <pardef> element +# key: <p +# condition: (progn (backward-char 2) (not (equal (dix-enclosing-elt 'noerror) "e"))) +# binding: direct-keybinding +# -- +<pardef n="${1:corp/us__n}"> + <e> <p><l>${1:$(dix-yas-pdname-to-suffix yas-text)}</l> <r>${1:$(dix-yas-pdname-to-suffix yas-text)}${1:$(dix-yas-pdname-to-pos yas-text)}$2</r></p></e> + <e> <p><l>${1:$(dix-yas-pdname-to-suffix yas-text)}$0</l> <r>${1:$(dix-yas-pdname-to-suffix yas-text)}${1:$(dix-yas-pdname-to-pos yas-text)}$2</r></p></e> + <e> <p><l>${1:$(dix-yas-pdname-to-suffix yas-text)}</l> <r>${1:$(dix-yas-pdname-to-suffix yas-text)}${1:$(dix-yas-pdname-to-pos yas-text)}$2</r></p></e> + <e> <p><l>${1:$(dix-yas-pdname-to-suffix yas-text)}</l> <r>${1:$(dix-yas-pdname-to-suffix yas-text)}${1:$(dix-yas-pdname-to-pos yas-text)}$2</r></p></e> +</pardef>
\ No newline at end of file diff --git a/dix-mode/s b/dix-mode/s new file mode 100644 index 0000000..6e854eb --- /dev/null +++ b/dix-mode/s @@ -0,0 +1,9 @@ +# -*- mode: snippet; require-final-newline: nil -*- +# name: <s> element +# key: <s +# binding: direct-keybinding +# condition: (progn (backward-char 2) (member (dix-enclosing-elt 'noerror) '("l" "r" "i" "g"))) +#Note: requires (eval-after-load 'yasnippet '(add-to-list 'yas-key-syntaxes 'dix-yas-skip-backwards-to-key)) +#so that you can expand it after regular letter chars +# -- +<s n="$1"/>$0
\ No newline at end of file diff --git a/dix-mode/sdef b/dix-mode/sdef new file mode 100644 index 0000000..fa4447d --- /dev/null +++ b/dix-mode/sdef @@ -0,0 +1,7 @@ +# -*- mode: snippet; require-final-newline: nil -*- +# name: <sdef> element +# key: <s +# condition: (progn (backward-char 2) (equal (dix-enclosing-elt 'noerror) "sdefs")) +# binding: direct-keybinding +# -- +<sdef n="$1" c="$2"/> diff --git a/dix-mode/section b/dix-mode/section new file mode 100644 index 0000000..e2893b9 --- /dev/null +++ b/dix-mode/section @@ -0,0 +1,9 @@ +# -*- mode: snippet; require-final-newline: nil -*- +# name: <section> element +# key: <s +# condition: (progn (backward-char 2) (and (not (dix-enclosing-is-mono-section)) (not (member (dix-enclosing-elt 'noerror) '("l" "r" "i" "g" "sdefs"))))) +# binding: direct-keybinding +# -- +<section id="${1:main}" type="${2:$$(yas-choose-value '("standard" "inconditional" "postblank" "preblank"))}"> +$0 +</section> diff --git a/elixir-mode/call b/elixir-mode/call new file mode 100644 index 0000000..27779ab --- /dev/null +++ b/elixir-mode/call @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: call +# key: call +# -- +GenServer.call(${1:__MODULE__}, $0) diff --git a/elixir-mode/cast b/elixir-mode/cast new file mode 100644 index 0000000..d06f3b7 --- /dev/null +++ b/elixir-mode/cast @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: cast +# key: cast +# -- +GenServer.cast(${1:__MODULE__}, $0) diff --git a/elixir-mode/def b/elixir-mode/def index e680262..171c165 100644 --- a/elixir-mode/def +++ b/elixir-mode/def @@ -2,6 +2,6 @@ # name: def # key: def # -- -def ${1:method}${2:(${3:args})} do +def ${1:function}${2:(${3:args})} do $0 end diff --git a/elixir-mode/defmacro b/elixir-mode/defmacro index 63ab988..6412f6c 100644 --- a/elixir-mode/defmacro +++ b/elixir-mode/defmacro @@ -3,5 +3,5 @@ # key: defmacro # -- defmacro $1 do - $0 + $0 end diff --git a/elixir-mode/defmacrop b/elixir-mode/defmacrop index 3f4cf98..d1bbde6 100644 --- a/elixir-mode/defmacrop +++ b/elixir-mode/defmacrop @@ -3,5 +3,5 @@ # key: defmacrop # -- defmacrop $1 do - $0 + $0 end diff --git a/elixir-mode/defmodule b/elixir-mode/defmodule index 4e33ab0..83568ea 100644 --- a/elixir-mode/defmodule +++ b/elixir-mode/defmodule @@ -3,5 +3,5 @@ # key: defmodule # -- defmodule $1 do - $0 + $0 end diff --git a/elixir-mode/defp b/elixir-mode/defp index 0fd90e9..d2236d2 100644 --- a/elixir-mode/defp +++ b/elixir-mode/defp @@ -3,5 +3,5 @@ # key: defp # -- defp $1 do - $0 + $0 end diff --git a/elixir-mode/do b/elixir-mode/do new file mode 100644 index 0000000..807dc99 --- /dev/null +++ b/elixir-mode/do @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: do +# key: do +# -- +do + $0 +end diff --git a/elixir-mode/fn b/elixir-mode/fn new file mode 100644 index 0000000..0bdf073 --- /dev/null +++ b/elixir-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/elixir-mode/for b/elixir-mode/for new file mode 100644 index 0000000..42b0c0f --- /dev/null +++ b/elixir-mode/for @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: for +# key: for +# -- +for ${2:x} <- ${1:enum} do + $2$0 +end diff --git a/elixir-mode/hcall b/elixir-mode/hcall new file mode 100644 index 0000000..d878b74 --- /dev/null +++ b/elixir-mode/hcall @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: hcall +# key: hcall +# -- +def handle_call($1, _from, state) do + reply = $0 + {:reply, reply, state} +end diff --git a/elixir-mode/hcast b/elixir-mode/hcast new file mode 100644 index 0000000..a217806 --- /dev/null +++ b/elixir-mode/hcast @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: hcast +# key: hcast +# -- +def handle_cast($1, state) do + $0 + {:noreply, state} +end diff --git a/elixir-mode/hinfo b/elixir-mode/hinfo new file mode 100644 index 0000000..f4539ac --- /dev/null +++ b/elixir-mode/hinfo @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: hinfo +# key: hinfo +# -- +def handle_info($1, state) do + $0 + {:noreply, state} +end diff --git a/elixir-mode/if b/elixir-mode/if new file mode 100644 index 0000000..664d903 --- /dev/null +++ b/elixir-mode/if @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: if +# key: if +# -- +if ${1:condition} do + $0 +end diff --git a/elixir-mode/ife b/elixir-mode/ife new file mode 100644 index 0000000..9bc95a5 --- /dev/null +++ b/elixir-mode/ife @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# name: if-else +# key: ife +# -- +if ${1:condition} do + $2 +else + $3 +end diff --git a/elixir-mode/io b/elixir-mode/io new file mode 100644 index 0000000..dd916b4 --- /dev/null +++ b/elixir-mode/io @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: io +# key: io +# -- +IO.puts("$1")$0 diff --git a/elixir-mode/iop b/elixir-mode/iop new file mode 100644 index 0000000..a9ce985 --- /dev/null +++ b/elixir-mode/iop @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: iop +# key: iop +# -- +IO.puts("$1 #{inspect $1}")$0 diff --git a/elixir-mode/pry b/elixir-mode/pry new file mode 100644 index 0000000..5704c72 --- /dev/null +++ b/elixir-mode/pry @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: pry +# key: pry +# group: debug +# -- +require IEx; IEx.pry diff --git a/elixir-mode/test b/elixir-mode/test new file mode 100644 index 0000000..9babbd4 --- /dev/null +++ b/elixir-mode/test @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: test +# key: test +# -- +test "$1" do + $0 +end diff --git a/elixir-mode/unless b/elixir-mode/unless new file mode 100644 index 0000000..3b1a165 --- /dev/null +++ b/elixir-mode/unless @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: unless +# key: unless +# -- +unless ${1:condition} do + $0 +end diff --git a/emacs-lisp-mode/add-hook b/emacs-lisp-mode/add-hook index 77605af..de8d16d 100755..100644 --- a/emacs-lisp-mode/add-hook +++ b/emacs-lisp-mode/add-hook @@ -1,6 +1,7 @@ +# -*- mode: snippet; -*- #contributor: Xah Lee (XahLee.org) #name: add-hook #key: add-hook #key: ah # -- -(add-hook HOOK$0 FUNCTION)
\ No newline at end of file +(add-hook '${1:name}-hook ${2:'${3:function}})$0 diff --git a/emacs-lisp-mode/and b/emacs-lisp-mode/and index 6502b6a..6502b6a 100755..100644 --- a/emacs-lisp-mode/and +++ b/emacs-lisp-mode/and diff --git a/emacs-lisp-mode/append b/emacs-lisp-mode/append index 0b8639d..4d74636 100755..100644 --- a/emacs-lisp-mode/append +++ b/emacs-lisp-mode/append @@ -2,4 +2,4 @@ #name: append #key: append # -- -(append $0 )
\ No newline at end of file +(append $0)
\ No newline at end of file diff --git a/emacs-lisp-mode/apply b/emacs-lisp-mode/apply index 1963f29..2618e56 100755..100644 --- a/emacs-lisp-mode/apply +++ b/emacs-lisp-mode/apply @@ -2,4 +2,4 @@ #name: apply #key: apply # -- -(apply $0 )
\ No newline at end of file +(apply $0)
\ No newline at end of file diff --git a/emacs-lisp-mode/aref b/emacs-lisp-mode/aref index 867ef0a..4900445 100755..100644 --- a/emacs-lisp-mode/aref +++ b/emacs-lisp-mode/aref @@ -2,4 +2,4 @@ #name: aref #key: aref # -- -(aref ARRAY$0 INDEX)
\ No newline at end of file +(aref ${1:array} {2:index})
\ No newline at end of file diff --git a/emacs-lisp-mode/aset b/emacs-lisp-mode/aset index 9402dc9..60db82d 100755..100644 --- a/emacs-lisp-mode/aset +++ b/emacs-lisp-mode/aset @@ -2,4 +2,4 @@ #name: aset #key: aset # -- -(aset ARRAY$0 IDX NEWELT)
\ No newline at end of file +(aset ${1:array} ${2:index} ${3:element})
\ No newline at end of file diff --git a/emacs-lisp-mode/assq b/emacs-lisp-mode/assq index d7c5257..81ed9cc 100755..100644 --- a/emacs-lisp-mode/assq +++ b/emacs-lisp-mode/assq @@ -2,4 +2,4 @@ #name: assq #key: assq # -- -(assq KEY$0 LIST)
\ No newline at end of file +(assq ${1:key} ${2:list})
\ No newline at end of file diff --git a/emacs-lisp-mode/autoload b/emacs-lisp-mode/autoload index c497482..5502d3d 100755..100644 --- a/emacs-lisp-mode/autoload +++ b/emacs-lisp-mode/autoload @@ -2,4 +2,4 @@ #name: autoload #key: autoload # -- -(autoload 'FUNCNAME$0 "FILENAME" &optional "DOCSTRING" INTERACTIVE TYPE)
\ No newline at end of file +(autoload ${1:function} "${2:filename}"${3: "docstring"}${4: interactive}${5: type})
\ No newline at end of file diff --git a/emacs-lisp-mode/backward-char b/emacs-lisp-mode/backward-char index 296cf97..296cf97 100755..100644 --- a/emacs-lisp-mode/backward-char +++ b/emacs-lisp-mode/backward-char diff --git a/emacs-lisp-mode/beginning-of-line b/emacs-lisp-mode/beginning-of-line index 7dfd32c..7dfd32c 100755..100644 --- a/emacs-lisp-mode/beginning-of-line +++ b/emacs-lisp-mode/beginning-of-line diff --git a/emacs-lisp-mode/bounds-of-thing-at-point b/emacs-lisp-mode/bounds-of-thing-at-point index 6d645b6..ada1bc0 100755..100644 --- a/emacs-lisp-mode/bounds-of-thing-at-point +++ b/emacs-lisp-mode/bounds-of-thing-at-point @@ -3,4 +3,4 @@ #key: bounds-of-thing-at-point #key: botap # -- -(bounds-of-thing-at-point '$0) ; symbol, list, sexp, defun, filename, url, email, word, sentence, whitespace, line, page ...
\ No newline at end of file +(bounds-of-thing-at-point $0)
\ No newline at end of file diff --git a/emacs-lisp-mode/buffer-file-name b/emacs-lisp-mode/buffer-file-name index d983182..d983182 100755..100644 --- a/emacs-lisp-mode/buffer-file-name +++ b/emacs-lisp-mode/buffer-file-name diff --git a/emacs-lisp-mode/buffer-modified-p b/emacs-lisp-mode/buffer-modified-p index f3ca3aa..f3ca3aa 100755..100644 --- a/emacs-lisp-mode/buffer-modified-p +++ b/emacs-lisp-mode/buffer-modified-p diff --git a/emacs-lisp-mode/buffer-substring b/emacs-lisp-mode/buffer-substring index 0c08119..767dd5a 100755..100644 --- a/emacs-lisp-mode/buffer-substring +++ b/emacs-lisp-mode/buffer-substring @@ -3,4 +3,4 @@ #key: buffer-substring #key: bs # -- -(buffer-substring START$0 END)
\ No newline at end of file +(buffer-substring ${1:start} ${2:end})
\ No newline at end of file diff --git a/emacs-lisp-mode/buffer-substring-no-properties b/emacs-lisp-mode/buffer-substring-no-properties index adb8270..4c27737 100755..100644 --- a/emacs-lisp-mode/buffer-substring-no-properties +++ b/emacs-lisp-mode/buffer-substring-no-properties @@ -3,4 +3,4 @@ #key: buffer-substring-no-properties #key: bsnp # -- -(buffer-substring-no-properties START$0 END)
\ No newline at end of file +(buffer-substring-no-properties ${1:start} ${2:end})
\ No newline at end of file diff --git a/emacs-lisp-mode/car b/emacs-lisp-mode/car index 09ff8e4..09ff8e4 100755..100644 --- a/emacs-lisp-mode/car +++ b/emacs-lisp-mode/car diff --git a/emacs-lisp-mode/cdr b/emacs-lisp-mode/cdr index 404d1d2..404d1d2 100755..100644 --- a/emacs-lisp-mode/cdr +++ b/emacs-lisp-mode/cdr diff --git a/emacs-lisp-mode/concat b/emacs-lisp-mode/concat index b94cfeb..b94cfeb 100755..100644 --- a/emacs-lisp-mode/concat +++ b/emacs-lisp-mode/concat diff --git a/emacs-lisp-mode/cond b/emacs-lisp-mode/cond index 3927414..6cee429 100755..100644 --- a/emacs-lisp-mode/cond +++ b/emacs-lisp-mode/cond @@ -3,6 +3,4 @@ #key: cond # -- (cond -(CONDITION$0 BODY) -(CONDITION BODY) -)
\ No newline at end of file + (${1:condition} ${2:body})$0)
\ No newline at end of file diff --git a/emacs-lisp-mode/condition-case b/emacs-lisp-mode/condition-case index da794dd..d1249ff 100755..100644 --- a/emacs-lisp-mode/condition-case +++ b/emacs-lisp-mode/condition-case @@ -3,4 +3,4 @@ #key: condition-case #key: cc # -- -(condition-case $0 )
\ No newline at end of file +(condition-case $0)
\ No newline at end of file diff --git a/emacs-lisp-mode/cons b/emacs-lisp-mode/cons index f186919..f186919 100755..100644 --- a/emacs-lisp-mode/cons +++ b/emacs-lisp-mode/cons diff --git a/emacs-lisp-mode/consp b/emacs-lisp-mode/consp index 2b2ce5c..55e9f77 100755..100644 --- a/emacs-lisp-mode/consp +++ b/emacs-lisp-mode/consp @@ -2,4 +2,4 @@ #name: consp #key: consp # -- -(consp $0 )
\ No newline at end of file +(consp $0)
\ No newline at end of file diff --git a/emacs-lisp-mode/const b/emacs-lisp-mode/const new file mode 100644 index 0000000..fb13fcc --- /dev/null +++ b/emacs-lisp-mode/const @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: defconst +# key: const +# -- +(defconst ${1:name} ${2:value}${3: "${4:docstring}"})$0
\ No newline at end of file diff --git a/emacs-lisp-mode/copy-directory b/emacs-lisp-mode/copy-directory index b2516d5..0b08d80 100755..100644 --- a/emacs-lisp-mode/copy-directory +++ b/emacs-lisp-mode/copy-directory @@ -3,4 +3,4 @@ #key: copy-directory #key: cd # -- -(copy-directory $0 NEWNAME &optional KEEP-TIME PARENTS)
\ No newline at end of file +(copy-directory ${1:directory} {2:target}${3: keep-time}${4: parents})
\ No newline at end of file diff --git a/emacs-lisp-mode/copy-file b/emacs-lisp-mode/copy-file index b952b16..b093970 100755..100644 --- a/emacs-lisp-mode/copy-file +++ b/emacs-lisp-mode/copy-file @@ -3,4 +3,4 @@ #key: copy-file #key: cf # -- -(copy-file FILE$0 NEWNAME &optional OK-IF-ALREADY-EXISTS KEEP-TIME PRESERVE-UID-GID)
\ No newline at end of file +(copy-file ${1:filename} ${2:newname}${3: ok-if-already-exists}${4: keep-time}{5: preserve-uid-gid})
\ No newline at end of file diff --git a/emacs-lisp-mode/current-buffer b/emacs-lisp-mode/current-buffer index b25a48a..b25a48a 100755..100644 --- a/emacs-lisp-mode/current-buffer +++ b/emacs-lisp-mode/current-buffer diff --git a/emacs-lisp-mode/custom-autoload b/emacs-lisp-mode/custom-autoload index b5dbb71..5b68e3f 100755..100644 --- a/emacs-lisp-mode/custom-autoload +++ b/emacs-lisp-mode/custom-autoload @@ -3,4 +3,4 @@ #key: custom-autoload #key: ca # -- -(custom-autoload$0 SYMBOL LOAD &optional NOSET)
\ No newline at end of file +(custom-autoload ${1:symbol} ${2:load}${3: noset})
\ No newline at end of file diff --git a/emacs-lisp-mode/defalias b/emacs-lisp-mode/defalias index 7c3998a..a2940b8 100755..100644 --- a/emacs-lisp-mode/defalias +++ b/emacs-lisp-mode/defalias @@ -2,4 +2,4 @@ #name: defalias #key: defalias # -- -(defalias 'SYMBOL$0 'DEFINITION &optional DOCSTRING)
\ No newline at end of file +(defalias '${1:symbol} '${2:alias}${3: "docstring"})
\ No newline at end of file diff --git a/emacs-lisp-mode/defcustom b/emacs-lisp-mode/defcustom index 25ecbaa..10ff35a 100755..100644 --- a/emacs-lisp-mode/defcustom +++ b/emacs-lisp-mode/defcustom @@ -2,4 +2,4 @@ #name: defcustom #key: defcustom # -- -(defcustom $0 VALUE "DOC" &optional ARGS)
\ No newline at end of file +(defcustom ${1:symbol} ${2:standard} "${3:docstring}"${4: args})
\ No newline at end of file diff --git a/emacs-lisp-mode/define-key b/emacs-lisp-mode/define-key index e483a51..4a63b5a 100755..100644 --- a/emacs-lisp-mode/define-key +++ b/emacs-lisp-mode/define-key @@ -3,4 +3,4 @@ #key: define-key #key: dk # -- -(define-key KEYMAPNAME$0 (kbd "M-b") 'FUNCNAME)
\ No newline at end of file +(define-key ${1:mode}-map (kbd "${2:key}") $0)
\ No newline at end of file diff --git a/emacs-lisp-mode/defsubst b/emacs-lisp-mode/defsubst index 5ce9033..235aed0 100755..100644 --- a/emacs-lisp-mode/defsubst +++ b/emacs-lisp-mode/defsubst @@ -2,4 +2,4 @@ #name: defsubst #key: defsubst # -- -(defsubst $0 )
\ No newline at end of file +(defsubst $0)
\ No newline at end of file diff --git a/emacs-lisp-mode/defun b/emacs-lisp-mode/defun index 6d7001e..d01a0fa 100644 --- a/emacs-lisp-mode/defun +++ b/emacs-lisp-mode/defun @@ -3,5 +3,6 @@ # key: def # -- (defun ${1:fun} (${2:args}) - ${3:(interactive${4: "P"})} + "${3:docstring}" + ${4:(interactive${5: "${6:P}"})} $0)
\ No newline at end of file diff --git a/emacs-lisp-mode/defvar b/emacs-lisp-mode/defvar index 6781858..7ef2482 100755..100644 --- a/emacs-lisp-mode/defvar +++ b/emacs-lisp-mode/defvar @@ -1,4 +1,4 @@ #name: defvar #key: defvar # -- -(defvar $0 &optional ${1:initvalue} "${2:docstring}")
\ No newline at end of file +(defvar ${1:symbol}${2: initvalue}${3: "docstring"})
\ No newline at end of file diff --git a/emacs-lisp-mode/delete-char b/emacs-lisp-mode/delete-char index da983bd..da983bd 100755..100644 --- a/emacs-lisp-mode/delete-char +++ b/emacs-lisp-mode/delete-char diff --git a/emacs-lisp-mode/delete-directory b/emacs-lisp-mode/delete-directory index 59f0838..bd6182b 100755..100644 --- a/emacs-lisp-mode/delete-directory +++ b/emacs-lisp-mode/delete-directory @@ -3,4 +3,4 @@ #key: delete-directory #key: dd # -- -(delete-directory $0 &optional RECURSIVE)
\ No newline at end of file +(delete-directory ${1:dicretory}${2: recursive})
\ No newline at end of file diff --git a/emacs-lisp-mode/delete-file b/emacs-lisp-mode/delete-file index dfbd4f1..dfbd4f1 100755..100644 --- a/emacs-lisp-mode/delete-file +++ b/emacs-lisp-mode/delete-file diff --git a/emacs-lisp-mode/delete-region b/emacs-lisp-mode/delete-region index 7c753d2..acffd38 100755..100644 --- a/emacs-lisp-mode/delete-region +++ b/emacs-lisp-mode/delete-region @@ -3,4 +3,4 @@ #key: delete-region #key: dr # -- -(delete-region $0 )
\ No newline at end of file +(delete-region $0)
\ No newline at end of file diff --git a/emacs-lisp-mode/directory-files b/emacs-lisp-mode/directory-files index df301a2..5eb4c06 100755..100644 --- a/emacs-lisp-mode/directory-files +++ b/emacs-lisp-mode/directory-files @@ -3,4 +3,4 @@ #key: directory-files #key: df # -- -(directory-files $0 &optional FULL MATCH NOSORT)
\ No newline at end of file +(directory-files ${1:directory}${2: full}${3: match}${4: nosort})
\ No newline at end of file diff --git a/emacs-lisp-mode/dolist b/emacs-lisp-mode/dolist index ea66015..b425153 100755..100644 --- a/emacs-lisp-mode/dolist +++ b/emacs-lisp-mode/dolist @@ -2,4 +2,4 @@ #name: dolist #key: dolist # -- -(dolist $0 )
\ No newline at end of file +(dolist $0)
\ No newline at end of file diff --git a/emacs-lisp-mode/end-of-line b/emacs-lisp-mode/end-of-line index f8a2d9f..f8a2d9f 100755..100644 --- a/emacs-lisp-mode/end-of-line +++ b/emacs-lisp-mode/end-of-line diff --git a/emacs-lisp-mode/eq b/emacs-lisp-mode/eq index 3d29f52..3d29f52 100755..100644 --- a/emacs-lisp-mode/eq +++ b/emacs-lisp-mode/eq diff --git a/emacs-lisp-mode/equal b/emacs-lisp-mode/equal index 7b0dd58..7b0dd58 100755..100644 --- a/emacs-lisp-mode/equal +++ b/emacs-lisp-mode/equal diff --git a/emacs-lisp-mode/error b/emacs-lisp-mode/error index 48bf689..39ed35c 100755..100644 --- a/emacs-lisp-mode/error +++ b/emacs-lisp-mode/error @@ -2,4 +2,4 @@ #name: error #key: error # -- -(error "$0" &optional ARGS)
\ No newline at end of file +(error "${1:message}"${2: format-args})
\ No newline at end of file diff --git a/emacs-lisp-mode/ert-deftest b/emacs-lisp-mode/ert-deftest new file mode 100644 index 0000000..0ccdb73 --- /dev/null +++ b/emacs-lisp-mode/ert-deftest @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +#contributor: Raghav Kumar Gautam +#name: ert-deftest +#key: edt +# -- +(ert-deftest ${1:test-name} () + $0) diff --git a/emacs-lisp-mode/expand-file-name b/emacs-lisp-mode/expand-file-name index 8e6c596..c5eb0e7 100755..100644 --- a/emacs-lisp-mode/expand-file-name +++ b/emacs-lisp-mode/expand-file-name @@ -3,4 +3,4 @@ #key: expand-file-name #key: efn # -- -(expand-file-name $0 )
\ No newline at end of file +(expand-file-name $0)
\ No newline at end of file diff --git a/emacs-lisp-mode/f b/emacs-lisp-mode/f deleted file mode 100755 index 011a606..0000000 --- a/emacs-lisp-mode/f +++ /dev/null @@ -1,5 +0,0 @@ -#contributor: Xah Lee (XahLee.org) -#name: format -#key: format -# -- -(format "$0" &optional OBJECTS)
\ No newline at end of file diff --git a/emacs-lisp-mode/fboundp b/emacs-lisp-mode/fboundp index 0212c2d..830b46d 100755..100644 --- a/emacs-lisp-mode/fboundp +++ b/emacs-lisp-mode/fboundp @@ -2,4 +2,4 @@ #name: fboundp #key: fboundp # -- -(fboundp '$0 )
\ No newline at end of file +(fboundp '$0)
\ No newline at end of file diff --git a/emacs-lisp-mode/file-name-directory b/emacs-lisp-mode/file-name-directory index e7fb5c0..e7fb5c0 100755..100644 --- a/emacs-lisp-mode/file-name-directory +++ b/emacs-lisp-mode/file-name-directory diff --git a/emacs-lisp-mode/file-name-extension b/emacs-lisp-mode/file-name-extension index 38dc0c4..d02a3f0 100755..100644 --- a/emacs-lisp-mode/file-name-extension +++ b/emacs-lisp-mode/file-name-extension @@ -3,4 +3,4 @@ #key: file-name-extension #key: fne # -- -(file-name-extension $0 &optional PERIOD)
\ No newline at end of file +(file-name-extension ${1:filename}${2: period})
\ No newline at end of file diff --git a/emacs-lisp-mode/file-name-nondirectory b/emacs-lisp-mode/file-name-nondirectory index 7310bec..5f1ccb1 100755..100644 --- a/emacs-lisp-mode/file-name-nondirectory +++ b/emacs-lisp-mode/file-name-nondirectory @@ -3,4 +3,4 @@ #key: file-name-nondirectory #key: fnn # -- -(file-name-nondirectory $0 )
\ No newline at end of file +(file-name-nondirectory $0)
\ No newline at end of file diff --git a/emacs-lisp-mode/file-name-sans-extension b/emacs-lisp-mode/file-name-sans-extension index 8b18db5..8b18db5 100755..100644 --- a/emacs-lisp-mode/file-name-sans-extension +++ b/emacs-lisp-mode/file-name-sans-extension diff --git a/emacs-lisp-mode/file-relative-name b/emacs-lisp-mode/file-relative-name index 39b6807..7a702bc 100755..100644 --- a/emacs-lisp-mode/file-relative-name +++ b/emacs-lisp-mode/file-relative-name @@ -3,4 +3,4 @@ #key: file-relative-name #key: frn # -- -(file-relative-name $0 )
\ No newline at end of file +(file-relative-name $0)
\ No newline at end of file diff --git a/emacs-lisp-mode/file.read-lines b/emacs-lisp-mode/file.read-lines index b4a1942..7dba173 100644 --- a/emacs-lisp-mode/file.read-lines +++ b/emacs-lisp-mode/file.read-lines @@ -6,11 +6,11 @@ (with-temp-buffer (insert-file-contents filePath) (split-string - (buffer-string) "\n" t)) ) + (buffer-string) "\n" t))) ;; process all lines -(mapc - (lambda (aLine) +(mapc + (lambda (aLine) (message aLine) ; do your stuff here ) (read-lines "inputFilePath") diff --git a/emacs-lisp-mode/find-file b/emacs-lisp-mode/find-file index 8038e83..69d26ec 100755..100644 --- a/emacs-lisp-mode/find-file +++ b/emacs-lisp-mode/find-file @@ -3,4 +3,4 @@ #key: find-file #key: ff # -- -(find-file $0 )
\ No newline at end of file +(find-file $0)
\ No newline at end of file diff --git a/emacs-lisp-mode/format b/emacs-lisp-mode/format index 011a606..3f93f7c 100755..100644 --- a/emacs-lisp-mode/format +++ b/emacs-lisp-mode/format @@ -1,5 +1,5 @@ #contributor: Xah Lee (XahLee.org) #name: format -#key: format +#key: f # -- -(format "$0" &optional OBJECTS)
\ No newline at end of file +(format "${1:message}" ${2:format-args})
\ No newline at end of file diff --git a/emacs-lisp-mode/forward-char b/emacs-lisp-mode/forward-char index 1298e98..1298e98 100755..100644 --- a/emacs-lisp-mode/forward-char +++ b/emacs-lisp-mode/forward-char diff --git a/emacs-lisp-mode/forward-line b/emacs-lisp-mode/forward-line index 37d94d7..0556255 100755..100644 --- a/emacs-lisp-mode/forward-line +++ b/emacs-lisp-mode/forward-line @@ -3,4 +3,4 @@ #key: forward-line #key: fl # -- -(forward-line $0 )
\ No newline at end of file +(forward-line $0)
\ No newline at end of file diff --git a/emacs-lisp-mode/funcall b/emacs-lisp-mode/funcall index fb486bc..fb486bc 100755..100644 --- a/emacs-lisp-mode/funcall +++ b/emacs-lisp-mode/funcall diff --git a/emacs-lisp-mode/function b/emacs-lisp-mode/function index cbebaf0..824721d 100755..100644 --- a/emacs-lisp-mode/function +++ b/emacs-lisp-mode/function @@ -2,4 +2,4 @@ #name: function #key: function # -- -(function $0 )
\ No newline at end of file +(function $0)
\ No newline at end of file diff --git a/emacs-lisp-mode/get b/emacs-lisp-mode/get index 9b29658..e371823 100755..100644 --- a/emacs-lisp-mode/get +++ b/emacs-lisp-mode/get @@ -2,4 +2,4 @@ #name: get #key: get # -- -(get SYMBOL$0 PROPNAME)
\ No newline at end of file +(get ${1:symbol} {2:propname})
\ No newline at end of file diff --git a/emacs-lisp-mode/global-set-key b/emacs-lisp-mode/global-set-key index 8629f27..5a2f3cc 100755..100644 --- a/emacs-lisp-mode/global-set-key +++ b/emacs-lisp-mode/global-set-key @@ -3,4 +3,4 @@ #key: global-set-key #key: gsk # -- -(global-set-key (kbd "C-$0") 'COMMAND)
\ No newline at end of file +(global-set-key (kbd "${1:key}") $0)
\ No newline at end of file diff --git a/emacs-lisp-mode/goto-char b/emacs-lisp-mode/goto-char index 7cb8d2b..7cb8d2b 100755..100644 --- a/emacs-lisp-mode/goto-char +++ b/emacs-lisp-mode/goto-char diff --git a/emacs-lisp-mode/hash b/emacs-lisp-mode/hash index 0022722..a5d5786 100644 --- a/emacs-lisp-mode/hash +++ b/emacs-lisp-mode/hash @@ -2,4 +2,4 @@ # name: hash # key: hash # -- -make-hash-table ${1:options}
\ No newline at end of file +(make-hash-table $0)
\ No newline at end of file diff --git a/emacs-lisp-mode/if b/emacs-lisp-mode/if index c797755..c797755 100755..100644 --- a/emacs-lisp-mode/if +++ b/emacs-lisp-mode/if diff --git a/emacs-lisp-mode/insert b/emacs-lisp-mode/insert index ae5943d..ae5943d 100755..100644 --- a/emacs-lisp-mode/insert +++ b/emacs-lisp-mode/insert diff --git a/emacs-lisp-mode/insert-file-contents b/emacs-lisp-mode/insert-file-contents index ffdd154..5a14157 100755..100644 --- a/emacs-lisp-mode/insert-file-contents +++ b/emacs-lisp-mode/insert-file-contents @@ -3,4 +3,4 @@ #key: insert-file-contents #key: ifc # -- -(insert-file-contents $0 &optional VISIT BEG END REPLACE)
\ No newline at end of file +(insert-file-contents ${1:filename}${2: visit}${3: beg}${4: end}${5: replace})
\ No newline at end of file diff --git a/emacs-lisp-mode/interactive b/emacs-lisp-mode/interactive index f973892..9d73dba 100755..100644 --- a/emacs-lisp-mode/interactive +++ b/emacs-lisp-mode/interactive @@ -2,4 +2,4 @@ #name: interactive #key: interactive # -- -(interactive)
\ No newline at end of file +(interactive${1: "${2:P}"})
\ No newline at end of file diff --git a/emacs-lisp-mode/kbd b/emacs-lisp-mode/kbd index be91b08..be91b08 100755..100644 --- a/emacs-lisp-mode/kbd +++ b/emacs-lisp-mode/kbd diff --git a/emacs-lisp-mode/kill-buffer b/emacs-lisp-mode/kill-buffer index 491a73b..491a73b 100755..100644 --- a/emacs-lisp-mode/kill-buffer +++ b/emacs-lisp-mode/kill-buffer diff --git a/emacs-lisp-mode/lambda b/emacs-lisp-mode/lambda index ae4062f..503fad1 100755..100644 --- a/emacs-lisp-mode/lambda +++ b/emacs-lisp-mode/lambda @@ -1,5 +1,6 @@ +# -*- mode: snippet; -*- #contributor: Xah Lee (XahLee.org) #name: lambda -#key: lambda +#key: lam # -- -(lambda ($0) "DOCSTRING" (interactive) BODY)
\ No newline at end of file +(lambda ($1) ${2:(interactive${3: "$4"}) }$0) diff --git a/emacs-lisp-mode/length b/emacs-lisp-mode/length index 46a379b..46a379b 100755..100644 --- a/emacs-lisp-mode/length +++ b/emacs-lisp-mode/length diff --git a/emacs-lisp-mode/let b/emacs-lisp-mode/let index 76e991e..19df819 100755..100644 --- a/emacs-lisp-mode/let +++ b/emacs-lisp-mode/let @@ -3,6 +3,5 @@ #key: let #key: l # -- -(let ($1 ) - $0 -)
\ No newline at end of file +(let${1:*} (${2:args}) + $0) diff --git a/emacs-lisp-mode/line-beginning-position b/emacs-lisp-mode/line-beginning-position index 647158b..647158b 100755..100644 --- a/emacs-lisp-mode/line-beginning-position +++ b/emacs-lisp-mode/line-beginning-position diff --git a/emacs-lisp-mode/line-end-position b/emacs-lisp-mode/line-end-position index f3a4f4c..f3a4f4c 100755..100644 --- a/emacs-lisp-mode/line-end-position +++ b/emacs-lisp-mode/line-end-position diff --git a/emacs-lisp-mode/list b/emacs-lisp-mode/list index 11be961..11be961 100755..100644 --- a/emacs-lisp-mode/list +++ b/emacs-lisp-mode/list diff --git a/emacs-lisp-mode/looking-at b/emacs-lisp-mode/looking-at index 83741dd..83741dd 100755..100644 --- a/emacs-lisp-mode/looking-at +++ b/emacs-lisp-mode/looking-at diff --git a/emacs-lisp-mode/make-directory b/emacs-lisp-mode/make-directory index 6c6ee64..292f1a3 100755..100644 --- a/emacs-lisp-mode/make-directory +++ b/emacs-lisp-mode/make-directory @@ -3,4 +3,4 @@ #key: make-directory #key: md # -- -(make-directory $0 &optional PARENTS)
\ No newline at end of file +(make-directory ${1:directory}${2: parents})
\ No newline at end of file diff --git a/emacs-lisp-mode/make-local-variable b/emacs-lisp-mode/make-local-variable index 06e0ff4..06e0ff4 100755..100644 --- a/emacs-lisp-mode/make-local-variable +++ b/emacs-lisp-mode/make-local-variable diff --git a/emacs-lisp-mode/mapc b/emacs-lisp-mode/mapc index f244f64..af5d786 100755..100644 --- a/emacs-lisp-mode/mapc +++ b/emacs-lisp-mode/mapc @@ -2,4 +2,4 @@ #name: mapc #key: mapc # -- -(mapc '$0 SEQUENCE)
\ No newline at end of file +(mapc ${1:function} $0)
\ No newline at end of file diff --git a/emacs-lisp-mode/mapcar b/emacs-lisp-mode/mapcar index 25bbd5d..097de14 100755..100644 --- a/emacs-lisp-mode/mapcar +++ b/emacs-lisp-mode/mapcar @@ -2,4 +2,4 @@ #name: mapcar #key: mapcar # -- -(mapcar $0 )
\ No newline at end of file +(mapcar $0)
\ No newline at end of file diff --git a/emacs-lisp-mode/match-beginning b/emacs-lisp-mode/match-beginning index b3ecc75..4ef7ba2 100755..100644 --- a/emacs-lisp-mode/match-beginning +++ b/emacs-lisp-mode/match-beginning @@ -3,4 +3,4 @@ #key: match-beginning #key: mb # -- -(match-beginning N$0)
\ No newline at end of file +(match-beginning $0)
\ No newline at end of file diff --git a/emacs-lisp-mode/match-end b/emacs-lisp-mode/match-end index d263499..7fb0daa 100755..100644 --- a/emacs-lisp-mode/match-end +++ b/emacs-lisp-mode/match-end @@ -3,4 +3,4 @@ #key: match-end #key: me # -- -(match-end N$0)
\ No newline at end of file +(match-end $0)
\ No newline at end of file diff --git a/emacs-lisp-mode/match-string b/emacs-lisp-mode/match-string index 5c74e9d..32dd538 100755..100644 --- a/emacs-lisp-mode/match-string +++ b/emacs-lisp-mode/match-string @@ -3,4 +3,4 @@ #key: match-string #key: ms # -- -(match-string $0 )
\ No newline at end of file +(match-string $0)
\ No newline at end of file diff --git a/emacs-lisp-mode/memq b/emacs-lisp-mode/memq index f0f7cba..f718991 100755..100644 --- a/emacs-lisp-mode/memq +++ b/emacs-lisp-mode/memq @@ -2,4 +2,4 @@ #name: memq #key: memq # -- -(memq ELT$0 LIST)
\ No newline at end of file +(memq ${1:element} ${2:list})
\ No newline at end of file diff --git a/emacs-lisp-mode/message b/emacs-lisp-mode/message index ea3009e..6ea047c 100755..100644 --- a/emacs-lisp-mode/message +++ b/emacs-lisp-mode/message @@ -3,4 +3,4 @@ #key: message #key: m # -- -(message "FORMATSTRING$0" &optional ARGS)
\ No newline at end of file +(message "${1:message}"${2: format-args})
\ No newline at end of file diff --git a/emacs-lisp-mode/minor_mode b/emacs-lisp-mode/minor_mode index f0a09b2..27f0474 100644 --- a/emacs-lisp-mode/minor_mode +++ b/emacs-lisp-mode/minor_mode @@ -2,7 +2,7 @@ # name: minor_mode # key: minor # -- -(defvar ${1:mode}-modeline-indicator " ${2:INDICATOR}" +(defvar ${1:mode}-modeline-indicator " ${2:indicator}" "call ($1-install-mode) again if this is changed") (defvar $1-mode nil) diff --git a/emacs-lisp-mode/not b/emacs-lisp-mode/not index 083bcd7..94fa6ab 100755..100644 --- a/emacs-lisp-mode/not +++ b/emacs-lisp-mode/not @@ -3,4 +3,4 @@ #key: not #key: n # -- -(not $0 )
\ No newline at end of file +(not $0)
\ No newline at end of file diff --git a/emacs-lisp-mode/nth b/emacs-lisp-mode/nth index b3880a2..5e1b68a 100755..100644 --- a/emacs-lisp-mode/nth +++ b/emacs-lisp-mode/nth @@ -2,4 +2,4 @@ #name: nth #key: nth # -- -(nth N$0 LIST)
\ No newline at end of file +(nth ${1:index} ${2:list})
\ No newline at end of file diff --git a/emacs-lisp-mode/null b/emacs-lisp-mode/null index 9d451ec..9d451ec 100755..100644 --- a/emacs-lisp-mode/null +++ b/emacs-lisp-mode/null diff --git a/emacs-lisp-mode/number-to-string b/emacs-lisp-mode/number-to-string index 42eccb7..42eccb7 100755..100644 --- a/emacs-lisp-mode/number-to-string +++ b/emacs-lisp-mode/number-to-string diff --git a/emacs-lisp-mode/or b/emacs-lisp-mode/or index 046218c..8aaef27 100755..100644 --- a/emacs-lisp-mode/or +++ b/emacs-lisp-mode/or @@ -3,4 +3,4 @@ #key: or #key: o # -- -(or $0 )
\ No newline at end of file +(or $0)
\ No newline at end of file diff --git a/emacs-lisp-mode/point b/emacs-lisp-mode/point index 6aa6b74..6aa6b74 100755..100644 --- a/emacs-lisp-mode/point +++ b/emacs-lisp-mode/point diff --git a/emacs-lisp-mode/point-max b/emacs-lisp-mode/point-max index 6544869..6544869 100755..100644 --- a/emacs-lisp-mode/point-max +++ b/emacs-lisp-mode/point-max diff --git a/emacs-lisp-mode/point-min b/emacs-lisp-mode/point-min index 029d736..029d736 100755..100644 --- a/emacs-lisp-mode/point-min +++ b/emacs-lisp-mode/point-min diff --git a/emacs-lisp-mode/princ b/emacs-lisp-mode/princ index 88ad7d7..88ad7d7 100755..100644 --- a/emacs-lisp-mode/princ +++ b/emacs-lisp-mode/princ diff --git a/emacs-lisp-mode/print b/emacs-lisp-mode/print index 7d0f421..7d0f421 100755..100644 --- a/emacs-lisp-mode/print +++ b/emacs-lisp-mode/print diff --git a/emacs-lisp-mode/progn b/emacs-lisp-mode/progn index d07c5c3..d07c5c3 100755..100644 --- a/emacs-lisp-mode/progn +++ b/emacs-lisp-mode/progn diff --git a/emacs-lisp-mode/push b/emacs-lisp-mode/push index f019b80..76d14a5 100755..100644 --- a/emacs-lisp-mode/push +++ b/emacs-lisp-mode/push @@ -2,4 +2,4 @@ #name: push #key: push # -- -(push $0 )
\ No newline at end of file +(push $0)
\ No newline at end of file diff --git a/emacs-lisp-mode/put b/emacs-lisp-mode/put index 7a91f20..7c2a9cf 100755..100644 --- a/emacs-lisp-mode/put +++ b/emacs-lisp-mode/put @@ -2,4 +2,4 @@ #name: put #key: put # -- -(put $0 PROPNAME VALUE)
\ No newline at end of file +(put ${1:symbol} ${2:propname} ${3:value})
\ No newline at end of file diff --git a/emacs-lisp-mode/re-search-backward b/emacs-lisp-mode/re-search-backward index a04d99f..1aefc70 100755..100644 --- a/emacs-lisp-mode/re-search-backward +++ b/emacs-lisp-mode/re-search-backward @@ -3,4 +3,4 @@ #key: re-search-backward #key: rsb # -- -(re-search-backward REGEXP$0 &optional BOUND NOERROR COUNT)
\ No newline at end of file +(re-search-backward ${1:regexp}${2: bound}${3: noerror}${4: count})
\ No newline at end of file diff --git a/emacs-lisp-mode/re-search-forward b/emacs-lisp-mode/re-search-forward index 31a24a3..35a3861 100755..100644 --- a/emacs-lisp-mode/re-search-forward +++ b/emacs-lisp-mode/re-search-forward @@ -3,4 +3,4 @@ #key: re-search-forward #key: rsf # -- -(re-search-forward REGEXP$0 &optional BOUND NOERROR COUNT)
\ No newline at end of file +(re-search-forward ${1:regexp}${2: bound}${3: noerror}${4: count})
\ No newline at end of file diff --git a/emacs-lisp-mode/region-active-p b/emacs-lisp-mode/region-active-p index e70553e..e70553e 100755..100644 --- a/emacs-lisp-mode/region-active-p +++ b/emacs-lisp-mode/region-active-p diff --git a/emacs-lisp-mode/region-beginning b/emacs-lisp-mode/region-beginning index 55496e2..55496e2 100755..100644 --- a/emacs-lisp-mode/region-beginning +++ b/emacs-lisp-mode/region-beginning diff --git a/emacs-lisp-mode/region-end b/emacs-lisp-mode/region-end index fddcd9f..fddcd9f 100755..100644 --- a/emacs-lisp-mode/region-end +++ b/emacs-lisp-mode/region-end diff --git a/emacs-lisp-mode/rename-file b/emacs-lisp-mode/rename-file index b589a89..63b9dbc 100755..100644 --- a/emacs-lisp-mode/rename-file +++ b/emacs-lisp-mode/rename-file @@ -3,4 +3,4 @@ #key: rename-file #key: rf # -- -(rename-file FILE$0 NEWNAME &optional OK-IF-ALREADY-EXISTS)
\ No newline at end of file +(rename-file ${1:file} ${2:newname}${3: ok-if-already-exists})
\ No newline at end of file diff --git a/emacs-lisp-mode/repeat b/emacs-lisp-mode/repeat index 45422eb..ff8fae1 100755..100644 --- a/emacs-lisp-mode/repeat +++ b/emacs-lisp-mode/repeat @@ -2,4 +2,4 @@ #name: repeat #key: repeat # -- -(repeat $0 )
\ No newline at end of file +(repeat $0)
\ No newline at end of file diff --git a/emacs-lisp-mode/replace-regexp b/emacs-lisp-mode/replace-regexp index 7535bc1..b6b2746 100755..100644 --- a/emacs-lisp-mode/replace-regexp +++ b/emacs-lisp-mode/replace-regexp @@ -3,4 +3,4 @@ #key: replace-regexp #key: rr # -- -(replace-regexp REGEXP$0 TO-STRING &optional DELIMITED START END)
\ No newline at end of file +(replace-regexp ${1:regexp}${2: delimited}${3: start}${4: end}) diff --git a/emacs-lisp-mode/replace-regexp-in-string b/emacs-lisp-mode/replace-regexp-in-string index edf7f5b..5f07473 100755..100644 --- a/emacs-lisp-mode/replace-regexp-in-string +++ b/emacs-lisp-mode/replace-regexp-in-string @@ -3,4 +3,4 @@ #key: replace-regexp-in-string #key: rris # -- -(replace-regexp-in-string REGEXP$0 REP STRING &optional FIXEDCASE LITERAL SUBEXP START)
\ No newline at end of file +(replace-regexp-in-string ${1:regexp} ${2:rep} ${3:string}${4: fixedcase}${5: literal}${6: subexp}${7: start})
\ No newline at end of file diff --git a/emacs-lisp-mode/require b/emacs-lisp-mode/require index 9c91035..cbce359 100755..100644 --- a/emacs-lisp-mode/require +++ b/emacs-lisp-mode/require @@ -2,4 +2,4 @@ #name: require #key: require # -- -(require $0 )
\ No newline at end of file +(require $0)
\ No newline at end of file diff --git a/emacs-lisp-mode/save-buffer b/emacs-lisp-mode/save-buffer index 931a72c..931a72c 100755..100644 --- a/emacs-lisp-mode/save-buffer +++ b/emacs-lisp-mode/save-buffer diff --git a/emacs-lisp-mode/save-excursion b/emacs-lisp-mode/save-excursion index 5f587ce..5f587ce 100755..100644 --- a/emacs-lisp-mode/save-excursion +++ b/emacs-lisp-mode/save-excursion diff --git a/emacs-lisp-mode/search-backward b/emacs-lisp-mode/search-backward index 4b07486..80740da 100755..100644 --- a/emacs-lisp-mode/search-backward +++ b/emacs-lisp-mode/search-backward @@ -1,6 +1,7 @@ +# -*- mode: snippet; -*- #contributor: Xah Lee (XahLee.org) #name: search-backward #key: search-backward #key: sb # -- -(search-backward "$0" &optional BOUND NOERROR COUNT)
\ No newline at end of file +(search-backward "$1"${2: ${3:bound}${4: ${5:noerror}${6: count}}})$0 diff --git a/emacs-lisp-mode/search-backward-regexp b/emacs-lisp-mode/search-backward-regexp index 33795fd..91ac231 100755..100644 --- a/emacs-lisp-mode/search-backward-regexp +++ b/emacs-lisp-mode/search-backward-regexp @@ -1,6 +1,7 @@ +# -*- mode: snippet; -*- #contributor: Xah Lee (XahLee.org) #name: search-backward-regexp #key: search-backward-regexp #key: sbr # -- -(search-backward-regexp "$0" &optional BOUND NOERROR COUNT)
\ No newline at end of file +(search-backward-regexp "$1"${2: ${3:bound}${4: ${5:noerror}${6: count}}})$0 diff --git a/emacs-lisp-mode/search-forward b/emacs-lisp-mode/search-forward index 03e56c8..4e8a22a 100755..100644 --- a/emacs-lisp-mode/search-forward +++ b/emacs-lisp-mode/search-forward @@ -1,6 +1,7 @@ +# -*- mode: snippet; -*- #contributor: Xah Lee (XahLee.org) #name: search-forward #key: search-forward #key: sf # -- -(search-forward "$0" &optional BOUND NOERROR COUNT)
\ No newline at end of file +(search-forward "$1"${2: ${3:bound}${4: ${5:noerror}${6: count}}})$0 diff --git a/emacs-lisp-mode/search-forward-regexp b/emacs-lisp-mode/search-forward-regexp index eb37b84..3c025c8 100755..100644 --- a/emacs-lisp-mode/search-forward-regexp +++ b/emacs-lisp-mode/search-forward-regexp @@ -1,6 +1,7 @@ +# -*- mode: snippet; -*- #contributor: Xah Lee (XahLee.org) #name: search-forward-regexp #key: search-forward-regexp #key: sfr # -- -(search-forward-regexp "$0" &optional BOUND NOERROR COUNT)
\ No newline at end of file +(search-forward-regexp "$1"${2: ${3:bound}${4: ${5:noerror}${6: count}}})$0 diff --git a/emacs-lisp-mode/set b/emacs-lisp-mode/set index cf9c101..8bbebb6 100755..100644 --- a/emacs-lisp-mode/set +++ b/emacs-lisp-mode/set @@ -2,4 +2,4 @@ #name: set #key: set # -- -(set $0 )
\ No newline at end of file +(set $0)
\ No newline at end of file diff --git a/emacs-lisp-mode/set-buffer b/emacs-lisp-mode/set-buffer index 0eff93d..9f3390d 100755..100644 --- a/emacs-lisp-mode/set-buffer +++ b/emacs-lisp-mode/set-buffer @@ -3,4 +3,4 @@ #key: set-buffer #key: sb # -- -(set-buffer $0 )
\ No newline at end of file +(set-buffer $0)
\ No newline at end of file diff --git a/emacs-lisp-mode/set-file-modes b/emacs-lisp-mode/set-file-modes index f7d7e16..4b9be44 100755..100644 --- a/emacs-lisp-mode/set-file-modes +++ b/emacs-lisp-mode/set-file-modes @@ -3,4 +3,4 @@ #key: set-file-modes #key: sfm # -- -(set-file-modes $0 MODE)
\ No newline at end of file +(set-file-modes ${1:filename} $0)
\ No newline at end of file diff --git a/emacs-lisp-mode/set-mark b/emacs-lisp-mode/set-mark index 9a482a1..9a482a1 100755..100644 --- a/emacs-lisp-mode/set-mark +++ b/emacs-lisp-mode/set-mark diff --git a/emacs-lisp-mode/setq b/emacs-lisp-mode/setq index 4bdb4fc..6eaee9f 100755..100644 --- a/emacs-lisp-mode/setq +++ b/emacs-lisp-mode/setq @@ -3,4 +3,4 @@ #key: setq #key: s # -- -(setq $0 )
\ No newline at end of file +(setq $0)
\ No newline at end of file diff --git a/emacs-lisp-mode/should b/emacs-lisp-mode/should new file mode 100644 index 0000000..29748a2 --- /dev/null +++ b/emacs-lisp-mode/should @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +#contributor: Raghav Kumar Gautam +#name: should +#key: sh +# -- +(should $0)
\ No newline at end of file diff --git a/emacs-lisp-mode/skip-chars-backward b/emacs-lisp-mode/skip-chars-backward index 0fc4cf4..2a909ea 100755..100644 --- a/emacs-lisp-mode/skip-chars-backward +++ b/emacs-lisp-mode/skip-chars-backward @@ -3,4 +3,4 @@ #key: skip-chars-backward #key: scb # -- -(skip-chars-backward "$0" &optional LIM)
\ No newline at end of file +(skip-chars-backward "${1:string}"${2: lim})
\ No newline at end of file diff --git a/emacs-lisp-mode/skip-chars-forward b/emacs-lisp-mode/skip-chars-forward index 110cbd5..e6f8cad 100755..100644 --- a/emacs-lisp-mode/skip-chars-forward +++ b/emacs-lisp-mode/skip-chars-forward @@ -3,4 +3,4 @@ #key: skip-chars-forward #key: scf # -- -(skip-chars-forward "$0" &optional LIM)
\ No newline at end of file +(skip-chars-forward "${1:string}"${2: lim})
\ No newline at end of file diff --git a/emacs-lisp-mode/split-string b/emacs-lisp-mode/split-string index 37c372d..e09a4c7 100755..100644 --- a/emacs-lisp-mode/split-string +++ b/emacs-lisp-mode/split-string @@ -3,4 +3,4 @@ #key: split-string #key: ss # -- -(split-string $0 &optional SEPARATORS OMIT-NULLS)
\ No newline at end of file +(split-string ${1:string}${2: separators}${3: omit-nulls})
\ No newline at end of file diff --git a/emacs-lisp-mode/string b/emacs-lisp-mode/string index f3a4dda..9c9e346 100755..100644 --- a/emacs-lisp-mode/string +++ b/emacs-lisp-mode/string @@ -2,4 +2,4 @@ #name: string #key: string # -- -(string $0 )
\ No newline at end of file +(string $0)
\ No newline at end of file diff --git a/emacs-lisp-mode/string-match b/emacs-lisp-mode/string-match index 1ef9876..aa0af29 100755..100644 --- a/emacs-lisp-mode/string-match +++ b/emacs-lisp-mode/string-match @@ -3,4 +3,4 @@ #key: string-match #key: sm # -- -(string-match "REGEXP$0" "STRING" &optional START)
\ No newline at end of file +(string-match "${1:regexp}" "${2:string}"${3: start})
\ No newline at end of file diff --git a/emacs-lisp-mode/string-to-number b/emacs-lisp-mode/string-to-number index 449d621..9eb5c48 100755..100644 --- a/emacs-lisp-mode/string-to-number +++ b/emacs-lisp-mode/string-to-number @@ -3,4 +3,4 @@ #key: string-to-number #key: stn # -- -(string-to-number "$0")
\ No newline at end of file +(string-to-number $0)
\ No newline at end of file diff --git a/emacs-lisp-mode/string= b/emacs-lisp-mode/string= index d0d43aa..04aed21 100755..100644 --- a/emacs-lisp-mode/string= +++ b/emacs-lisp-mode/string= @@ -2,4 +2,4 @@ #name: string= #key: string= # -- -(string= $0 )
\ No newline at end of file +(string= $0)
\ No newline at end of file diff --git a/emacs-lisp-mode/stringp b/emacs-lisp-mode/stringp index c20be65..c20be65 100755..100644 --- a/emacs-lisp-mode/stringp +++ b/emacs-lisp-mode/stringp diff --git a/emacs-lisp-mode/substring b/emacs-lisp-mode/substring index 8ab6b49..6cba966 100755..100644 --- a/emacs-lisp-mode/substring +++ b/emacs-lisp-mode/substring @@ -2,4 +2,4 @@ #name: substring #key: substring # -- -(substring STRING$0 FROM &optional TO)
\ No newline at end of file +(substring ${1:string} ${2:from}${3: to})
\ No newline at end of file diff --git a/emacs-lisp-mode/thing-at-point b/emacs-lisp-mode/thing-at-point index 9c6e189..d2c44fd 100755..100644 --- a/emacs-lisp-mode/thing-at-point +++ b/emacs-lisp-mode/thing-at-point @@ -3,4 +3,4 @@ #key: thing-at-point #key: tap # -- -(thing-at-point '$0) ; symbol, list, sexp, defun, filename, url, email, word, sentence, whitespace, line, page ...
\ No newline at end of file +(thing-at-point ${1:thing}${2: no-properties})
\ No newline at end of file diff --git a/emacs-lisp-mode/unless b/emacs-lisp-mode/unless index 15c1518..15c1518 100755..100644 --- a/emacs-lisp-mode/unless +++ b/emacs-lisp-mode/unless diff --git a/emacs-lisp-mode/vector b/emacs-lisp-mode/vector index 59ad236..59ad236 100755..100644 --- a/emacs-lisp-mode/vector +++ b/emacs-lisp-mode/vector diff --git a/emacs-lisp-mode/when b/emacs-lisp-mode/when index c5f4478..a04a7e4 100755..100644 --- a/emacs-lisp-mode/when +++ b/emacs-lisp-mode/when @@ -1,5 +1,5 @@ #contributor: Xah Lee (XahLee.org) #name: when -#key: when +#key: w # -- (when $0)
\ No newline at end of file diff --git a/emacs-lisp-mode/while b/emacs-lisp-mode/while index 4584be3..4584be3 100755..100644 --- a/emacs-lisp-mode/while +++ b/emacs-lisp-mode/while diff --git a/emacs-lisp-mode/widget-get b/emacs-lisp-mode/widget-get index 24caf7b..66060c1 100755..100644 --- a/emacs-lisp-mode/widget-get +++ b/emacs-lisp-mode/widget-get @@ -3,4 +3,4 @@ #key: widget-get #key: wg # -- -(widget-get $0 )
\ No newline at end of file +(widget-get $0)
\ No newline at end of file diff --git a/emacs-lisp-mode/with-current-buffer b/emacs-lisp-mode/with-current-buffer index 9041303..9ada4ab 100755..100644 --- a/emacs-lisp-mode/with-current-buffer +++ b/emacs-lisp-mode/with-current-buffer @@ -3,4 +3,4 @@ #key: with-current-buffer #key: wcb # -- -(with-current-buffer $0 )
\ No newline at end of file +(with-current-buffer $0)
\ No newline at end of file diff --git a/emacs-lisp-mode/x-dired.process_marked b/emacs-lisp-mode/x-dired.process_marked index 9af5a26..9af5a26 100755..100644 --- a/emacs-lisp-mode/x-dired.process_marked +++ b/emacs-lisp-mode/x-dired.process_marked diff --git a/emacs-lisp-mode/x-file.process b/emacs-lisp-mode/x-file.process index 3c82822..3c82822 100755..100644 --- a/emacs-lisp-mode/x-file.process +++ b/emacs-lisp-mode/x-file.process diff --git a/emacs-lisp-mode/x-file.read-lines b/emacs-lisp-mode/x-file.read-lines index 2b23983..a463581 100755..100644 --- a/emacs-lisp-mode/x-file.read-lines +++ b/emacs-lisp-mode/x-file.read-lines @@ -7,11 +7,11 @@ (with-temp-buffer (insert-file-contents filePath) (split-string - (buffer-string) "\n" t)) ) + (buffer-string) "\n" t))) ;; process all lines -(mapc - (lambda (aLine) +(mapc + (lambda (aLine) (message aLine) ; do your stuff here ) (read-lines "inputFilePath") diff --git a/emacs-lisp-mode/x-find-replace b/emacs-lisp-mode/x-find-replace index d4c4d11..d4c4d11 100755..100644 --- a/emacs-lisp-mode/x-find-replace +++ b/emacs-lisp-mode/x-find-replace diff --git a/emacs-lisp-mode/x-grabstring b/emacs-lisp-mode/x-grabstring index d348e93..d348e93 100755..100644 --- a/emacs-lisp-mode/x-grabstring +++ b/emacs-lisp-mode/x-grabstring diff --git a/emacs-lisp-mode/x-grabthing b/emacs-lisp-mode/x-grabthing index 2c0079d..2c0079d 100755..100644 --- a/emacs-lisp-mode/x-grabthing +++ b/emacs-lisp-mode/x-grabthing diff --git a/emacs-lisp-mode/x-traverse_dir b/emacs-lisp-mode/x-traverse_dir index cfa461a..cfa461a 100755..100644 --- a/emacs-lisp-mode/x-traverse_dir +++ b/emacs-lisp-mode/x-traverse_dir diff --git a/emacs-lisp-mode/x-word-or-region b/emacs-lisp-mode/x-word-or-region index c7b851b..c7b851b 100755..100644 --- a/emacs-lisp-mode/x-word-or-region +++ b/emacs-lisp-mode/x-word-or-region diff --git a/emacs-lisp-mode/y-or-n-p b/emacs-lisp-mode/y-or-n-p deleted file mode 100755 index 8aeec63..0000000 --- a/emacs-lisp-mode/y-or-n-p +++ /dev/null @@ -1,6 +0,0 @@ -#contributor: Xah Lee (XahLee.org) -#name: y-or-n-p -#key: y-or-n-p -#key: yonp -# -- -(yes-or-no-p "PROMPT$0 ")
\ No newline at end of file diff --git a/emacs-lisp-mode/yes-or-no-p b/emacs-lisp-mode/yes-or-no-p index e7bb064..736b253 100755..100644 --- a/emacs-lisp-mode/yes-or-no-p +++ b/emacs-lisp-mode/yes-or-no-p @@ -1,5 +1,5 @@ #contributor: Xah Lee (XahLee.org) #name: yes-or-no-p -#key: yes-or-no-p +#key: yonp # -- -(yes-or-no-p "PROMPT$0 ")
\ No newline at end of file +(yes-or-no-p "${1:prompt} ")
\ No newline at end of file diff --git a/enh-ruby-mode b/enh-ruby-mode deleted file mode 120000 index 6771f4d..0000000 --- a/enh-ruby-mode +++ /dev/null @@ -1 +0,0 @@ -ruby-mode
\ No newline at end of file diff --git a/enh-ruby-mode/.yas-parents b/enh-ruby-mode/.yas-parents new file mode 100644 index 0000000..1bd2276 --- /dev/null +++ b/enh-ruby-mode/.yas-parents @@ -0,0 +1 @@ +ruby-mode diff --git a/ensime-mode b/ensime-mode deleted file mode 120000 index 92088ba..0000000 --- a/ensime-mode +++ /dev/null @@ -1 +0,0 @@ -scala-mode
\ No newline at end of file diff --git a/ensime-mode/.yas-parents b/ensime-mode/.yas-parents new file mode 100644 index 0000000..9035891 --- /dev/null +++ b/ensime-mode/.yas-parents @@ -0,0 +1 @@ +scala-mode diff --git a/f90-mode/au b/f90-mode/au deleted file mode 100644 index 1f0af73..0000000 --- a/f90-mode/au +++ /dev/null @@ -1,4 +0,0 @@ -#contributor: Li Zhu <http://www.zhuli.name> -#name : automatic -# -- -automatic $0 diff --git a/f90-mode/eq b/f90-mode/eq deleted file mode 100644 index 0c6d09f..0000000 --- a/f90-mode/eq +++ /dev/null @@ -1,4 +0,0 @@ -#contributor: Li Zhu <http://www.zhuli.name> -#name : equivalence -# -- -equivalence $0 diff --git a/f90-mode/ib b/f90-mode/ib deleted file mode 100644 index 9275a12..0000000 --- a/f90-mode/ib +++ /dev/null @@ -1,4 +0,0 @@ -#contributor: Li Zhu <http://www.zhuli.name> -#name : implicit byte -# -- -implicit byte $0 diff --git a/f90-mode/ic b/f90-mode/ic deleted file mode 100644 index 79842ea..0000000 --- a/f90-mode/ic +++ /dev/null @@ -1,4 +0,0 @@ -#contributor: Li Zhu <http://www.zhuli.name> -#name : implicit complex -# -- -implicit complex $0 diff --git a/f90-mode/ich b/f90-mode/ich deleted file mode 100644 index 53c7f81..0000000 --- a/f90-mode/ich +++ /dev/null @@ -1,4 +0,0 @@ -#contributor: Li Zhu <http://www.zhuli.name> -#name : implicit character -# -- -implicit character $0 diff --git a/f90-mode/ii b/f90-mode/ii deleted file mode 100644 index 4b1fee5..0000000 --- a/f90-mode/ii +++ /dev/null @@ -1,4 +0,0 @@ -#contributor: Li Zhu <http://www.zhuli.name> -#name : implicit integer -# -- -implicit integer $0 diff --git a/f90-mode/il b/f90-mode/il deleted file mode 100644 index 8658af5..0000000 --- a/f90-mode/il +++ /dev/null @@ -1,4 +0,0 @@ -#contributor: Li Zhu <http://www.zhuli.name> -#name : implicit logical -# -- -implicit logical $0 diff --git a/f90-mode/ir b/f90-mode/ir deleted file mode 100644 index fb37082..0000000 --- a/f90-mode/ir +++ /dev/null @@ -1,4 +0,0 @@ -#contributor: Li Zhu <http://www.zhuli.name> -#name : implicit real -# -- -implicit real $0 diff --git a/f90-mode/pr b/f90-mode/pr deleted file mode 100644 index 24fc8c9..0000000 --- a/f90-mode/pr +++ /dev/null @@ -1,11 +0,0 @@ -# -*- mode: snippet -*- -# contributor: Jonas Kalderstam <jonas@kalderstam.se> -# name: program ... end program ... -# key: pr -# -- -program ${1:name} - ${2:implicit none} - - $0 - -end program $1 diff --git a/f90-mode/purefunc b/f90-mode/purefunc deleted file mode 100644 index eeb3a06..0000000 --- a/f90-mode/purefunc +++ /dev/null @@ -1,12 +0,0 @@ -# -*- mode: snippet -*- -# contributor: Jonas Kalderstam <jonas@kalderstam.se> -# name: pure function .. end function -# key: pure function -# -- -pure function ${1:name} (${2:arg}) - ${3:real} :: $1 - ${4:real, intent(in)} :: $2 - - $0 - -end function $1 diff --git a/f90-mode/puresub b/f90-mode/puresub deleted file mode 100644 index cc908d0..0000000 --- a/f90-mode/puresub +++ /dev/null @@ -1,10 +0,0 @@ -# -*- mode: snippet -*- -# contributor: Jonas Kalderstam <jonas@kalderstam.se> -# name: pure subroutine ... end subroutine ... -# key: pure sub -# -- -pure subroutine ${1:name} (${2:arg}) - ${3:real, intent(in) :: $2} - - $0 -end subroutine $1 diff --git a/f90-mode/st b/f90-mode/st deleted file mode 100644 index 23ae7d0..0000000 --- a/f90-mode/st +++ /dev/null @@ -1,4 +0,0 @@ -#contributor: Li Zhu <http://www.zhuli.name> -#name : structure -# -- -structure $0 diff --git a/f90-mode/su b/f90-mode/su deleted file mode 100644 index 63fea4a..0000000 --- a/f90-mode/su +++ /dev/null @@ -1,10 +0,0 @@ -# -*- mode: snippet -*- -# contributor: Jonas Kalderstam <jonas@kalderstam.se> -# name: subroutine ... end subroutine ... -# key: su -# -- -subroutine ${1:name} (${2:arg}) - ${3:real, intent(in) :: $2} - - $0 -end subroutine $1 diff --git a/faust-mode/button b/faust-mode/button new file mode 100644 index 0000000..6a2e003 --- /dev/null +++ b/faust-mode/button @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: button +# key: bu +# -- +button("$1")$0
\ No newline at end of file diff --git a/faust-mode/case b/faust-mode/case new file mode 100644 index 0000000..a7415ca --- /dev/null +++ b/faust-mode/case @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: case +# key: ca +# -- +case { + $1 + }; +$0
\ No newline at end of file diff --git a/faust-mode/checkbox b/faust-mode/checkbox new file mode 100644 index 0000000..4471fcd --- /dev/null +++ b/faust-mode/checkbox @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: checkbox +# key: ch +# -- +checkbox("$1")$0
\ No newline at end of file diff --git a/faust-mode/component b/faust-mode/component new file mode 100644 index 0000000..9173b10 --- /dev/null +++ b/faust-mode/component @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: component +# key: co +# -- +component("$1.dsp")$0
\ No newline at end of file diff --git a/faust-mode/declare b/faust-mode/declare new file mode 100644 index 0000000..7b27d03 --- /dev/null +++ b/faust-mode/declare @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: declare +# key: de +# -- +declare ${1:key} "${2:value}"; +$0
\ No newline at end of file diff --git a/faust-mode/declareauthor b/faust-mode/declareauthor new file mode 100644 index 0000000..ea96229 --- /dev/null +++ b/faust-mode/declareauthor @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: declare author +# key: da +# -- +declare author "$1"; +$0
\ No newline at end of file diff --git a/faust-mode/declarelicense b/faust-mode/declarelicense new file mode 100644 index 0000000..608f8a1 --- /dev/null +++ b/faust-mode/declarelicense @@ -0,0 +1,16 @@ +# -*- mode: snippet -*- +# name: declare license +# key: dl +# -- +declare license "${1:$$ + (yas-choose-value '( + "AGPLv3" + "Apache" + "BSD 2-clause" + "BSD 3-clause" + "GPLv2" + "GPLv3" + "LGPLv3" + "MIT" + ))}"; +$0
\ No newline at end of file diff --git a/faust-mode/declarename b/faust-mode/declarename new file mode 100644 index 0000000..a8fdec6 --- /dev/null +++ b/faust-mode/declarename @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: declare name +# key: dn +# -- +declare name "$1"; +$0
\ No newline at end of file diff --git a/faust-mode/declareversion b/faust-mode/declareversion new file mode 100644 index 0000000..58de938 --- /dev/null +++ b/faust-mode/declareversion @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: declare version +# key: dv +# -- +declare version "${1:0.1}"; +$0
\ No newline at end of file diff --git a/faust-mode/hbargraph b/faust-mode/hbargraph new file mode 100644 index 0000000..a909992 --- /dev/null +++ b/faust-mode/hbargraph @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: hbargraph +# key: hb +# -- +hbargraph("${1:name}", ${2:min}, ${3:max})$0
\ No newline at end of file diff --git a/faust-mode/header b/faust-mode/header new file mode 100644 index 0000000..fa447b5 --- /dev/null +++ b/faust-mode/header @@ -0,0 +1,19 @@ +# -*- mode: snippet -*- +# name: header +# key: he +# -- +declare name "$1"; +declare version "${2:0.1}"; +declare author "$3"; +declare license "${4:$$ + (yas-choose-value '( + "AGPLv3" + "Apache" + "BSD 2-clause" + "BSD 3-clause" + "GPLv2" + "GPLv3" + "LGPLv3" + "MIT" + ))}"; +$0 diff --git a/faust-mode/hgroup b/faust-mode/hgroup new file mode 100644 index 0000000..30172a0 --- /dev/null +++ b/faust-mode/hgroup @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: hgroup +# key: hg +# -- +hgroup("${1:name}", ${2:expression})$0
\ No newline at end of file diff --git a/faust-mode/hslider b/faust-mode/hslider new file mode 100644 index 0000000..b3771d4 --- /dev/null +++ b/faust-mode/hslider @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: hslider +# key: hs +# -- +hslider("${1:name}", ${2:default}, ${3:min}, ${4:max}, ${5:step})$0
\ No newline at end of file diff --git a/faust-mode/import b/faust-mode/import new file mode 100644 index 0000000..e26b8d4 --- /dev/null +++ b/faust-mode/import @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: import +# key: im +# -- +import("$1.lib");$0
\ No newline at end of file diff --git a/faust-mode/nentry b/faust-mode/nentry new file mode 100644 index 0000000..5e2630f --- /dev/null +++ b/faust-mode/nentry @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: nentry +# key: ne +# -- +nentry("${1:name}", ${2:default}, ${3:min}, ${4:max}, ${5:step})$0
\ No newline at end of file diff --git a/faust-mode/par b/faust-mode/par new file mode 100644 index 0000000..7a1e071 --- /dev/null +++ b/faust-mode/par @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: par +# key: pa +# -- +par(${1:i}, ${2:Nr}, ${3:expression})$0
\ No newline at end of file diff --git a/faust-mode/process b/faust-mode/process new file mode 100644 index 0000000..d297fc5 --- /dev/null +++ b/faust-mode/process @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: process +# key: pr +# -- +process = $1; +$0
\ No newline at end of file diff --git a/faust-mode/processx b/faust-mode/processx new file mode 100644 index 0000000..4fc819c --- /dev/null +++ b/faust-mode/processx @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: processx +# key: px +# -- +process(${1:x}) = ${2:expression}($1);
\ No newline at end of file diff --git a/faust-mode/prod b/faust-mode/prod new file mode 100644 index 0000000..d552bf6 --- /dev/null +++ b/faust-mode/prod @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: prod +# key: mu +# -- +prod(${1:i}, ${2:Nr}, ${3:expression})$0
\ No newline at end of file diff --git a/faust-mode/rule b/faust-mode/rule new file mode 100644 index 0000000..b7ac187 --- /dev/null +++ b/faust-mode/rule @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: rule +# key: ru +# -- + (${1:pattern}) => ${2:expression}; +$0
\ No newline at end of file diff --git a/faust-mode/seq b/faust-mode/seq new file mode 100644 index 0000000..8c3651f --- /dev/null +++ b/faust-mode/seq @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: seq +# key: se +# -- +seq(${1:i}, ${2:Nr}, ${3:expression})$0
\ No newline at end of file diff --git a/faust-mode/sum b/faust-mode/sum new file mode 100644 index 0000000..60c69f2 --- /dev/null +++ b/faust-mode/sum @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: sum +# key: su +# -- +sum(${1:i}, ${2:Nr}, ${3:expression})$0
\ No newline at end of file diff --git a/faust-mode/tgroup b/faust-mode/tgroup new file mode 100644 index 0000000..753e91f --- /dev/null +++ b/faust-mode/tgroup @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: tgroup +# key: tg +# -- +tgroup("${1:name}", ${2:expression})$0
\ No newline at end of file diff --git a/faust-mode/vbargraph b/faust-mode/vbargraph new file mode 100644 index 0000000..814beae --- /dev/null +++ b/faust-mode/vbargraph @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: vbargraph +# key: vb +# -- +vbargraph("${1:name}", ${2:min}, ${3:max})$0
\ No newline at end of file diff --git a/faust-mode/vgroup b/faust-mode/vgroup new file mode 100644 index 0000000..8ec703a --- /dev/null +++ b/faust-mode/vgroup @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: vgroup +# key: vg +# -- +vgroup("${1:name}", ${2:expression})$0
\ No newline at end of file diff --git a/faust-mode/vslider b/faust-mode/vslider new file mode 100644 index 0000000..ed60890 --- /dev/null +++ b/faust-mode/vslider @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: vslider +# key: vs +# -- +vslider("${1:name}", ${2:default}, ${3:min}, ${4:max}, ${5:step})$0
\ No newline at end of file diff --git a/faust-mode/with b/faust-mode/with new file mode 100644 index 0000000..3c9feda --- /dev/null +++ b/faust-mode/with @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: with +# key: wi +# -- +with { + ${1:expression} +}; +$0
\ No newline at end of file diff --git a/fundamental-mode/.yas-setup.el b/fundamental-mode/.yas-setup.el deleted file mode 100644 index cc4a171..0000000 --- a/fundamental-mode/.yas-setup.el +++ /dev/null @@ -1,8 +0,0 @@ -(defun ca-all-asscs (asslist query) - "returns a list of all corresponding values (like rassoc)" - (cond - ((null asslist) nil) - (t - (if (equal (cdr (car asslist)) query) - (cons (car (car asslist)) (ca-all-asscs (cdr asslist) query)) - (ca-all-asscs (cdr asslist) query))))) diff --git a/go-mode/func b/go-mode/func index 3b2e0f5..9b1649f 100644 --- a/go-mode/func +++ b/go-mode/func @@ -2,7 +2,7 @@ # name: func # key: func # -- -// +// $1 ${4:...} func ${1:name}(${2:args}) $3 { $0 }
\ No newline at end of file diff --git a/go-mode/parallel_benchmark b/go-mode/parallel_benchmark new file mode 100644 index 0000000..cde7301 --- /dev/null +++ b/go-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/haskell-mode/case b/haskell-mode/case index 4a4f6cb..196ab8a 100644 --- a/haskell-mode/case +++ b/haskell-mode/case @@ -1,6 +1,7 @@ # -*- mode: snippet -*- # name: case # key: case +# expand-env: ((yas-indent-line 'fixed)) # -- case ${1:var} of ${2:cond} -> ${3:value} diff --git a/haskell-mode/new class b/haskell-mode/new class index 2206efa..4fcca62 100644 --- a/haskell-mode/new class +++ b/haskell-mode/new class @@ -1,6 +1,7 @@ # -*- mode: snippet -*- # name: new class # key: class +# expand-env: ((yas-indent-line 'fixed)) # -- class ${1:Class Name} where $0
\ No newline at end of file diff --git a/haskell-mode/pragma b/haskell-mode/pragma index 6532151..f5f1b01 100644 --- a/haskell-mode/pragma +++ b/haskell-mode/pragma @@ -1,5 +1,5 @@ # -*- mode: snippet -*- # name: pragma -# key: { +# key: prag # -- {-# ${1:PRAGMA} #-}
\ No newline at end of file diff --git a/html-mode/doctype.html5 b/html-mode/doctype.html5 new file mode 100644 index 0000000..a892472 --- /dev/null +++ b/html-mode/doctype.html5 @@ -0,0 +1,4 @@ +#name : Doctype HTML 5 +#group : meta +# -- +<!DOCTYPE html> diff --git a/html-mode/doctype.xhml1 b/html-mode/doctype.xhtml1 index 5d95e07..5d95e07 100644 --- a/html-mode/doctype.xhml1 +++ b/html-mode/doctype.xhtml1 diff --git a/html-mode/link.import b/html-mode/link.import new file mode 100644 index 0000000..30b8fd3 --- /dev/null +++ b/html-mode/link.import @@ -0,0 +1,4 @@ +#contributor : Vikrant Rathore <vikrant@vyomtech.com> +#name : <link rel="import" /> +# -- +<link rel="import" href="${1:url}" /> diff --git a/js-mode/function b/js-mode/function index 96621b6..8b36e86 100644 --- a/js-mode/function +++ b/js-mode/function @@ -2,6 +2,6 @@ # name: function # key: f # -- -function ${1:name}(${2:arg}) { +function${1: ${2:name}}(${3:arg}) { $0 }
\ No newline at end of file diff --git a/js-mode/multiline-comment b/js-mode/multiline-comment new file mode 100644 index 0000000..1d34aed --- /dev/null +++ b/js-mode/multiline-comment @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +#name : multiline-comment +#key: /** +# -- +/** + * $0 + */
\ No newline at end of file diff --git a/js-mode/param-comment b/js-mode/param-comment new file mode 100644 index 0000000..e3c9d27 --- /dev/null +++ b/js-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/js-mode/return-comment b/js-mode/return-comment new file mode 100644 index 0000000..fc5dadf --- /dev/null +++ b/js-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/js-mode/type-inline-comment b/js-mode/type-inline-comment new file mode 100644 index 0000000..ccc9430 --- /dev/null +++ b/js-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/js-mode/type-multiline-comment b/js-mode/type-multiline-comment new file mode 100644 index 0000000..92d7482 --- /dev/null +++ b/js-mode/type-multiline-comment @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +#name: type-inline-comment +#key: *ty +#condition: (= (js2-node-type (js2-node-at-point)) js2-COMMENT) +# -- +* @type {${type}}
\ No newline at end of file diff --git a/js2-mode b/js2-mode deleted file mode 120000 index 6d4bce1..0000000 --- a/js2-mode +++ /dev/null @@ -1 +0,0 @@ -js-mode
\ No newline at end of file diff --git a/js2-mode/.yas-parents b/js2-mode/.yas-parents new file mode 100644 index 0000000..27dab30 --- /dev/null +++ b/js2-mode/.yas-parents @@ -0,0 +1 @@ +js-mode diff --git a/js3-mode/.yas-parents b/js3-mode/.yas-parents new file mode 100644 index 0000000..27dab30 --- /dev/null +++ b/js3-mode/.yas-parents @@ -0,0 +1 @@ +js-mode diff --git a/latex-mode/article b/latex-mode/article new file mode 100644 index 0000000..ec46c9a --- /dev/null +++ b/latex-mode/article @@ -0,0 +1,11 @@ +# -*- mode: snippet -*- +# name: full template of article class +# key: article +# -- +\documentclass[${1:options}]{article} + +\author{$3} + +\begin{document} +$0 +\end{document} diff --git a/latex-mode/documentclass b/latex-mode/documentclass new file mode 100644 index 0000000..9c03a21 --- /dev/null +++ b/latex-mode/documentclass @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: documentclass +# key: doc +# -- +\documentclass[${1:options}]{$2} +$0 diff --git a/latex-mode/moderncv b/latex-mode/moderncv new file mode 100644 index 0000000..8de90bb --- /dev/null +++ b/latex-mode/moderncv @@ -0,0 +1,15 @@ +# -*- mode: snippet -*- +# name: full template of moderncv class +# key: moderncv +# -- +\documentclass[${1:options}]{moderncv} + +\firstname{$3} +\familyname{$4} + +\moderncvstyle{${5:casual}} +\moderncvcolor{${6:blue}} + +\begin{document} +$0 +\end{document} diff --git a/latex-mode/moderncv-cvcomputer b/latex-mode/moderncv-cvcomputer new file mode 100644 index 0000000..d73a6f0 --- /dev/null +++ b/latex-mode/moderncv-cvcomputer @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: moderncv-cvcomputer +# key: cvcomp +# -- +\cvcomputer{${1:category}}{${2:programs}}{${3:category}}{${3:programs}} +$0 diff --git a/latex-mode/moderncv-cventry b/latex-mode/moderncv-cventry new file mode 100644 index 0000000..8a7b656 --- /dev/null +++ b/latex-mode/moderncv-cventry @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: moderncv-cventry +# key: cventry +# -- +\cventry{${1:year}}{${2:job}}{${3:employer}}{${4:city}}{${5:description}} +$0 diff --git a/latex-mode/moderncv-cvlanguage b/latex-mode/moderncv-cvlanguage new file mode 100644 index 0000000..c9dd65b --- /dev/null +++ b/latex-mode/moderncv-cvlanguage @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: moderncv-cvlanguage +# key: cvlang +# -- +\cvlanguage{${1:language}}{${2:skill-level}}{${3:comment}} +$0 diff --git a/latex-mode/moderncv-cvline b/latex-mode/moderncv-cvline new file mode 100644 index 0000000..a193fed --- /dev/null +++ b/latex-mode/moderncv-cvline @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: moderncv-cvline +# key: cvline +# -- +\cvline{${1:hobby}}{${2:Description}} +$0 diff --git a/latex-mode/moderncv-cvlistdoubleitem b/latex-mode/moderncv-cvlistdoubleitem new file mode 100644 index 0000000..41f86c6 --- /dev/null +++ b/latex-mode/moderncv-cvlistdoubleitem @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: moderncv-cvlistdoubleitem +# key: cvditem +# -- +\cvlistdoubleitem{${1:item}}{${2:item}} +$0 diff --git a/latex-mode/moderncv-cvlistitem b/latex-mode/moderncv-cvlistitem new file mode 100644 index 0000000..d50fc8c --- /dev/null +++ b/latex-mode/moderncv-cvlistitem @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: moderncv-cvlistitem +# key: cvitem +# -- +\cvlistitem{${1:item}} +$0 diff --git a/makefile-gmake-mode/abspath b/makefile-gmake-mode/abspath new file mode 100644 index 0000000..e02c55c --- /dev/null +++ b/makefile-gmake-mode/abspath @@ -0,0 +1,6 @@ +# -*- mode: snippet; require-final-newline: nil -*- +# name: abspath +# contributor: gbalats +# key: abs +# -- +\$(abspath ${1:\$(${2:paths})})$0
\ No newline at end of file diff --git a/makefile-gmake-mode/addprefix b/makefile-gmake-mode/addprefix new file mode 100644 index 0000000..2edc1e3 --- /dev/null +++ b/makefile-gmake-mode/addprefix @@ -0,0 +1,6 @@ +# -*- mode: snippet; require-final-newline: nil -*- +# name: addprefix +# contributor: gbalats +# key: ap +# -- +\$(addprefix ${1:\$(${2:dir})/},${3:\$(${4:items})})$0
\ No newline at end of file diff --git a/makefile-gmake-mode/addsuffix b/makefile-gmake-mode/addsuffix new file mode 100644 index 0000000..6a3ebe4 --- /dev/null +++ b/makefile-gmake-mode/addsuffix @@ -0,0 +1,6 @@ +# -*- mode: snippet; require-final-newline: nil -*- +# name: addsuffix +# contributor: gbalats +# key: as +# -- +\$(addsuffix ${1:.suffix},${2:\$(${3:items})})$0
\ No newline at end of file diff --git a/makefile-gmake-mode/dir b/makefile-gmake-mode/dir new file mode 100644 index 0000000..bc3561b --- /dev/null +++ b/makefile-gmake-mode/dir @@ -0,0 +1,6 @@ +# -*- mode: snippet; require-final-newline: nil -*- +# name: dir +# contributor: gbalats +# key: d +# -- +\$(dir ${1:\$(${2:paths})})$0
\ No newline at end of file diff --git a/makefile-gmake-mode/make b/makefile-gmake-mode/make new file mode 100644 index 0000000..16c49ce --- /dev/null +++ b/makefile-gmake-mode/make @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: make +# contributor: gbalats +# key: make +# -- +\$(MAKE) --directory=${1:\$@} +$0
\ No newline at end of file diff --git a/makefile-gmake-mode/notdir b/makefile-gmake-mode/notdir new file mode 100644 index 0000000..d5e82d5 --- /dev/null +++ b/makefile-gmake-mode/notdir @@ -0,0 +1,6 @@ +# -*- mode: snippet; require-final-newline: nil -*- +# name: notdir +# contributor: gbalats +# key: nd +# -- +\$(notdir ${1:\$(${2:paths})})$0
\ No newline at end of file diff --git a/makefile-gmake-mode/shell b/makefile-gmake-mode/shell new file mode 100644 index 0000000..b550475 --- /dev/null +++ b/makefile-gmake-mode/shell @@ -0,0 +1,5 @@ +# -*- mode: snippet; require-final-newline: nil -*- +# name: shell +# key: sh +# -- +\$(shell ${1:command})$0
\ No newline at end of file diff --git a/makefile-gmake-mode/special b/makefile-gmake-mode/special new file mode 100644 index 0000000..775021f --- /dev/null +++ b/makefile-gmake-mode/special @@ -0,0 +1,6 @@ +# -*- mode: snippet; require-final-newline: nil -*- +# name: special targets +# contributor: gbalats +# key: . +# -- +.${1:PHONY$(upcase yas-text)}: $0
\ No newline at end of file diff --git a/makefile-gmake-mode/template b/makefile-gmake-mode/template new file mode 100644 index 0000000..285624d --- /dev/null +++ b/makefile-gmake-mode/template @@ -0,0 +1,10 @@ +# -*- mode: snippet -*- +# name: template +# contributor: gbalats +# binding: C-c C-t +# -- +define ${1:PROGRAM$(upcase yas-text)}_template +$0 +endef + +\$(foreach ${2:${1:$(downcase yas-text)}},\$(${3:$1S}),\$(eval \$(call $1_template,\$($2))))
\ No newline at end of file diff --git a/makefile-mode/clean b/makefile-mode/clean new file mode 100644 index 0000000..7ade5eb --- /dev/null +++ b/makefile-mode/clean @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# name: clean +# contributor: gbalats +# expand-env: ((yas-indent-line 'fixed)) +# key: cl +# -- +clean: + ${1:rm -r ${2:\$(${3:OUTDIR})}} +$0 diff --git a/markdown-mode/highlight b/markdown-mode/highlight new file mode 100644 index 0000000..f1bce71 --- /dev/null +++ b/markdown-mode/highlight @@ -0,0 +1,6 @@ +#name : Highlight +#contributor: nguyenvinhlinh <nguyenvinhlinh93@gmail.com> +# -- +{% highlight ${1:language} %} +${0:content} +{% endhighlight %}
\ No newline at end of file diff --git a/nix-mode/buildPhase b/nix-mode/buildPhase new file mode 100644 index 0000000..c912f41 --- /dev/null +++ b/nix-mode/buildPhase @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: buildPhase +# key: bp +# -- +buildPhase= '' +$1 +''; +$0
\ No newline at end of file diff --git a/nix-mode/checkPhase b/nix-mode/checkPhase new file mode 100644 index 0000000..76622fa --- /dev/null +++ b/nix-mode/checkPhase @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: checkPhase +# key: ch +# -- +checkPhase= '' +$1 +''; +$0
\ No newline at end of file diff --git a/nix-mode/configurePhase b/nix-mode/configurePhase new file mode 100644 index 0000000..c07bf09 --- /dev/null +++ b/nix-mode/configurePhase @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: configurePhase +# key: cp +# -- +configurePhase= '' +$1 +''; +$0
\ No newline at end of file diff --git a/nix-mode/distPhase b/nix-mode/distPhase new file mode 100644 index 0000000..88524f6 --- /dev/null +++ b/nix-mode/distPhase @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: distPhase +# key: dp +# -- +distPhase= '' +$1 +''; +$0
\ No newline at end of file diff --git a/nix-mode/fixPhase b/nix-mode/fixPhase new file mode 100644 index 0000000..9db5bb4 --- /dev/null +++ b/nix-mode/fixPhase @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: fixPhase +# key: fp +# -- +fixPhase= '' +$1 +''; +$0
\ No newline at end of file diff --git a/nix-mode/installCheckPhase b/nix-mode/installCheckPhase new file mode 100644 index 0000000..b017621 --- /dev/null +++ b/nix-mode/installCheckPhase @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: installCheckPhase +# key: ic +# -- +installCheckPhase= '' +$1 +''; +$0
\ No newline at end of file diff --git a/nix-mode/installPhase b/nix-mode/installPhase new file mode 100644 index 0000000..f30bfb2 --- /dev/null +++ b/nix-mode/installPhase @@ -0,0 +1,12 @@ +# -*- mode: snippet -*- +# name: installPhase +# key: ip +# -- +installPhase= '' +${1: mkdir -p \$out/bin + for f in \$(find . -executable -type f); + do + cp \$f \$out/bin/ + done} +''; +$0
\ No newline at end of file diff --git a/nix-mode/package_github b/nix-mode/package_github new file mode 100644 index 0000000..5a7230e --- /dev/null +++ b/nix-mode/package_github @@ -0,0 +1,56 @@ +# -*- mode: snippet -*- +# name: package github +# key: pg +# -- +{ stdenv, fetchFromGitHub$1 }: +stdenv.mkDerivation rec { + name = "$2-\$\{version\}"; + version = "$3"; + + src = fetchFromGitHub { + owner = "$4"; + repo = "$2"; + rev = "${5:v\$\{version\}}"; + sha256 = "$6"; + }; + + buildInputs = [ $1]; + + meta = { + description = "$7"; + homepage = https://${8:github.com/$4/$2}; + + license = stdenv.lib.licenses.${9:$$ + (yas-choose-value '( + "agpl3" + "asl20" + "bsd2" + "bsd3" + "gpl2" + "gpl3" + "lgpl3" + "mit" + ))}; + maintainers = [ stdenv.lib.maintainers.$10 ]; + platforms = stdenv.lib.platforms.${11:$$ + (yas-choose-value '( + "gnu" + "linux" + "darwin" + "freebsd" + "openbsd" + "netbsd" + "cygwin" + "illumos" + "unix" + "all" + "none" + "allBut" + "mesaPlatforms" + "x86" + "i686" + "arm" + "mips" + ))}; + }; +} diff --git a/nix-mode/package_url b/nix-mode/package_url new file mode 100644 index 0000000..5461e42 --- /dev/null +++ b/nix-mode/package_url @@ -0,0 +1,54 @@ +# -*- mode: snippet -*- +# name: package url +# key: pu +# -- +{ stdenv, fetchurl$1}: + +stdenv.mkDerivation rec { + version = "$2"; + name = "$3-\$\{version\}"; + + src = fetchurl { + url = "$4"; + sha256 = "$5"; + }; + + buildInputs = [ $1 ]; + + meta = { + description = "$6"; + homepage = https://$7; + license = stdenv.lib.licenses.${8:$$ + (yas-choose-value '( + "agpl3" + "asl20" + "bsd2" + "bsd3" + "gpl2" + "gpl3" + "lgpl3" + "mit" + ))}; + maintainers = [ stdenv.lib.maintainers.$9 ]; + platforms = stdenv.lib.platforms.${10:$$ + (yas-choose-value '( + "gnu" + "linux" + "darwin" + "freebsd" + "openbsd" + "netbsd" + "cygwin" + "illumos" + "unix" + "all" + "none" + "allBut" + "mesaPlatforms" + "x86" + "i686" + "arm" + "mips" + ))}; + }; +} diff --git a/nix-mode/patchPhase b/nix-mode/patchPhase new file mode 100644 index 0000000..329f527 --- /dev/null +++ b/nix-mode/patchPhase @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: patchPhase +# key: pp +# -- +patchPhase = '' + $1 +''; +$0
\ No newline at end of file diff --git a/nix-mode/phases b/nix-mode/phases new file mode 100644 index 0000000..50326f2 --- /dev/null +++ b/nix-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/nix-mode/unpackPhase b/nix-mode/unpackPhase new file mode 100644 index 0000000..558dbe8 --- /dev/null +++ b/nix-mode/unpackPhase @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: unpackPhase +# key: up +# -- +unpackPhase = '' + $1 +''; +$0 diff --git a/org-mode/code b/org-mode/code deleted file mode 100644 index 89a94ff..0000000 --- a/org-mode/code +++ /dev/null @@ -1,7 +0,0 @@ -# -*- mode: snippet -*- -# name: code -# key: code_ -# -- -#+begin_${1:lang} ${2:options} -$0 -#+end_$1
\ No newline at end of file diff --git a/org-mode/uml b/org-mode/uml new file mode 100644 index 0000000..304367e --- /dev/null +++ b/org-mode/uml @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +#name : uml +#key : uml +#contributor : Robert O'Connor +# -- +#+BEGIN_UML +$1 +#+END_UML diff --git a/prog-mode/.yas-setup.el b/prog-mode/.yas-setup.el index 03d07cf..22a8168 100644 --- a/prog-mode/.yas-setup.el +++ b/prog-mode/.yas-setup.el @@ -1,2 +1,39 @@ +(require 'yasnippet) + (defun yas-with-comment (str) (format "%s%s%s" comment-start str comment-end)) + +;; whitespace removing functions from Magnar Sveen ;;;;;;;;;;;;;;;;;;;;;;;;;;;; +(defun yas-s-trim-left (s) + "Remove whitespace at the beginning of S." + (if (string-match "\\`[ \t\n\r]+" s) + (replace-match "" t t s) + s)) + +(defun yas-s-trim-right (s) + "Remove whitespace at the end of S." + (if (string-match "[ \t\n\r]+\\'" s) + (replace-match "" t t s) + s)) + +(defun yas-s-trim (s) + "Remove whitespace at the beginning and end of S." + (yas-s-trim-left (yas-s-trim-right s))) + + +(defun yas-string-reverse (str) + "Reverse a string STR manually to be compatible with emacs versions < 25." + (apply #'string + (reverse + (string-to-list str)))) + +(defun yas-trimmed-comment-start () + "This function returns `comment-start' trimmed by whitespaces." + (yas-s-trim comment-start)) + +(defun yas-trimmed-comment-end () + "This function returns `comment-end' trimmed by whitespaces if `comment-end' is not empty. +Otherwise the reversed output of function `yas-trimmed-comment-start' is returned." + (if (eq (length comment-end) 0) + (yas-string-reverse (yas-trimmed-comment-start)) + (yas-s-trim comment-end))) diff --git a/prog-mode/comment b/prog-mode/comment new file mode 100644 index 0000000..edd53e9 --- /dev/null +++ b/prog-mode/comment @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# contributor: sh-ow <sh-ow@users.noreply.github.com> +# name: comment +# key: co +# -- +${1:$(yas-trimmed-comment-start)} ${1:comment}${1:$(unless (eq (length comment-end) 0) (concat " " (yas-trimmed-comment-end)))}$0
\ No newline at end of file diff --git a/prog-mode/commentblock b/prog-mode/commentblock new file mode 100644 index 0000000..ba61f61 --- /dev/null +++ b/prog-mode/commentblock @@ -0,0 +1,36 @@ +# -*- mode: snippet -*- +# contributor: sh-ow <sh-ow@users.noreply.github.com> +# name: commentblock +# key: cob +# -- +${1:$(let* ((col (current-column)) + (str "") + (lastcom (substring (yas-trimmed-comment-start) -1)) + (start (yas-trimmed-comment-start)) + (end (yas-trimmed-comment-end)) + (over (- (+ (string-width yas-text) (length start) (length end) col) 77))) + (while (< (length str) (+ (- 79 (length start) (length end) col) (if (> over 0) over 0))) + (setq str (concat str lastcom))) + (concat start str end))} +${1:$(let* ((col (current-column)) + (str "") + (start (yas-trimmed-comment-start)) + (end (yas-trimmed-comment-end))) + (while (< (length str) (ffloor (/ (- 78.0 (+ col (length start) (string-width yas-text) (length end))) 2.0))) + (setq str (concat str " "))) + (concat start str))} ${1:comment} ${1:$(let* ((col (current-column)) + (str "") + (start (yas-trimmed-comment-start)) + (end (yas-trimmed-comment-end))) + (while (< (length str) (- 79.0 (if (eq (mod (string-width yas-text) 2) 1) (- col 1) col) (length end))) + (setq str (concat str " "))) + (concat str end))} +${1:$(let* ((col (current-column)) + (str "") + (lastcom (substring (yas-trimmed-comment-start) -1)) + (start (yas-trimmed-comment-start)) + (end (yas-trimmed-comment-end)) + (over (- (+ (string-width yas-text) (length start) (length end) col) 77))) + (while (< (length str) (+ (- 79 (length start) (length end) col) (if (> over 0) over 0))) + (setq str (concat str lastcom))) + (concat start str end))}$0
\ No newline at end of file diff --git a/prog-mode/commentline b/prog-mode/commentline new file mode 100644 index 0000000..0b0edff --- /dev/null +++ b/prog-mode/commentline @@ -0,0 +1,13 @@ +# -*- mode: snippet -*- +# contributor: sh-ow <sh-ow@users.noreply.github.com> +# name: commentline +# key: col +# -- +${1:$(yas-trimmed-comment-start)} ${1:comment} ${1:$(let* ((str "") + (curr (current-column)) + (start (yas-trimmed-comment-start)) + (lastcom (substring start -1)) + (end (yas-trimmed-comment-end))) + (while (< (length str) (- 79 (+ curr (length end)))) + (setq str (concat str lastcom))) + (concat str end))}$0
\ No newline at end of file diff --git a/python-mode/.yas-setup.el b/python-mode/.yas-setup.el index 6635232..1af8703 100644 --- a/python-mode/.yas-setup.el +++ b/python-mode/.yas-setup.el @@ -1,3 +1,6 @@ +(require 'yasnippet) +(defvar yas-text) + (defun python-split-args (arg-string) "Split a python argument string into ((name, default)..) tuples" (mapcar (lambda (x) @@ -18,5 +21,19 @@ (unless (string= formatted-args "") (mapconcat 'identity (list "Keyword Arguments:" formatted-args) indent)))) +(defun python-args-to-docstring-numpy () + "return docstring format for the python arguments in yas-text" + (let* ((args (python-split-args yas-text)) + (format-arg (lambda(arg) + (concat (nth 0 arg) " : " (if (nth 1 arg) ", optional") "\n"))) + (formatted-params (mapconcat format-arg args "\n")) + (formatted-ret (mapconcat format-arg (list (list "out")) "\n"))) + (unless (string= formatted-params "") + (mapconcat 'identity + (list "\nParameters\n----------" formatted-params + "\nReturns\n-------" formatted-ret) + "\n")))) + + (add-hook 'python-mode-hook '(lambda () (set (make-local-variable 'yas-indent-line) 'fixed))) diff --git a/python-mode/all b/python-mode/all index 062e31a..b92c4dc 100644 --- a/python-mode/all +++ b/python-mode/all @@ -1,6 +1,6 @@ # -*- mode: snippet -*- # name: all -# key: a +# key: all # -- __all__ = [ $0 diff --git a/python-mode/ass b/python-mode/assert index ec82efe..ec82efe 100644 --- a/python-mode/ass +++ b/python-mode/assert diff --git a/python-mode/cls b/python-mode/cls index 9f8b27c..f857cdb 100644 --- a/python-mode/cls +++ b/python-mode/cls @@ -1,5 +1,5 @@ # -*- mode: snippet -*- -# name: cls +# name: class # key: cls # group: object oriented # -- diff --git a/python-mode/function_docstring_numpy b/python-mode/function_docstring_numpy new file mode 100644 index 0000000..00ea351 --- /dev/null +++ b/python-mode/function_docstring_numpy @@ -0,0 +1,11 @@ +# -*- mode: snippet -*- +# contributor: Egor Panfilov <egor.v.panfilov[at]gmail[dot]com> +# name: function_docstring_numpy +# key: fdn +# group: definitions +# -- +def ${1:name}($2): + \"\"\"$3 + ${2:$(python-args-to-docstring-numpy)} + \"\"\" + $0
\ No newline at end of file diff --git a/python-mode/pl b/python-mode/pl new file mode 100644 index 0000000..f0fdd05 --- /dev/null +++ b/python-mode/pl @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: Import pyplot +# key: plt +# group : general +# -- +import matplotlib.pyplot as plt +$0 diff --git a/python-mode/scls b/python-mode/scls new file mode 100644 index 0000000..4a10e28 --- /dev/null +++ b/python-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/rst-mode/chapter b/rst-mode/chapter new file mode 100644 index 0000000..c5e3483 --- /dev/null +++ b/rst-mode/chapter @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name : Chapter title +# key: chap +# -- +${1:Chapter} +${1:$(make-string (string-width yas-text) ?\=)} + +$0 diff --git a/rst-mode/section b/rst-mode/section new file mode 100644 index 0000000..1739ad8 --- /dev/null +++ b/rst-mode/section @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name : Section title +# key: sec +# -- +${1:Section} +${1:$(make-string (string-width yas-text) ?\-)} + +$0 diff --git a/rst-mode/title b/rst-mode/title new file mode 100644 index 0000000..88c32f8 --- /dev/null +++ b/rst-mode/title @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# name : Document title +# key: tit +# -- +${1:$(make-string (string-width yas-text) ?\=)} +${1:Title} +${1:$(make-string (string-width yas-text) ?\=)} + +$0 diff --git a/ruby-mode/Enum b/ruby-mode/Enum new file mode 100644 index 0000000..9804bd6 --- /dev/null +++ b/ruby-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/ruby-mode/inc b/ruby-mode/inc new file mode 100644 index 0000000..bfcd94e --- /dev/null +++ b/ruby-mode/inc @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: include Module +# key: inc +# group: general +# -- +include ${1:Module} +$0 diff --git a/ruby-mode/map b/ruby-mode/map new file mode 100644 index 0000000..dbe4dbc --- /dev/null +++ b/ruby-mode/map @@ -0,0 +1,4 @@ +#name : map { |...| ... } +#group : collections +# -- +map { |${e}| $0 }
\ No newline at end of file diff --git a/ruby-mode/mod b/ruby-mode/mod new file mode 100644 index 0000000..e90c322 --- /dev/null +++ b/ruby-mode/mod @@ -0,0 +1,13 @@ +# name: module ... end +# contributor: hitesh <hitesh.jasani@gmail.com>, jimeh <contact@jimeh.me> +# 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/ruby-mode/red b/ruby-mode/red new file mode 100644 index 0000000..6318e0b --- /dev/null +++ b/ruby-mode/red @@ -0,0 +1,4 @@ +#name : reduce(...) { |...| ... } +#group : collections +# -- +reduce(${1:0}) { |${2:accumulator}, ${3:element}| $0 } diff --git a/rust-mode/allow b/rust-mode/allow new file mode 100644 index 0000000..c30c1e8 --- /dev/null +++ b/rust-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/rust-mode/allow! b/rust-mode/allow! new file mode 100644 index 0000000..cfb0c7d --- /dev/null +++ b/rust-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/rust-mode/assert b/rust-mode/assert new file mode 100644 index 0000000..d1252d0 --- /dev/null +++ b/rust-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/rust-mode/asserteq b/rust-mode/asserteq new file mode 100644 index 0000000..7bfafd2 --- /dev/null +++ b/rust-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/rust-mode/case b/rust-mode/case new file mode 100644 index 0000000..9ea6609 --- /dev/null +++ b/rust-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/rust-mode/cfg b/rust-mode/cfg new file mode 100644 index 0000000..583e021 --- /dev/null +++ b/rust-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/rust-mode/cfg= b/rust-mode/cfg= new file mode 100644 index 0000000..b01a458 --- /dev/null +++ b/rust-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/rust-mode/closure b/rust-mode/closure new file mode 100644 index 0000000..89c2d01 --- /dev/null +++ b/rust-mode/closure @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: closure +# key: || +# -- +|${1:arguments}| { + $0 +} diff --git a/rust-mode/deny b/rust-mode/deny new file mode 100644 index 0000000..5b7f3d9 --- /dev/null +++ b/rust-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/rust-mode/deny! b/rust-mode/deny! new file mode 100644 index 0000000..c4c85c5 --- /dev/null +++ b/rust-mode/deny! @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: #![deny(lint)] +# key: deny! +# -- +#![deny(${1:lint})] diff --git a/rust-mode/derive b/rust-mode/derive new file mode 100644 index 0000000..581c86f --- /dev/null +++ b/rust-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/rust-mode/drop b/rust-mode/drop new file mode 100644 index 0000000..310d0ad --- /dev/null +++ b/rust-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 + } +}
\ No newline at end of file diff --git a/rust-mode/enum b/rust-mode/enum new file mode 100644 index 0000000..058aadc --- /dev/null +++ b/rust-mode/enum @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: enum Type { ... } +# key: enum +# -- +enum ${1:Type} { + $0 +}
\ No newline at end of file diff --git a/rust-mode/fn b/rust-mode/fn new file mode 100644 index 0000000..459fd49 --- /dev/null +++ b/rust-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/rust-mode/fnr b/rust-mode/fnr new file mode 100644 index 0000000..4a4db71 --- /dev/null +++ b/rust-mode/fnr @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: fn name() -> Type { ... } +# key: fnr +# -- +fn ${1:name}($2) -> ${3:Type} { + $0 +}
\ No newline at end of file diff --git a/rust-mode/fns b/rust-mode/fns new file mode 100644 index 0000000..6d2c828 --- /dev/null +++ b/rust-mode/fns @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: fn name(&self) -> Type; +# key: fns +# -- +fn ${1:name}(${2:&self}) -> ${3:Type};
\ No newline at end of file diff --git a/rust-mode/fnw b/rust-mode/fnw new file mode 100644 index 0000000..77bee6e --- /dev/null +++ b/rust-mode/fnw @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: fn name<T>(x: T) where T: Clone { ... } +# key: fnw +# -- +fn ${1:name}<${2:T}>(${3:x: T}) where ${4:T: Clone} { + $0 +}
\ No newline at end of file diff --git a/rust-mode/for b/rust-mode/for new file mode 100644 index 0000000..66dca09 --- /dev/null +++ b/rust-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/rust-mode/if b/rust-mode/if new file mode 100644 index 0000000..c793ace --- /dev/null +++ b/rust-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/rust-mode/ife b/rust-mode/ife new file mode 100644 index 0000000..c738d4b --- /dev/null +++ b/rust-mode/ife @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# name: if expression { ... } else { .. } +# key: ife +# -- +if ${1:expression} { + $0 +} else { + +}
\ No newline at end of file diff --git a/rust-mode/ifl b/rust-mode/ifl new file mode 100644 index 0000000..177a359 --- /dev/null +++ b/rust-mode/ifl @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: if let pattern = expression { ... }; +# key: ifl +# -- +if let ${1:pattern} = ${2:expression} { $0 };
\ No newline at end of file diff --git a/rust-mode/impl b/rust-mode/impl new file mode 100644 index 0000000..2d90db9 --- /dev/null +++ b/rust-mode/impl @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: impl Type { ... } +# key: impl +# -- +impl ${1:Type} { + $0 +}
\ No newline at end of file diff --git a/rust-mode/implt b/rust-mode/implt new file mode 100644 index 0000000..54269df --- /dev/null +++ b/rust-mode/implt @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: impl Trait for Type { ... } +# key: implt +# -- +impl ${1:Trait} for ${2:Type} { + $0 +}
\ No newline at end of file diff --git a/rust-mode/let b/rust-mode/let new file mode 100644 index 0000000..9f603ea --- /dev/null +++ b/rust-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/rust-mode/letm b/rust-mode/letm new file mode 100644 index 0000000..b07d673 --- /dev/null +++ b/rust-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/rust-mode/lett b/rust-mode/lett new file mode 100644 index 0000000..10a7fa6 --- /dev/null +++ b/rust-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/rust-mode/lettm b/rust-mode/lettm new file mode 100644 index 0000000..9ceb8c3 --- /dev/null +++ b/rust-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/rust-mode/loop b/rust-mode/loop new file mode 100644 index 0000000..2285b75 --- /dev/null +++ b/rust-mode/loop @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: loop { ... } +# key: loop +# -- +loop { + $0 +}
\ No newline at end of file diff --git a/rust-mode/macro b/rust-mode/macro new file mode 100644 index 0000000..b07f748 --- /dev/null +++ b/rust-mode/macro @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: macro_rules! name { (..) => (..); } +# key: macro +# -- +macro_rules! ${1:name} { + ($2) => ($3); +}
\ No newline at end of file diff --git a/rust-mode/main b/rust-mode/main new file mode 100644 index 0000000..75ae143 --- /dev/null +++ b/rust-mode/main @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: fn main() { ... } +# key: main +# -- +fn main() { + $0 +}
\ No newline at end of file diff --git a/rust-mode/match b/rust-mode/match new file mode 100644 index 0000000..54b7c80 --- /dev/null +++ b/rust-mode/match @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: match expression { ... } +# key: match +# -- +match ${1:expression} { + $0 +}
\ No newline at end of file diff --git a/rust-mode/print b/rust-mode/print new file mode 100644 index 0000000..11ba7c8 --- /dev/null +++ b/rust-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/rust-mode/println b/rust-mode/println new file mode 100644 index 0000000..23bfe7c --- /dev/null +++ b/rust-mode/println @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: println!("{}", value); +# key: println +# -- +println!("${1:{}}", $2); diff --git a/rust-mode/spawn b/rust-mode/spawn new file mode 100644 index 0000000..6ed5c5e --- /dev/null +++ b/rust-mode/spawn @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: spawn(proc() { ... }); +# key: spawn +# -- +spawn(proc() { + $0 +}); diff --git a/rust-mode/static b/rust-mode/static new file mode 100644 index 0000000..eef8072 --- /dev/null +++ b/rust-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/rust-mode/struct b/rust-mode/struct new file mode 100644 index 0000000..1c2e4c8 --- /dev/null +++ b/rust-mode/struct @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: struct TypeName { .. } +# key: struct +# -- +struct ${1:TypeName} { + $0 +}
\ No newline at end of file diff --git a/rust-mode/test b/rust-mode/test new file mode 100644 index 0000000..5f4ab7f --- /dev/null +++ b/rust-mode/test @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: #[test] fn test_name() { .. } +# key: test +# -- +#[test] +fn ${1:test_name}() { + $0 +} diff --git a/rust-mode/testmod b/rust-mode/testmod new file mode 100644 index 0000000..8f6e112 --- /dev/null +++ b/rust-mode/testmod @@ -0,0 +1,13 @@ +# -*- mode: snippet -*- +# name: test module +# key: testmod +# -- +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn ${1:test_name}() { + $0 + } +} diff --git a/rust-mode/trait b/rust-mode/trait new file mode 100644 index 0000000..15ab201 --- /dev/null +++ b/rust-mode/trait @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: trait Type { ... } +# key: trait +# -- +trait ${1:Type} { + $0 +}
\ No newline at end of file diff --git a/rust-mode/type b/rust-mode/type new file mode 100644 index 0000000..584a089 --- /dev/null +++ b/rust-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/rust-mode/warn b/rust-mode/warn new file mode 100644 index 0000000..acf5c5c --- /dev/null +++ b/rust-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/rust-mode/warn! b/rust-mode/warn! new file mode 100644 index 0000000..2f4885d --- /dev/null +++ b/rust-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/rust-mode/while b/rust-mode/while new file mode 100644 index 0000000..2fa221a --- /dev/null +++ b/rust-mode/while @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: while expression { ... } +# key: while +# -- +while ${1:expression} { + $0 +}
\ No newline at end of file diff --git a/rust-mode/whilel b/rust-mode/whilel new file mode 100644 index 0000000..6cf9ac3 --- /dev/null +++ b/rust-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/scala-mode/act b/scala-mode/act deleted file mode 100644 index 931387c..0000000 --- a/scala-mode/act +++ /dev/null @@ -1,12 +0,0 @@ -# -*- mode: snippet -*- -#Author : Jonas Bonèr <jonas@jonasboner.com> -#name : def act = { ..} -# key: act -# -- -def act = { - loop { - react { - $0 - } - } -} diff --git a/scala-mode/act.arg b/scala-mode/act.arg deleted file mode 100644 index 5a382db..0000000 --- a/scala-mode/act.arg +++ /dev/null @@ -1,12 +0,0 @@ -# -*- mode: snippet -*- -#Author : Jonas Bonèr <jonas@jonasboner.com> -#name : def act(arg: T) = { ..} -# key: act -# -- -def act(${1:arg}: ${2:type}) = { - loop { - react { - $0 - } - } -}
\ No newline at end of file diff --git a/scala-mode/actor b/scala-mode/actor deleted file mode 100644 index 6dd647c..0000000 --- a/scala-mode/actor +++ /dev/null @@ -1,12 +0,0 @@ -# -*- mode: snippet -*- -#Author : Jonas Bonèr <jonas@jonasboner.com> -#name : val a = actor { ..} -# key: actor -# -- -val a = actor { - loop { - react { - $0 - } - } -}
\ No newline at end of file diff --git a/scala-mode/ano b/scala-mode/ano deleted file mode 100644 index 977cb35..0000000 --- a/scala-mode/ano +++ /dev/null @@ -1,6 +0,0 @@ -# -*- mode: snippet -*- -#Author : Jonas Bonèr <jonas@jonasboner.com> -#name : (args) => ... -# key: => -# -- -($1) => ${2:body} $0
\ No newline at end of file diff --git a/scala-mode/arr.new b/scala-mode/arr.new deleted file mode 100644 index 20a3f07..0000000 --- a/scala-mode/arr.new +++ /dev/null @@ -1,6 +0,0 @@ -# -*- mode: snippet -*- -#Author : Jonas Bonèr <jonas@jonasboner.com> -#name : Array[T](..) -# key: arr.new -# -- -Array[${1:value}](${2:args}) $0
\ No newline at end of file diff --git a/scala-mode/arr.val-new b/scala-mode/arr.val-new deleted file mode 100644 index 73bc1be..0000000 --- a/scala-mode/arr.val-new +++ /dev/null @@ -1,6 +0,0 @@ -# -*- mode: snippet -*- -#Author : Jonas Bonèr <jonas@jonasboner.com> -#name : val a = Array[T](..) -# key: arr.new -# -- -val ${1:arr} = Array[${2:value}](${3:args}) $0
\ No newline at end of file diff --git a/scala-mode/asof b/scala-mode/asof deleted file mode 100644 index c63d143..0000000 --- a/scala-mode/asof +++ /dev/null @@ -1,6 +0,0 @@ -# -*- mode: snippet -*- -#Author : Jonas Bonèr <jonas@jonasboner.com> -#name : asInstanceOf[T] -# key: asof -# -- -asInstanceOf[${1:type}] $0
\ No newline at end of file diff --git a/scala-mode/ass b/scala-mode/ass deleted file mode 100644 index 8c6a011..0000000 --- a/scala-mode/ass +++ /dev/null @@ -1,6 +0,0 @@ -# -*- mode: snippet -*- -#Author : Jonas Bonèr <jonas@jonasboner.com> -#name : assert(x === y) -# key: ass -# -- -assert(${1:x} === ${2:y}) $0
\ No newline at end of file diff --git a/scala-mode/ass.true b/scala-mode/ass.true deleted file mode 100644 index b2af602..0000000 --- a/scala-mode/ass.true +++ /dev/null @@ -1,6 +0,0 @@ -# -*- mode: snippet -*- -#Author : Jonas Bonèr <jonas@jonasboner.com> -#name : assert(true) -# key: ass -# -- -assert(true) $0
\ No newline at end of file diff --git a/scala-mode/at.author b/scala-mode/at.author deleted file mode 100644 index 476bd80..0000000 --- a/scala-mode/at.author +++ /dev/null @@ -1,6 +0,0 @@ -# -*- mode: snippet -*- -#Author : Anders Bach Nielsen <andersbach.nielsen@epfl.ch> -#name : @author name -# key: at.author -# -- -@author ${1:name} $0
\ No newline at end of file diff --git a/scala-mode/at.param b/scala-mode/at.param deleted file mode 100644 index 38a22b6..0000000 --- a/scala-mode/at.param +++ /dev/null @@ -1,6 +0,0 @@ -# -*- mode: snippet -*- -#Author : Anders Bach Nielsen <andersbach.nielsen@epfl.ch> -#name : @param name description -# key: at -# -- -@param ${1:name} ${2:description} $0
\ No newline at end of file diff --git a/scala-mode/at.return b/scala-mode/at.return deleted file mode 100644 index f8113b8..0000000 --- a/scala-mode/at.return +++ /dev/null @@ -1,6 +0,0 @@ -# -*- mode: snippet -*- -#Author : Anders Bach Nielsen <andersbach.nielsen@epfl.ch> -#name : @return description -# key: at -# -- -@return ${1:description} $0
\ No newline at end of file diff --git a/scala-mode/at.version b/scala-mode/at.version deleted file mode 100644 index 4bfe358..0000000 --- a/scala-mode/at.version +++ /dev/null @@ -1,6 +0,0 @@ -# -*- mode: snippet -*- -#Author : Anders Bach Nielsen <andersbach.nielsen@epfl.ch> -#name : @version number -# key: at -# -- -@version ${1:0.1} $0
\ No newline at end of file diff --git a/scala-mode/bang b/scala-mode/bang deleted file mode 100644 index 403f92e..0000000 --- a/scala-mode/bang +++ /dev/null @@ -1,6 +0,0 @@ -# -*- mode: snippet -*- -#Author : Jonas Bonèr <jonas@jonasboner.com> -#name : actor ! message -# key: ! -# -- -${1:actor} ! ${2:message} $0
\ No newline at end of file diff --git a/scala-mode/case b/scala-mode/case index 07bb83d..b16dcae 100644 --- a/scala-mode/case +++ b/scala-mode/case @@ -3,4 +3,4 @@ #name : case pattern => # key: case # -- -case ${1:pattern} => $0
\ No newline at end of file +case ${1:_} => $0
\ No newline at end of file diff --git a/scala-mode/case.match-all b/scala-mode/case.match-all deleted file mode 100644 index b3f61a8..0000000 --- a/scala-mode/case.match-all +++ /dev/null @@ -1,6 +0,0 @@ -# -*- mode: snippet -*- -#Author : Jonas Bonèr <jonas@jonasboner.com> -#name : case _ => -# key: case -# -- -case _ => $0
\ No newline at end of file diff --git a/scala-mode/cast b/scala-mode/cast deleted file mode 100644 index 0d9f957..0000000 --- a/scala-mode/cast +++ /dev/null @@ -1,6 +0,0 @@ -# -*- mode: snippet -*- -#Author : Jonas Bonèr <jonas@jonasboner.com> -#name : asInstanceOf[T] -# key: cast -# -- -asInstanceOf[${1:type}] $0
\ No newline at end of file diff --git a/scala-mode/cc b/scala-mode/cc index b7e0457..3eedbc7 100644 --- a/scala-mode/cc +++ b/scala-mode/cc @@ -1,6 +1,8 @@ # -*- mode: snippet -*- -#Author : Jonas Bonèr <jonas@jonasboner.com> +#Author : Sam Halliday #name : case class T(arg: A) # key: cc # -- -case class ${1:name}(${2:arg}: ${3:type}) $0
\ No newline at end of file +case class ${1:Name}( + ${2:arg}: ${3:Type} +)
\ No newline at end of file diff --git a/scala-mode/cl b/scala-mode/cl deleted file mode 100644 index 6ef5f41..0000000 --- a/scala-mode/cl +++ /dev/null @@ -1,8 +0,0 @@ -# -*- mode: snippet -*- -#Author : Jonas Bonèr <jonas@jonasboner.com> -#name : class T { .. } -# key: cl -# -- -class ${1:name} { - $0 -}
\ No newline at end of file diff --git a/scala-mode/cl.abs b/scala-mode/cl.abs deleted file mode 100644 index 6865f31..0000000 --- a/scala-mode/cl.abs +++ /dev/null @@ -1,8 +0,0 @@ -# -*- mode: snippet -*- -#Author : Jonas Bonèr <jonas@jonasboner.com> -#name : abstract class T { .. } -# key: cl -# -- -abstract class ${1:name} { - $0 -}
\ No newline at end of file diff --git a/scala-mode/cl.abs-arg b/scala-mode/cl.abs-arg deleted file mode 100644 index 3c71147..0000000 --- a/scala-mode/cl.abs-arg +++ /dev/null @@ -1,8 +0,0 @@ -# -*- mode: snippet -*- -#Author : Jonas Bonèr <jonas@jonasboner.com> -#name : abstract class T(args) { .. } -# key: cl -# -- -abstract class ${1:name}(${2:args}) { - $0 -}
\ No newline at end of file diff --git a/scala-mode/cl.arg b/scala-mode/cl.arg deleted file mode 100644 index e5432c7..0000000 --- a/scala-mode/cl.arg +++ /dev/null @@ -1,8 +0,0 @@ -# -*- mode: snippet -*- -#Author : Jonas Bonèr <jonas@jonasboner.com> -#name : class T(args) { .. } -# key: cl -# -- -class ${1:name}(${2:args}) { - $0 -}
\ No newline at end of file diff --git a/scala-mode/clof b/scala-mode/clof deleted file mode 100644 index 4335b0f..0000000 --- a/scala-mode/clof +++ /dev/null @@ -1,6 +0,0 @@ -# -*- mode: snippet -*- -#Author : Jonas Bonèr <jonas@jonasboner.com> -#name : classOf[T] -# key: clof -# -- -classOf[${1:type}] $0
\ No newline at end of file diff --git a/scala-mode/cons.nil b/scala-mode/cons.nil deleted file mode 100644 index 719b4c9..0000000 --- a/scala-mode/cons.nil +++ /dev/null @@ -1,6 +0,0 @@ -# -*- mode: snippet -*- -#Author : Jonas Bonèr <jonas@jonasboner.com> -#name : element1 :: Nil -# key: cons -# -- -${1:element1} :: Nil $0 diff --git a/scala-mode/def.arg-ret-body b/scala-mode/def index 22a8ee9..22a8ee9 100644 --- a/scala-mode/def.arg-ret-body +++ b/scala-mode/def diff --git a/scala-mode/def.arg b/scala-mode/def.arg deleted file mode 100644 index 9db761a..0000000 --- a/scala-mode/def.arg +++ /dev/null @@ -1,6 +0,0 @@ -# -*- mode: snippet -*- -#Author : Jonas Bonèr <jonas@jonasboner.com> -#name : def f(arg: T) = ... -# key: def -# -- -def ${1:name}(${2:args}) = $0
\ No newline at end of file diff --git a/scala-mode/def.arg-body b/scala-mode/def.arg-body deleted file mode 100644 index 189a05e..0000000 --- a/scala-mode/def.arg-body +++ /dev/null @@ -1,8 +0,0 @@ -# -*- mode: snippet -*- -#Author : Jonas Bonèr <jonas@jonasboner.com> -#name : def f(arg: T) = {...} -# key: def -# -- -def ${1:name}(${2:args}) = { - $0 -}
\ No newline at end of file diff --git a/scala-mode/def.arg-ret b/scala-mode/def.arg-ret deleted file mode 100644 index 8f26674..0000000 --- a/scala-mode/def.arg-ret +++ /dev/null @@ -1,6 +0,0 @@ -# -*- mode: snippet -*- -#Author : Jonas Bonèr <jonas@jonasboner.com> -#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/scala-mode/def.body b/scala-mode/def.body deleted file mode 100644 index 1ee0c83..0000000 --- a/scala-mode/def.body +++ /dev/null @@ -1,8 +0,0 @@ -# -*- mode: snippet -*- -#Author : Jonas Bonèr <jonas@jonasboner.com> -#name : def f = {...} -# key: def -# -- -def ${1:name} = { - $0 -}
\ No newline at end of file diff --git a/scala-mode/def.ret b/scala-mode/def.ret deleted file mode 100644 index 8e261bf..0000000 --- a/scala-mode/def.ret +++ /dev/null @@ -1,6 +0,0 @@ -# -*- mode: snippet -*- -#Author : Jonas Bonèr <jonas@jonasboner.com> -#name : def f: R = ... -# key: def -# -- -def ${1:name}: ${2:Unit} = $0
\ No newline at end of file diff --git a/scala-mode/def.ret-body b/scala-mode/def.ret-body deleted file mode 100644 index de45cc4..0000000 --- a/scala-mode/def.ret-body +++ /dev/null @@ -1,8 +0,0 @@ -# -*- mode: snippet -*- -#Author : Jonas Bonèr <jonas@jonasboner.com> -#name : def f: R = {...} -# key: def -# -- -def ${1:name}: ${3:Unit} = { - $0 -}
\ No newline at end of file diff --git a/scala-mode/def.simple b/scala-mode/def.simple deleted file mode 100644 index db37cea..0000000 --- a/scala-mode/def.simple +++ /dev/null @@ -1,6 +0,0 @@ -# -*- mode: snippet -*- -#Author : Jonas Bonèr <jonas@jonasboner.com> -#name : def f = ... -# key: def -# -- -def ${1:name} = $0
\ No newline at end of file diff --git a/scala-mode/doc.scaladoc b/scala-mode/doc index 2cd2903..60b5007 100644 --- a/scala-mode/doc.scaladoc +++ b/scala-mode/doc @@ -1,7 +1,7 @@ # -*- mode: snippet -*- #Author : Anders Bach Nielsen <andersbach.nielsen@epfl.ch> #name : /** ... */ -# key: doc.scaladoc +# key: doc # -- /** * ${1:description} diff --git a/scala-mode/doc.class b/scala-mode/doc.class deleted file mode 100644 index 3c3a26e..0000000 --- a/scala-mode/doc.class +++ /dev/null @@ -1,10 +0,0 @@ -# -*- mode: snippet -*- -#Author : Anders Bach Nielsen <andersbach.nielsen@epfl.ch> -#name : /** cls/trt/obj name */ -# key: doc -# -- -/** - * `(scala-mode-find-clstrtobj-name-doc)` - * ${1:description} - * $0 - */
\ No newline at end of file diff --git a/scala-mode/doc.def b/scala-mode/doc.def deleted file mode 100644 index 072cf5e..0000000 --- a/scala-mode/doc.def +++ /dev/null @@ -1,8 +0,0 @@ -# -*- mode: snippet -*- -#Author : Anders Bach Nielsen <andersbach.nielsen@epfl.ch> -#name : /** method name */ -# key: doc -# -- -/** - * `(scala-mode-def-and-args-doc)` - */
\ No newline at end of file diff --git a/scala-mode/doc.file b/scala-mode/doc.file deleted file mode 100644 index 5d3f101..0000000 --- a/scala-mode/doc.file +++ /dev/null @@ -1,11 +0,0 @@ -# -*- mode: snippet -*- -#Author : Anders Bach Nielsen <andersbach.nielsen@epfl.ch> -#name : /** file name */ -# key: doc.file -# -- -/** - * `(scala-mode-file-doc)` - * $0 - * @author ${1:name} - * @version ${2:0.1} - */
\ No newline at end of file diff --git a/scala-mode/doc.file-scala b/scala-mode/doc.file-scala deleted file mode 100644 index 7814b26..0000000 --- a/scala-mode/doc.file-scala +++ /dev/null @@ -1,18 +0,0 @@ -# -*- mode: snippet -*- -#Author : Anders Bach Nielsen <andersbach.nielsen@epfl.ch> -#name : /** scala file */ -# key: doc.file-scala -# -- -/* __ *\ -** ________ ___ / / ___ Scala $3 ** -** / __/ __// _ | / / / _ | (c) 2005-`(format-time-string "%Y")` , LAMP/EPFL ** -** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ ** -** /____/\___/_/ |_/____/_/ | | ** -** |/ ** -\* */ -/** - * $0 - * @author ${1:name} - * @version ${2:0.1} - * $Id$ - */
\ No newline at end of file diff --git a/scala-mode/doc.file-scala-api b/scala-mode/doc.file-scala-api deleted file mode 100644 index 67bf231..0000000 --- a/scala-mode/doc.file-scala-api +++ /dev/null @@ -1,18 +0,0 @@ -# -*- mode: snippet -*- -#Author : Anders Bach Nielsen <andersbach.nielsen@epfl.ch> -#name : /** scala api file */ -# key: doc.file-scala-api -# -- -/* __ *\ -** ________ ___ / / ___ Scala API ** -** / __/ __// _ | / / / _ | (c) 2005-`(format-time-string "%Y")`, LAMP/EPFL ** -** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ ** -** /____/\___/_/ |_/____/_/ | | ** -** |/ ** -\* */ -/** - * $0 - * @author ${1:name} - * @version ${2:0.1} - * $Id$ - */
\ No newline at end of file diff --git a/scala-mode/expect b/scala-mode/expect deleted file mode 100644 index 3240a47..0000000 --- a/scala-mode/expect +++ /dev/null @@ -1,8 +0,0 @@ -# -*- mode: snippet -*- -#Author : Jonas Bonèr <jonas@jonasboner.com> -#name : expect(value) { ..} -# key: expect -# -- -expect(${1:reply}) { - $0 -}
\ No newline at end of file diff --git a/scala-mode/ext b/scala-mode/ext deleted file mode 100644 index 1887169..0000000 --- a/scala-mode/ext +++ /dev/null @@ -1,6 +0,0 @@ -# -*- mode: snippet -*- -#Author : Jonas Bonèr <jonas@jonasboner.com> -#name : extends T -# key: ext -# -- -extends $0
\ No newline at end of file diff --git a/scala-mode/for b/scala-mode/for new file mode 100644 index 0000000..44a4253 --- /dev/null +++ b/scala-mode/for @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +#Author : 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/scala-mode/for.extract b/scala-mode/for.extract deleted file mode 100644 index fac0447..0000000 --- a/scala-mode/for.extract +++ /dev/null @@ -1,6 +0,0 @@ -# -*- mode: snippet -*- -#Author : Jonas Bonèr <jonas@jonasboner.com> -#name : x <- xs -# key: for.extract -# -- -${1:x} <- ${2:xs}
\ No newline at end of file diff --git a/scala-mode/for.if b/scala-mode/for.if deleted file mode 100644 index 15e4b7a..0000000 --- a/scala-mode/for.if +++ /dev/null @@ -1,8 +0,0 @@ -# -*- mode: snippet -*- -#Author : Jonas Bonèr <jonas@jonasboner.com> -#name : for (x <- xs if guard) { ... } -# key: for -# -- -for (${1:x} <- ${2:xs} if ${3:guard}) { - $0 -}
\ No newline at end of file diff --git a/scala-mode/for.loop b/scala-mode/for.loop deleted file mode 100644 index 8dff38f..0000000 --- a/scala-mode/for.loop +++ /dev/null @@ -1,8 +0,0 @@ -# -*- mode: snippet -*- -#Author : Jonas Bonèr <jonas@jonasboner.com> -#name : for (x <- xs) { ... } -# key: for -# -- -for (${1:x} <- ${2:xs}) { - $0 -}
\ No newline at end of file diff --git a/scala-mode/for.multi b/scala-mode/for.multi deleted file mode 100644 index 26cac86..0000000 --- a/scala-mode/for.multi +++ /dev/null @@ -1,11 +0,0 @@ -# -*- mode: snippet -*- -#Author : Jonas Bonèr <jonas@jonasboner.com> -#name : for {x <- xs \ y <- ys} { yield } -# key: for -# -- -for { - ${1:x} <- ${2:xs} - ${3:x} <- ${4:xs} -} { - yield $0 -}
\ No newline at end of file diff --git a/scala-mode/foreach b/scala-mode/foreach deleted file mode 100644 index 0b7946f..0000000 --- a/scala-mode/foreach +++ /dev/null @@ -1,6 +0,0 @@ -# -*- mode: snippet -*- -#Author : Jonas Bonèr <jonas@jonasboner.com> -#name : foreach(x => ..) -# key: foreach -# -- -foreach(${1:x} => ${2:body}) $0
\ No newline at end of file diff --git a/scala-mode/hmap.new b/scala-mode/hmap.new deleted file mode 100644 index 3311255..0000000 --- a/scala-mode/hmap.new +++ /dev/null @@ -1,6 +0,0 @@ -# -*- mode: snippet -*- -#Author : Jonas Bonèr <jonas@jonasboner.com> -#name : new HashMap[K, V] -# key: hmap.new -# -- -new HashMap[${1:key}, ${2:value}] $0
\ No newline at end of file diff --git a/scala-mode/hmap.val-new b/scala-mode/hmap.val-new deleted file mode 100644 index 35544c6..0000000 --- a/scala-mode/hmap.val-new +++ /dev/null @@ -1,6 +0,0 @@ -# -*- mode: snippet -*- -#Author : Jonas Bonèr <jonas@jonasboner.com> -#name : val m = new HashMap[K, V] -# key: hmap.val-new -# -- -val ${1:m} = new HashMap[${2:key}, ${3:value}] $0
\ No newline at end of file diff --git a/scala-mode/hset.new b/scala-mode/hset.new deleted file mode 100644 index 249742f..0000000 --- a/scala-mode/hset.new +++ /dev/null @@ -1,6 +0,0 @@ -# -*- mode: snippet -*- -#Author : Jonas Bonèr <jonas@jonasboner.com> -#name : new HashSet[K] -# key: hset.new -# -- -new HashSet[${1:key}] $0 diff --git a/scala-mode/hset.val-new b/scala-mode/hset.val-new deleted file mode 100644 index 98ae6e3..0000000 --- a/scala-mode/hset.val-new +++ /dev/null @@ -1,6 +0,0 @@ -# -*- mode: snippet -*- -#Author : Jonas Bonèr <jonas@jonasboner.com> -#name : val m = new HashSet[K] -# key: hset.val-new -# -- -val ${1:m} = new HashSet[${2:key}] $0
\ No newline at end of file diff --git a/scala-mode/if.else b/scala-mode/if.else deleted file mode 100644 index e3c0bb3..0000000 --- a/scala-mode/if.else +++ /dev/null @@ -1,10 +0,0 @@ -# -*- mode: snippet -*- -#Author : Jonas Bonèr <jonas@jonasboner.com> -#name : if (cond) { .. } else { .. } -# key: if -# -- -if (${1:condition}) { - $2 -} else { - $0 -}
\ No newline at end of file diff --git a/scala-mode/imp b/scala-mode/imp deleted file mode 100644 index ff679b8..0000000 --- a/scala-mode/imp +++ /dev/null @@ -1,6 +0,0 @@ -# -*- mode: snippet -*- -#Author : Jonas Bonèr <jonas@jonasboner.com> -#name : import .. -# key: imp -# -- -import $0
\ No newline at end of file diff --git a/scala-mode/intercept b/scala-mode/intercept deleted file mode 100644 index 1ac150e..0000000 --- a/scala-mode/intercept +++ /dev/null @@ -1,8 +0,0 @@ -# -*- mode: snippet -*- -#Author : Jonas Bonèr <jonas@jonasboner.com> -#name : intercept(classOf[T]) { ..} -# key: intercept -# -- -intercept(classOf[${1:Exception]}) { - $0 -}
\ No newline at end of file diff --git a/scala-mode/isof b/scala-mode/isof deleted file mode 100644 index 43aef58..0000000 --- a/scala-mode/isof +++ /dev/null @@ -1,6 +0,0 @@ -# -*- mode: snippet -*- -#Author : Jonas Bonèr <jonas@jonasboner.com> -#name : isInstanceOf[T] -# key: isof -# -- -isInstanceOf[${1:type}] $0
\ No newline at end of file diff --git a/scala-mode/ls.new b/scala-mode/ls index 3e1fb51..3e1fb51 100644 --- a/scala-mode/ls.new +++ b/scala-mode/ls diff --git a/scala-mode/ls.val-new b/scala-mode/ls.val-new deleted file mode 100644 index d24109f..0000000 --- a/scala-mode/ls.val-new +++ /dev/null @@ -1,6 +0,0 @@ -# -*- mode: snippet -*- -#Author : Jonas Bonèr <jonas@jonasboner.com> -#name : val l = List(..) -# key: ls -# -- -val ${1:l} = List(${2:args}, ${3:args}) $0
\ No newline at end of file diff --git a/scala-mode/map b/scala-mode/map deleted file mode 100644 index 546f162..0000000 --- a/scala-mode/map +++ /dev/null @@ -1,6 +0,0 @@ -# -*- mode: snippet -*- -#Author : Jonas Bonèr <jonas@jonasboner.com> -#name : map(x => ..) -# key: map -# -- -map(${1:x} => ${2:body}) $0
\ No newline at end of file diff --git a/scala-mode/map.new b/scala-mode/map.new deleted file mode 100644 index cc3d43f..0000000 --- a/scala-mode/map.new +++ /dev/null @@ -1,6 +0,0 @@ -# -*- mode: snippet -*- -#Author : Jonas Bonèr <jonas@jonasboner.com> -#name : Map(key -> value) -# key: map -# -- -Map(${1:key} -> ${2:value}) $0
\ No newline at end of file diff --git a/scala-mode/match.can b/scala-mode/match.can deleted file mode 100644 index aa4f9f5..0000000 --- a/scala-mode/match.can +++ /dev/null @@ -1,13 +0,0 @@ -# -*- mode: snippet -*- -#Author : Jonas Bonèr <jonas@jonasboner.com> -#name : can match { case Full(res) => .. } -# key: match -# -- -${1:option} match { - case Full(res) => $0 - - case Empty => - - case Failure(msg, _, _) => - -}
\ No newline at end of file diff --git a/scala-mode/match.option b/scala-mode/match.option deleted file mode 100644 index 134bc53..0000000 --- a/scala-mode/match.option +++ /dev/null @@ -1,10 +0,0 @@ -# -*- mode: snippet -*- -#Author : Jonas Bonèr <jonas@jonasboner.com> -#name : option match { case None => .. } -# key: match -# -- -${1:option} match { - case None => $0 - case Some(res) => - -}
\ No newline at end of file diff --git a/scala-mode/mix b/scala-mode/mix deleted file mode 100644 index d61eb51..0000000 --- a/scala-mode/mix +++ /dev/null @@ -1,8 +0,0 @@ -# -*- mode: snippet -*- -#Author : Jonas Bonèr <jonas@jonasboner.com> -#name : trait T { .. } -# key: mix -# -- -trait ${1:name} { - $0 -}
\ No newline at end of file diff --git a/scala-mode/pac b/scala-mode/pac deleted file mode 100644 index b36509c..0000000 --- a/scala-mode/pac +++ /dev/null @@ -1,6 +0,0 @@ -# -*- mode: snippet -*- -#Author : Jonas Bonèr <jonas@jonasboner.com> -#name : package .. -# key: pac -# -- -package $0
\ No newline at end of file diff --git a/scala-mode/pr.newline b/scala-mode/pr.newline deleted file mode 100644 index 5f805fc..0000000 --- a/scala-mode/pr.newline +++ /dev/null @@ -1,6 +0,0 @@ -# -*- mode: snippet -*- -#Author : Jonas Bonèr <jonas@jonasboner.com> -#name : println(..) -# key: pr.newline -# -- -println(${1:obj}) $0
\ No newline at end of file diff --git a/scala-mode/pr.simple b/scala-mode/pr.simple deleted file mode 100644 index c676790..0000000 --- a/scala-mode/pr.simple +++ /dev/null @@ -1,6 +0,0 @@ -# -*- mode: snippet -*- -#Author : Jonas Bonèr <jonas@jonasboner.com> -#name : print(..) -# key: pr -# -- -print(${1:obj}) $0
\ No newline at end of file diff --git a/scala-mode/pr.string b/scala-mode/pr.string deleted file mode 100644 index ded8178..0000000 --- a/scala-mode/pr.string +++ /dev/null @@ -1,6 +0,0 @@ -# -*- mode: snippet -*- -#Author : Jonas Bonèr <jonas@jonasboner.com> -#name : println("..") -# key: pr -# -- -println("${1:msg}") $0
\ No newline at end of file diff --git a/scala-mode/pr.trace b/scala-mode/pr.trace deleted file mode 100644 index 9ec9e79..0000000 --- a/scala-mode/pr.trace +++ /dev/null @@ -1,6 +0,0 @@ -# -*- mode: snippet -*- -#Author : Jonas Bonèr <jonas@jonasboner.com> -#name : println("obj: " + obj) -# key: pr -# -- -println("${1:obj}: " + ${1:obj}) $0
\ No newline at end of file diff --git a/scala-mode/pri b/scala-mode/pri deleted file mode 100644 index 42a2561..0000000 --- a/scala-mode/pri +++ /dev/null @@ -1,6 +0,0 @@ -# -*- mode: snippet -*- -#Author : Jonas Bonèr <jonas@jonasboner.com> -#name : private -# key: pri -# -- -private $0
\ No newline at end of file diff --git a/scala-mode/pri.param b/scala-mode/pri.param deleted file mode 100644 index b887cad..0000000 --- a/scala-mode/pri.param +++ /dev/null @@ -1,6 +0,0 @@ -# -*- mode: snippet -*- -#Author : Jonas Bonèr <jonas@jonasboner.com> -#name : private[this] -# key: pri.param -# -- -private[${1:this}] $0
\ No newline at end of file diff --git a/scala-mode/pro b/scala-mode/pro deleted file mode 100644 index ca7009c..0000000 --- a/scala-mode/pro +++ /dev/null @@ -1,6 +0,0 @@ -# -*- mode: snippet -*- -#Author : Jonas Bonèr <jonas@jonasboner.com> -#name : protected -# key: pro -# -- -protected $0
\ No newline at end of file diff --git a/scala-mode/pro.param b/scala-mode/pro.param deleted file mode 100644 index c399064..0000000 --- a/scala-mode/pro.param +++ /dev/null @@ -1,6 +0,0 @@ -# -*- mode: snippet -*- -#Author : Jonas Bonèr <jonas@jonasboner.com> -#name : protected[this] -# key: prno -# -- -protected[${1:this}] $0
\ No newline at end of file diff --git a/scala-mode/suite b/scala-mode/suite deleted file mode 100644 index 8cad2c4..0000000 --- a/scala-mode/suite +++ /dev/null @@ -1,10 +0,0 @@ -# -*- mode: snippet -*- -#Author : Jonas Bonèr <jonas@jonasboner.com> -#name : class T extends Suite { .. } -# key: suite -# -- -import org.scalatest._ - -class ${1:name} extends Suite { - $0 -}
\ No newline at end of file diff --git a/scala-mode/test b/scala-mode/test deleted file mode 100644 index a8a3f00..0000000 --- a/scala-mode/test +++ /dev/null @@ -1,9 +0,0 @@ -# -*- mode: snippet -*- -#Author : Jonas Bonèr <jonas@jonasboner.com> -#name : @Test def testX = ... -# key: test -# -- -//@Test -def test${1:name} = { - $0 -}
\ No newline at end of file diff --git a/scala-mode/tr b/scala-mode/tr deleted file mode 100644 index 10c5cf3..0000000 --- a/scala-mode/tr +++ /dev/null @@ -1,8 +0,0 @@ -# -*- mode: snippet -*- -#Author : Anders Bach Nielsen <andersbach.nielsen@epfl.ch> -#name : trait T { .. } -# key: tr -# -- -trait ${1:name} { - $0 -}
\ No newline at end of file diff --git a/scala-mode/tr.ext b/scala-mode/tr.ext deleted file mode 100644 index 684af94..0000000 --- a/scala-mode/tr.ext +++ /dev/null @@ -1,8 +0,0 @@ -# -*- mode: snippet -*- -#Author : Anders Bach Nielsen <andersbach.nielsen@epfl.ch> -#name : trait T extends C { .. } -# key: tr -# -- -trait ${1:name} extends ${2:class} { - $0 -}
\ No newline at end of file diff --git a/scala-mode/tr.ext-with b/scala-mode/tr.ext-with deleted file mode 100644 index 99b75ee..0000000 --- a/scala-mode/tr.ext-with +++ /dev/null @@ -1,8 +0,0 @@ -# -*- mode: snippet -*- -#Author : Anders Bach Nielsen <andersbach.nielsen@epfl.ch> -#name : trait T1 extends C with T2 { .. } -# key: tr -# -- -trait ${1:name} extends ${2:class} with ${3:trait} { - $0 -}
\ No newline at end of file diff --git a/scala-mode/tr.with b/scala-mode/tr.with deleted file mode 100644 index c513c6d..0000000 --- a/scala-mode/tr.with +++ /dev/null @@ -1,8 +0,0 @@ -# -*- mode: snippet -*- -#Author : Anders Bach Nielsen <andersbach.nielsen@epfl.ch> -#name : trait T1 with T2 { .. } -# key: tr.with -# -- -trait ${1:name} with ${2:trait} { - $0 -}
\ No newline at end of file diff --git a/scala-mode/try b/scala-mode/try index b218af1..d0c8d04 100644 --- a/scala-mode/try +++ b/scala-mode/try @@ -1,11 +1,11 @@ # -*- mode: snippet -*- -#Author : Jonas Bonèr <jonas@jonasboner.com> +#Author : Sam Halliday #name : try { .. } catch { case e => ..} # key: try # -- try { $0 } catch { - case ${1:e}: ${2:Exception} => - ${1:println(\"ERROR: \" + e) // TODO: handle exception}\n} + case e: ${1:Throwable} => + ${2:// TODO: handle exception} }
\ No newline at end of file diff --git a/scala-mode/try.catch-finally b/scala-mode/try.catch-finally deleted file mode 100644 index dc23e69..0000000 --- a/scala-mode/try.catch-finally +++ /dev/null @@ -1,13 +0,0 @@ -# -*- mode: snippet -*- -#Author : Jonas Bonèr <jonas@jonasboner.com> -#name : try { .. } catch { case e => ..} finally { ..} -# key: try -# -- -try { - $0 -} catch { - case ${1:e}: ${2:Exception} => - ${1:println(\"ERROR: \" + e) // TODO: handle exception}\n} -} finally { - -}
\ No newline at end of file diff --git a/scala-mode/try.finally b/scala-mode/try.finally deleted file mode 100644 index f61f37b..0000000 --- a/scala-mode/try.finally +++ /dev/null @@ -1,10 +0,0 @@ -# -*- mode: snippet -*- -#Author : Jonas Bonèr <jonas@jonasboner.com> -#name : try { .. } finally { .. } -# key: try -# -- -try { - -} finally { - $0 -}
\ No newline at end of file diff --git a/scala-mode/tup.arrow b/scala-mode/tup.arrow deleted file mode 100644 index 8eded66..0000000 --- a/scala-mode/tup.arrow +++ /dev/null @@ -1,6 +0,0 @@ -# -*- mode: snippet -*- -#Author : Jonas Bonèr <jonas@jonasboner.com> -#name : element1 -> element2 -# key: tup.arrow -# -- -${1:element1} -> ${2:element2} $0
\ No newline at end of file diff --git a/scala-mode/tup.paren b/scala-mode/tup.paren deleted file mode 100644 index f56801d..0000000 --- a/scala-mode/tup.paren +++ /dev/null @@ -1,6 +0,0 @@ -# -*- mode: snippet -*- -#Author : Jonas Bonèr <jonas@jonasboner.com> -#name : (element1, element2) -# key: tup.paren -# -- -(${1:element1}, ${2:element2}) $0
\ No newline at end of file diff --git a/scala-mode/val b/scala-mode/val deleted file mode 100644 index e8e43f8..0000000 --- a/scala-mode/val +++ /dev/null @@ -1,6 +0,0 @@ -# -*- mode: snippet -*- -#Author : Jonas Bonèr <jonas@jonasboner.com> -#name : val name = .. -# key: val -# -- -val ${1:name} = ${2:obj} $0
\ No newline at end of file diff --git a/scala-mode/val.new b/scala-mode/val.new deleted file mode 100644 index e419690..0000000 --- a/scala-mode/val.new +++ /dev/null @@ -1,6 +0,0 @@ -# -*- mode: snippet -*- -#Author : Jonas Bonèr <jonas@jonasboner.com> -#name : val name = new .. -# key: val -# -- -val ${1:name} = new ${2:obj} $0
\ No newline at end of file diff --git a/scala-mode/val.ret b/scala-mode/val.ret deleted file mode 100644 index f8d8788..0000000 --- a/scala-mode/val.ret +++ /dev/null @@ -1,6 +0,0 @@ -# -*- mode: snippet -*- -#Author : Jonas Bonèr <jonas@jonasboner.com> -#name : val name: T = .. -# key: val -# -- -val ${1:name}: ${2:T} = ${3:obj} $0 diff --git a/scala-mode/valueclass b/scala-mode/valueclass new file mode 100644 index 0000000..8ad8ead --- /dev/null +++ b/scala-mode/valueclass @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# Author: Michael Pollmeier +# name: value class +# key: vc +# -- +case class ${1:Name}(value: ${2:Type}) extends AnyVal diff --git a/scala-mode/var b/scala-mode/var deleted file mode 100644 index 5d78444..0000000 --- a/scala-mode/var +++ /dev/null @@ -1,6 +0,0 @@ -# -*- mode: snippet -*- -#Author : Jonas Bonèr <jonas@jonasboner.com> -#name : var name = .. -# key: var -# -- -var ${1:name} = ${2:obj} $0 diff --git a/scala-mode/var.new b/scala-mode/var.new deleted file mode 100644 index c22a15c..0000000 --- a/scala-mode/var.new +++ /dev/null @@ -1,6 +0,0 @@ -# -*- mode: snippet -*- -#Author : Jonas Bonèr <jonas@jonasboner.com> -#name : var name = new .. -# key: var.new -# -- -var ${1:name} = new ${2:obj} $0 diff --git a/scala-mode/var.ret b/scala-mode/var.ret deleted file mode 100644 index af5f860..0000000 --- a/scala-mode/var.ret +++ /dev/null @@ -1,6 +0,0 @@ -# -*- mode: snippet -*- -#Author : Jonas Bonèr <jonas@jonasboner.com> -#name : var name: T = .. -# key: var.ret -# -- -var ${1:name}: ${2:T} = ${3:obj} $0 diff --git a/scala-mode/whi b/scala-mode/whi deleted file mode 100644 index 141efa1..0000000 --- a/scala-mode/whi +++ /dev/null @@ -1,8 +0,0 @@ -# -*- mode: snippet -*- -#Author : Jonas Bonèr <jonas@jonasboner.com> -#name : while(cond) { .. } -# key: whi -# -- -while (${1:condition}) { - $0 -}
\ No newline at end of file diff --git a/scala-mode/with b/scala-mode/with deleted file mode 100644 index 19f5dea..0000000 --- a/scala-mode/with +++ /dev/null @@ -1,6 +0,0 @@ -# -*- mode: snippet -*- -#Author : Jonas Bonèr <jonas@jonasboner.com> -#name : with T -# key: with -# -- -with $0
\ No newline at end of file diff --git a/sh-mode/safe-bang b/sh-mode/safe-bang new file mode 100644 index 0000000..ef93a83 --- /dev/null +++ b/sh-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/sh-mode/while b/sh-mode/while new file mode 100644 index 0000000..16b147c --- /dev/null +++ b/sh-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/sql-mode/insert b/sql-mode/insert new file mode 100644 index 0000000..9ac08fe --- /dev/null +++ b/sql-mode/insert @@ -0,0 +1,5 @@ +# -*- mode: snippet; -*- +# name: insert +# key: ins +# -- +INSERT INTO ${table-name} (${col1, col2}) VALUES (${'val1', 'val2'});$0
\ No newline at end of file diff --git a/typerex-mode b/typerex-mode deleted file mode 120000 index e5de65a..0000000 --- a/typerex-mode +++ /dev/null @@ -1 +0,0 @@ -tuareg-mode
\ No newline at end of file diff --git a/typerex-mode/.yas-parents b/typerex-mode/.yas-parents new file mode 100644 index 0000000..f26cfc7 --- /dev/null +++ b/typerex-mode/.yas-parents @@ -0,0 +1 @@ +tuareg-mode diff --git a/web-mode/.yas-parents b/web-mode/.yas-parents new file mode 100644 index 0000000..8a11383 --- /dev/null +++ b/web-mode/.yas-parents @@ -0,0 +1 @@ +html-mode |