add lisp packages

This commit is contained in:
2020-12-05 21:29:49 +01:00
parent 85e20365ae
commit a6e2395755
7272 changed files with 1363243 additions and 0 deletions

View File

@@ -0,0 +1 @@

View File

@@ -0,0 +1,3 @@
(require 'yasnippet)
(add-hook 'bibtex-mode-hook #'yasnippet-snippets--no-indent)

View File

@@ -0,0 +1,17 @@
# -*- mode: snippet -*-
# name: article
# key: article
# --
@article{ ${title},
author = {${author}},
title = {${title}},
journal = {${journal}},
year = {${year}}${,
volume = {${volume}}}${,
number = {${number}}}${,
pages = {${pages}}}${,
month = {${month}}}${,
note = {${note}}}
}
$0

View File

@@ -0,0 +1,22 @@
# -*- mode: snippet -*-
# name: book
# key: book
# --
@book{ ${title},
author = {${author}},
editor = {${editor}}
title = {${title}},
publisher = {${publisher}},
year = {${year}}${,
volume = {${volume}}}${,
number = {${number}}}${,
series = {${series}}}${,
type = {${type}}}${,
address = {${address}}}${,
edition = {${edition}}}${,
month = {${month}}}${,
isbn = {${isbn}}}${,
note = {${note}}}
}
$0

View File

@@ -0,0 +1,22 @@
# -*- mode: snippet -*-
# name: bookinbook
# key: bookinbook
# author: Spenser Truex
# --
@bookinbook{ ${title},
author = {${author}},
title = {${title}},
chapter = {${chapter}}${,
pages = {${pages}}},
publisher = {${publisher}},
year = {${year}},
volume = {${volume}}${,
series = {${series}}}${,
type = {${type}}}${,
address = {${address}}}${,
edition = {${edition}}}${,
month = {${month}}}${,
note = {${note}}}
}
$0

View File

@@ -0,0 +1,15 @@
# -*- mode: snippet -*-
# name: booklet
# key: booklet
# --
@booklet{ ${title},
author = {${author}}${,
howpublished = {${howpublished}}}${,
address = {${address}}}${,
year = {${year}}}${,
month = {${month}}}${,
volume = {${volume}}}${,
note = {${note}}}
}
$0

View File

@@ -0,0 +1,22 @@
# -*- mode: snippet -*-
# name: collection
# key: collection
# author: Spenser Truex
# --
@collection{ ${title},
editor = {${editor}},
title = {${title}},
year = {${year}}${,
publisher = {${publisher}}}${,
volume = {${volume}}}${,
series = {${series}}}${,
type = {${type}}}${,
chapter = {${chapter}}}${,
pages = {${pages}}}${,
address = {${address}}}${,
edition = {${edition}}}${,
month = {${month}}}${,
note = {${note}}}
}
$0

View File

@@ -0,0 +1,21 @@
# -*- mode: snippet -*-
# name: conference
# key: conference
# --
@conference{ ${title},
author = {${author}},
title = {${title}},
booktitle = {${booktitle}},
year = {${year}},
editor = {${editor}}${,
volume = {${volume}}}${,
series = {${series}}}${,
pages = {${pages}}}${,
address = {${address}}}${,
month = {${month}}}${,
organization = {${organization}}}${,
publisher = {${publisher}}}${,
note = {${note}}}
}
$0

View File

@@ -0,0 +1,17 @@
# -*- mode: snippet -*-
# name: dataset
# key: dataset
# author: Spenser Truex
# --
@dataset{ ${title}
title = {${title}},
editor = {${editor}},
year = {${year}}${,
author = {${author}}}${,
volume = {${volume}}}${,
version = {${version}}}${,
publisher = {${publisher}}}${,
organization = {${organization}}}${,
note = {${note}}}
}

View File

@@ -0,0 +1,14 @@
# -*- mode: snippet -*-
# name: electronic
# key: electronic
# author: Spenser Truex
# --
@electronic{ ${title},
author = {${author}},
title = {${title}},
year = {${year}},
url = {${url}}${,
editor = {${editor}}}${,
urldate = {${urldate}}}${,
note = {${note}}}
}

View File

@@ -0,0 +1,21 @@
# -*- mode: snippet -*-
# name: inbook
# key: inbook
# --
@inbook{ ${title},
author = {${author}},
title = {${title}},
chapter = {${chapter}}${,
pages = {${pages}}},
publisher = {${publisher}},
year = {${year}},
volume = {${volume}}${,
series = {${series}}}${,
type = {${type}}}${,
address = {${address}}}${,
edition = {${edition}}}${,
month = {${month}}}${,
note = {${note}}}
}
$0

View File

@@ -0,0 +1,23 @@
# -*- mode: snippet -*-
# name: incollection
# key: incollection
# --
@incollection{ ${title},
author = {${author}},
title = {${title}},
booktitle = {${booktitle}},
publisher = {${publisher}},
year = {${year}}${,
editor = {${editor}}}${,
volume = {${volume}}}${,
series = {${series}}}${,
type = {${type}}}${,
chapter = {${chapter}}}${,
pages = {${pages}}}${,
address = {${address}}}${,
edition = {${edition}}}${,
month = {${month}}}${,
note = {${note}}}
}
$0

View File

@@ -0,0 +1,21 @@
# -*- mode: snippet -*-
# name: inproceedings
# key: inproceedings
# --
@inproceedings{ ${title},
author = {${author}},
title = {${title}},
booktitle = {${booktitle}},
year = {${year}},
editor = {${editor}}${,
volume = {${volume}}}${,
series = {${series}}}${,
pages = {${pages}}}${,
address = {${address}}}${,
month = {${month}}}${,
organization = {${organization}}}${,
publisher = {${publisher}}}${,
note = {${note}}}
}
$0

View File

@@ -0,0 +1,24 @@
# -*- mode: snippet -*-
# name: inreference
# key: inreference
# author: Spenser Truex
# --
@inreference{ ${title},
author = {${author}},
title = {${title}},
booktitle = {${booktitle}},
publisher = {${publisher}},
year = {${year}}${,
editor = {${editor}}}${,
volume = {${volume}}}${,
series = {${series}}}${,
type = {${type}}}${,
chapter = {${chapter}}}${,
pages = {${pages}}}${,
address = {${address}}}${,
edition = {${edition}}}${,
month = {${month}}}${,
note = {${note}}}
}
$0

View File

@@ -0,0 +1,14 @@
# -*- mode: snippet -*-
# name: manual
# key: manual
# --
@manual{ ${title},
title = {${title}}${,
author = {${author}}}${,
organization = {${organization}}}${,
address = {${address}}}${,
editor = {${editor}}}${,
month = {${month}}}${,
year = {${year}}}${,
note = {${note}}}
}

View File

@@ -0,0 +1,16 @@
# -*- mode: snippet -*-
# name: masterthesis
# key: masterthesis
# --
@masterthesis{ ${title},
author = {${author}},
title = {${title}},
school = {${school}},
year = {${year}}${,
type = {${type}}}${,
address = {${address}}}${,
month = {${month}}}${,
note = {${note}}}
}
$0

View File

@@ -0,0 +1,14 @@
# -*- mode: snippet -*-
# name: misc
# key: misc
# --
@misc{ ${title}${,
author = {${author}}}${,
title = {${title}}}${,
howpublished = {${howpublished}}}${,
month = {${month}}}${,
year = {${year}}}${,
note = {${note}}}
}
$0

View File

@@ -0,0 +1,23 @@
# -*- mode: snippet -*-
# name: mvbook
# key: mvbook
# author: Spenser Truex
# --
@mvbook{ ${title},
author = {${author}},
title = {${title}},
year = {${year}}${,
volume = {${volume}}}${,
editor = {${editor}}}${,
publisher = {${publisher}}}${,
number = {${number}}}${,
series = {${series}}}${,
type = {${type}}}${,
address = {${address}}}${,
edition = {${edition}}}${,
month = {${month}}}${,
isbn = {${isbn}}}${,
note = {${note}}}
}
$0

View File

@@ -0,0 +1,22 @@
# -*- mode: snippet -*-
# name: mvcollection
# key: mvcollection
# author: Spenser Truex
# --
@mvcollection{ ${title},
editor = {${editor}},
title = {${title}},
year = {${year}}${,
publisher = {${publisher}}}${,
volumes = {${volumes}}}${,
series = {${series}}}${,
type = {${type}}}${,
chapter = {${chapter}}}${,
pages = {${pages}}}${,
address = {${address}}}${,
edition = {${edition}}}${,
month = {${month}}}${,
note = {${note}}}
}
$0

View File

@@ -0,0 +1,19 @@
# -*- mode: snippet -*-
# name: proceedings
# key: proceedings
# author: Spenser Truex
# --
@mvproceedings{ ${title},
title = {${title}},
year = {${year}}${,
editor = {${editor}}}${,
volume = {${volume}}}${,
series = {${series}}}${,
address = {${address}}}${,
month = {${month}}}${,
organization = {${organization}}}${,
publisher = {${publisher}}}${,
note = {${note}}}
}
$0

View File

@@ -0,0 +1,22 @@
# -*- mode: snippet -*-
# name: mvereference
# key: mvreference
# author: Spenser Truex
# --
@mvreference{ ${title},
editor = {${editor}},
title = {${title}},
year = {${year}}${,
publisher = {${publisher}}}${,
volumes = {${volumes}}}${,
series = {${series}}}${,
type = {${type}}}${,
chapter = {${chapter}}}${,
pages = {${pages}}}${,
address = {${address}}}${,
edition = {${edition}}}${,
month = {${month}}}${,
note = {${note}}}
}
$0

View File

@@ -0,0 +1,14 @@
# -*- mode: snippet -*-
# name: online
# key: online
# author: Spenser Truex
# --
@online{ ${title},
author = {${author}},
title = {${title}},
year = {${year}},
url = {${url}}${,
editor = {${editor}}}${,
urldate = {${urldate}}}${,
note = {${note}}}
}

View File

@@ -0,0 +1,15 @@
# -*- mode: snippet -*-
# name: patent
# key: patent
# author: Spenser Truex
# --
@patent{ ${title},
title = {${title}},
author = {${author}},
number = {${number}},
year = {${year}},
holder = {${holder}}${,
type = {${type}}}${,
url = {${url}}}${,
note = {${note}}}
}

View File

@@ -0,0 +1,16 @@
# -*- mode: snippet -*-
# name: periodical
# key: periodical
# author: Spenser Truex
# --
@periodical{ ${title}
editor = {${editor}},
title = {${title}},
year = {${year}}${,
issue = {${issue}}}${,
issuetitle = {${issuetitle}}}${,
url = {${url}}}${,
urldate = {${urldate}}}${,
issn = {${issn}}}${,
note = {${note}}}
}

View File

@@ -0,0 +1,16 @@
# -*- mode: snippet -*-
# name: phdthesis
# key: phdthesis
# --
@phdthesis{ ${title},
author = {${author}},
title = {${title}},
school = {${school}},
year = {${year}}${,
type = {${type}}}${,
address = {${address}}}${,
month = {${month}}}${,
note = {${note}}}
}
$0

View File

@@ -0,0 +1,18 @@
# -*- mode: snippet -*-
# name: proceedings
# key: proceedings
# --
@proceedings{ ${title},
title = {${title}},
year = {${year}}${,
editor = {${editor}}}${,
volume = {${volume}}}${,
series = {${series}}}${,
address = {${address}}}${,
month = {${month}}}${,
organization = {${organization}}}${,
publisher = {${publisher}}}${,
note = {${note}}}
}
$0

View File

@@ -0,0 +1,22 @@
# -*- mode: snippet -*-
# name: reference
# key: reference
# author: Spenser Truex
# --
@reference{ ${title},
editor = {${editor}},
title = {${title}},
year = {${year}}${,
publisher = {${publisher}}}${,
volume = {${volume}}}${,
series = {${series}}}${,
type = {${type}}}${,
chapter = {${chapter}}}${,
pages = {${pages}}}${,
address = {${address}}}${,
edition = {${edition}}}${,
month = {${month}}}${,
note = {${note}}}
}
$0

View File

@@ -0,0 +1,17 @@
# -*- mode: snippet -*-
# name: report
# key: report
# author: Spenser Truex
# --
@report{ ${title},
author = {${author}},
title = {${title}},
institution = {${institution}},
year = {${year}},
type = {${type}}${,
address = {${address}}}${,
month = {${month}}}${,
note = {${note}}}
}
$0

View File

@@ -0,0 +1,8 @@
# -*- mode: snippet -*-
# name: set
# key: set
# author: Spenser Truex
# --
@set{${title},
entryset = {${entryset}}
}

View File

@@ -0,0 +1,14 @@
# -*- mode: snippet -*-
# name: software
# key: software
# --
@software{ ${title}${,
author = {${author}}}${,
title = {${title}}}${,
howpublished = {${howpublished}}}${,
month = {${month}}}${,
year = {${year}}}${,
note = {${note}}}
}
$0

View File

@@ -0,0 +1,22 @@
# -*- mode: snippet -*-
# name: suppbook
# key: suppbook
# author: Spenser Truex
# --
@suppbook{ ${title},
author = {${author}},
title = {${title}},
chapter = {${chapter}}${,
pages = {${pages}}},
publisher = {${publisher}},
year = {${year}},
volume = {${volume}}${,
series = {${series}}}${,
type = {${type}}}${,
address = {${addre}ss}}${,
edition = {${edition}}}${,
month = {${month}}}${,
note = {${note}}}
}
$0

View File

@@ -0,0 +1,24 @@
# -*- mode: snippet -*-
# name: suppcollection
# key: suppcollection
# author: Spenser Truex
# --
@suppcollection{ ${title},
author = {${author}},
title = {${title}},
booktitle = {${booktitle}},
publisher = {${publisher}},
year = {${year}}${,
editor = {${editor}}}${,
volume = {${volume}}}${,
series = {${series}}}${,
type = {${type}}}${,
chapter = {${chapter}}}${,
pages = {${pages}}}${,
address = {${address}}}${,
edition = {${edition}}}${,
month = {${month}}}${,
note = {${note}}}
}
$0

View File

@@ -0,0 +1,18 @@
# -*- mode: snippet -*-
# name: suppperiodical
# key: suppperiodical
# author: Spenser Truex
# --
@suppperiodical{ ${title},
author = {${author}},
title = {${title}},
journal = {${journal}},
year = {${year}}${,
volume = {${volume}}}${,
number = {${number}}}${,
pages = {${pages}}}${,
month = {${month}}}${,
note = {${note}}}
}
$0

View File

@@ -0,0 +1,16 @@
# -*- mode: snippet -*-
# name: techreport
# key: techreport
# --
@techreport{ ${title},
author = {${author}},
title = {${title}},
institution = {${institution}},
year = {${year}},
type = {${type}}${,
address = {${address}}}${,
month = {${month}}}${,
note = {${note}}}
}
$0

View File

@@ -0,0 +1,17 @@
# -*- mode: snippet -*-
# name: thesis
# key: thesis
# author: Spenser Truex
# --
@thesis{ ${title},
author = {${author}},
title = {${title}},
school = {${school}},
year = {${year}}${,
type = {${type}}}${,
address = {${address}}}${,
month = {${month}}}${,
note = {${note}}}
}
$0

View File

@@ -0,0 +1,13 @@
# -*- mode: snippet -*-
# name: unpublished
# key: unpublished
# --
@unpublished{ ${title},
author = {${author}},
title = {${title}},
note = {${note}}${,
month = {${month}}}${,
year = {${year}}}
}
$0

View File

@@ -0,0 +1,8 @@
# -*- mode: snippet -*-
# name: xdata
# key: xdata
# author: Spenser Truex
# --
@xdata{ ${title},
$0
}

View File

@@ -0,0 +1,2 @@
cc-mode
c-lang-common

View File

@@ -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;")))

View File

@@ -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

View File

@@ -0,0 +1,6 @@
# -*- mode: snippet -*-
# name: accumulate
# key: acm
# --
auto sum = std::accumulate(std::begin(${1:container}), std::end($1), 0);
$0

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: assert
# key: ass
# --
assert($0);

View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: v.begin(), v.end()
# key: beginend
# --
${1:v}.begin(), $1.end

View File

@@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# name: boost_require
# key: req
# group: boost
# --
BOOST_REQUIRE( ${1:condition} );
$0

View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: cerr
# key: err
# --
cerr << $0;

View File

@@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# name: cin
# key: cin
# --
`(progn (goto-char (point-min)) (unless (re-search-forward
"^using\\s-+namespace std;" nil 'no-error) "std::"))
`cin >> $0;

View File

@@ -0,0 +1,11 @@
# -*- mode: snippet -*-
# name: class
# key: cls
# --
class ${1:Name}
{
public:
${1:$(yas-c++-class-name yas-text)}();
${2:virtual ~${1:$(yas-c++-class-name yas-text)}();}
};
$0

View File

@@ -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:
};

