summaryrefslogtreecommitdiff
path: root/.vim/mySnippets
diff options
context:
space:
mode:
authorUrbain Vaes <urbain@vaes.uk>2015-08-08 20:08:42 +0200
committerUrbain Vaes <urbain@vaes.uk>2015-08-08 20:08:42 +0200
commit8df9472e0cdbab0d12211c2bc77918e8f515c409 (patch)
treef420b705adfec42bb33191c44c8fe252fca0f785 /.vim/mySnippets
parentb8a9b07b741cddbf6e0476e70c94aa186d62b6ae (diff)
Improve installation and organization
Diffstat (limited to '.vim/mySnippets')
-rw-r--r--.vim/mySnippets/all.snippets25
-rw-r--r--.vim/mySnippets/cpp.snippets35
-rw-r--r--.vim/mySnippets/mail.snippets33
-rw-r--r--.vim/mySnippets/python.snippets4
-rw-r--r--.vim/mySnippets/tex.snippets110
-rw-r--r--.vim/mySnippets/vim.snippets0
6 files changed, 207 insertions, 0 deletions
diff --git a/.vim/mySnippets/all.snippets b/.vim/mySnippets/all.snippets
new file mode 100644
index 0000000..8094025
--- /dev/null
+++ b/.vim/mySnippets/all.snippets
@@ -0,0 +1,25 @@
+global !p
+def make_comment():
+ b, e = vim.eval("&commentstring").split( '%s' )
+ return b, e
+endglobal
+
+snippet todo "A universal TODO reminder" b
+`!p
+comment = make_comment()
+snip.rv = comment[ 0 ]
+` TODO: ${1:desc} (`!v $USER`, `!v strftime("%c")`) `!p
+comment = make_comment()
+snip.rv = comment[ 1 ]`
+$0
+endsnippet
+
+snippet fix "A universal FIXME reminder" b
+`!p
+comment = make_comment()
+snip.rv = comment[ 0 ]
+` FIXME: ${1:desc} (`!v $USER`, `!v strftime("%c")`) `!p
+comment = make_comment()
+snip.rv = comment[ 1 ]`
+$0
+endsnippet
diff --git a/.vim/mySnippets/cpp.snippets b/.vim/mySnippets/cpp.snippets
new file mode 100644
index 0000000..d314641
--- /dev/null
+++ b/.vim/mySnippets/cpp.snippets
@@ -0,0 +1,35 @@
+snippet print_mat "Print matrix" b
+for (unsigned int iii = 0; iii < ${1:mat}.size(); ++iii) {
+ cout << setw(12) << $1[iii][0];
+ for (unsigned int jjj = 1; jjj < $1.size(); ++jjj) {
+ cout << ", ";
+ cout << setw(12) << $1[iii][jjj];
+ }
+ cout << endl;
+}
+$0
+endsnippet
+
+snippet print_vec "Print vector" b
+for (unsigned int iii = 0; iii < ${1:mat}.size(); ++iii) {
+ cout << setw(12) << $1[iii];
+ cout << endl;
+}
+$0
+endsnippet
+
+snippet forij "Matrix iteration" b
+for (int ${2:i} = 0; $2 < ${1:count}; $2++) {
+ for (int ${4:j} = 0; $4 < $1; $4++) {
+ ${5}
+ }
+}
+endsnippet
+
+snippet vec "vector" i
+vector<${1:double}> $0
+endsnippet
+
+snippet mat "matrix" i
+vector< vector<${1:double}> > $0
+endsnippet
diff --git a/.vim/mySnippets/mail.snippets b/.vim/mySnippets/mail.snippets
new file mode 100644
index 0000000..9839916
--- /dev/null
+++ b/.vim/mySnippets/mail.snippets
@@ -0,0 +1,33 @@
+snippet best "Best wishes" b
+Best wishes,
+
+Urbain
+endsnippet
+
+snippet dear "Email template" b
+Dear ${1:Greg},
+
+${2:# Body of the message}
+
+Best wishes,
+
+${3:Urbain}
+endsnippet
+
+snippet sign "Signature" b
+Best wishes,
+
+Urbain Vaes
+Department of Mathematics
+Office 6M09
+endsnippet
+
+snippet bisous "Gros bisous" b
+Gros bisous,
+
+Urbain
+endsnippet
+
+snippet look "I'm looking forward to ..." b
+I am looking forward to hearing from you,
+endsnippet
diff --git a/.vim/mySnippets/python.snippets b/.vim/mySnippets/python.snippets
new file mode 100644
index 0000000..6dbc272
--- /dev/null
+++ b/.vim/mySnippets/python.snippets
@@ -0,0 +1,4 @@
+snippet fori "for loop over range" b
+for ${1:i} in range(${2:n}):
+ ${0:pass}
+endsnippet
diff --git a/.vim/mySnippets/tex.snippets b/.vim/mySnippets/tex.snippets
new file mode 100644
index 0000000..9c74845
--- /dev/null
+++ b/.vim/mySnippets/tex.snippets
@@ -0,0 +1,110 @@
+snippet real "Field of real numbers" i
+\real
+endsnippet
+
+snippet grad "Gradient" i
+\grad
+endsnippet
+
+snippet div "Divergence" i
+\dive
+endsnippet
+
+snippet new "New command" b
+\newcommand{$1}[$2]{$3}$0
+endsnippet
+
+snippet op "Operator style" i
+\op
+endsnippet
+
+snippet pard "Partial derivative" i
+\pardl{$1}{$2}$0
+endsnippet
+
+snippet pardd "Double partial derivative" i
+\parddl{$1}{$2}$0
+endsnippet
+
+snippet herm "Hermite polynomials" i
+\hermite
+endsnippet
+
+snippet red "Red text" i
+\red{$1}$0
+endsnippet
+
+snippet sumi "Sum over index set" i
+\sum_{${1:i} \in ${2:I}}$0
+endsnippet
+
+snippet int "Integral" i
+\int_{$1}
+endsnippet
+
+snippet ip "Inner product" i
+\ip{$1}{$2}$0
+endsnippet
+
+snippet ipw "Inner product" i
+\wip{$1}{$2}{$3}$0
+endsnippet
+
+snippet norm "Norm" i
+\norm{$1}$0
+endsnippet
+
+snippet normw "Weighted norm" i
+\wnorm{$1}{${2:\gamma}}
+endsnippet
+
+snippet test "Test functions" i
+\test{${1:\real^n}}$0
+endsnippet
+
+snippet lp "Lp spaces" w
+\lp{${1:exponent}}{${2:domain}}${3/^.+$/[/}${3:weight}${3/^.+$/]/}$0
+endsnippet
+
+snippet sob "Sobolev spaces" w
+\sobolev{${1:exponent}}{${2:domain}}${3/^.+$/[/}${3:weight}${3/^.+$/]/}$0
+endsnippet
+
+snippet cont "Continuous function" w
+\cont{$1}{$2}$0
+endsnippet
+
+snippet mean "Expectation" w
+\expect $0
+endsnippet
+
+snippet dot "Dot product" w
+\dotx
+endsnippet
+
+snippet abs "Absolute value" w
+\abs{ $1 }$0
+endsnippet
+
+snippet sum "Sum" w
+\sum_{${1:i=1}}^{${2:n}}
+endsnippet
+
+snippet smooth "Smooth function" w
+\smooth{${1:\real^n}} $0
+endsnippet
+
+snippet ref "Clever reference" w
+\cref{$1}$0
+endsnippet
+
+snippet frame "My frame snippet" b
+\begin{frame}
+ \frametitle{$1}
+ $0
+\end{frame}
+endsnippet
+
+snippet gauss "Gaussian density" w
+\gaussian{${1:\mu}}{${2:\Sigma}}$0
+endsnippet
diff --git a/.vim/mySnippets/vim.snippets b/.vim/mySnippets/vim.snippets
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/.vim/mySnippets/vim.snippets