From 77c95fbb15af968d260f829f8e0c0c221fb56d56 Mon Sep 17 00:00:00 2001 From: Yigit Sever Date: Thu, 6 Jan 2022 21:10:41 +0300 Subject: nvim: new snippets --- .config/nvim/my_snippets/c.snippets | 12 ++++++++++++ .config/nvim/my_snippets/tex.snippets | 5 +++++ 2 files changed, 17 insertions(+) create mode 100644 .config/nvim/my_snippets/c.snippets (limited to '.config/nvim/my_snippets') diff --git a/.config/nvim/my_snippets/c.snippets b/.config/nvim/my_snippets/c.snippets new file mode 100644 index 0000000..d4522f2 --- /dev/null +++ b/.config/nvim/my_snippets/c.snippets @@ -0,0 +1,12 @@ +# vim:ft=snippets: +priority 100 + +snippet if "if only" b +if (${1:true}) { + ${0:{VISUAL}} +} +endsnippet + +snippet trace "printf trace baby" b +printf("TRACE: ${1} (`!v b:vista_nearest_method_or_function`:`!v line(".")`)\n"${2});$0 +endsnippet diff --git a/.config/nvim/my_snippets/tex.snippets b/.config/nvim/my_snippets/tex.snippets index f81ad94..9941420 100644 --- a/.config/nvim/my_snippets/tex.snippets +++ b/.config/nvim/my_snippets/tex.snippets @@ -106,6 +106,11 @@ snippet '([A-Za-z])(\d)' "auto subscript" wrA `!p snip.rv = match.group(1)`_`!p snip.rv = match.group(2)` endsnippet +context "math()" +snippet -> "auto rightarrow" wrA +\rightarrow +endsnippet + context "math()" snippet '([A-Za-z])_(\d\d)' "auto subscript2" wrA `!p snip.rv = match.group(1)`_{`!p snip.rv = match.group(2)`} -- cgit v1.2.3-70-g09d2