View File

@@ -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

View File

@@ -0,0 +1,6 @@
# -*- mode: snippet -*-
# name: count
# key: cnt
# --
auto n = std::count(std::begin(${1:container}), std::end($1), $2);
$0

View File

@@ -0,0 +1,8 @@
# -*- mode: snippet -*-
# name: const_[]
# key: c[
# --
const ${1:Name}& operator[](${2:int index}) const
{
$0
}

View File

@@ -0,0 +1,8 @@
# -*- mode: snippet -*-
# name: constructor
# key: ct
# --
${1:Name}::$1(${2:args}) ${3: : ${4:init}}
{
$0
}

View File

@@ -0,0 +1,8 @@
# -*- mode: snippet -*-
# contributor: York Zhao <gtdplatform@gmail.com>
# name: cout
# key: cout
# --
`(progn (goto-char (point-min)) (unless (re-search-forward
"^using\\s-+namespace std;" nil 'no-errer) "std::"))
`cout << $0${1:} << "${2:\n}";

View File

@@ -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

View File

@@ -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

View File

@@ -0,0 +1,6 @@
# -*- mode: snippet -*-
# name: copy_n
# key: cpn
# --
std::copy_n(std::begin(${1:container}), $2, std::end($1));
$0

View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: cpp
# key: cpp
# --
#include "`(file-name-nondirectory (file-name-sans-extension (buffer-file-name)))`.h"

View File

@@ -0,0 +1,6 @@
# -*- mode: snippet -*-
# name: copy
# key: cpy
# --
std::copy(std::begin(${1:container}), std::end($1), std::begin($2));
$0

View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: cstd
# key: cstd
# --
#include <cstdlib>

View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: d+=
# key: d+=
# --
${1:Name}& operator+=(${2:const $1 &});

View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: d_operator<<
# key: <<
# --
friend std::ostream& operator<<(std::ostream&, const ${1:Name}&);

View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: d_operator[]
# key: [
# --
${1:Name}& operator[](${2:int index});

View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: d_operator[]_const
# key: c[
# --
const ${1:Name}& operator[](${2:int index}) const;

View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: d_operator>>
# key: >>
# --
friend std::istream& operator>>(std::istream&, const ${1:Name}&);

View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: d_operator<<
# key: <<
# --
friend std::ostream& operator<<(std::ostream&, const ${1:Name}&);

View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: delete
# key: dl
# --
delete ${1:pointer};

View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: delete[]
# key: dla
# --
delete[] ${1:arr};

View File

@@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# name: doc
# key: doc
# --
/**
* $0
*/

View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: dynamic_casting
# key: cast
# --
check_and_cast<${1:Name} *>(${2:msg});

View File

@@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# name: enum
# key: enum
# --
enum ${1:NAME}{
$0
};

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -0,0 +1,6 @@
# -*- mode: snippet -*-
# name: fill
# key: fil
# --
std::fill(std::begin(${1:container}), std::end($1), $2);
$0

View File

@@ -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

View File

@@ -0,0 +1,9 @@
# -*- mode: snippet -*-
# name: fixture
# key: fixt
# --
BOOST_FIXTURE_TEST_SUITE( ${1:name}, ${2:Fixture} )
$0
BOOST_AUTO_TEST_SUITE_END()

View File

@@ -0,0 +1,6 @@
# -*- mode: snippet -*-
# name: fill_n
# key: fln
# --
std::fill_n(std::begin(${1:container}), $2, $3);
$0

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# name: fori
# key: fori
# --
for (${1:auto }${2:it} = ${3:var}.begin(); $2 != $3.end(); ++$2) {
$0
}

View File

@@ -0,0 +1,8 @@
# -*- mode: snippet -*-
# name: for_each
# key: fre
# --
std::for_each(std::begin(${1:container}), std::end($1), []($2) {
$3
});
$0

View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: friend
# key: fr
# --
friend $0;

View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: fun_declaration
# key: f
# --
${1:type} ${2:name}(${3:args})${4: const};

View File

@@ -0,0 +1,8 @@
# -*- mode: snippet -*-
# name: generate_n
# key: gnn
# --
std::generate_n(std::begin(${1:container}), $2, []($3) {
$4
});
$0

View File

@@ -0,0 +1,8 @@
# -*- mode: snippet -*-
# name: generate
# key: gnr
# --
std::generate(std::begin(${1:container}), std::end($1), []($2) {
$3
});
$0

View File

@@ -0,0 +1,6 @@
# -*- mode: snippet -*-
# name: gtest
# key: gtest
# group: testing
# --
#include <gtest/gtest.h>

View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: ignore
# key: ignore
# --
${1:std::}cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n');

View File

@@ -0,0 +1,8 @@
# -*- mode: snippet -*-
# name: is_heap
# key: ihp
# --
if (std::is_heap(std::begin(${1:container}), std::end($1))) {
$2
}
$0

View File

@@ -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

View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: inline
# key: il
# --
inline $0

View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: io
# key: io
# --
#include <iostream>

View File

@@ -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

View File

@@ -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

View File

@@ -0,0 +1,8 @@
# -*- mode: snippet -*-
# name: is_sorted
# key: iss
# --
if (std::is_sorted(std::begin(${1:container}), std::end($1))) {
$2
}
$0

View File

@@ -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

View File

@@ -0,0 +1,6 @@
# -*- mode: snippet -*-
# name: iota
# key: ita
# --
std::iota(std::begin(${1:container}), std::end($1), $2);
$0

Some files were not shown because too many files have changed in this diff Show More