From a345a6ef4ea29dcbcc1d14e8dacb6ee00653db57 Mon Sep 17 00:00:00 2001 From: Bertrand Benjamin Date: Tue, 11 Aug 2020 16:50:24 +0200 Subject: [PATCH] Feat: import ultisnips snippets --- files/dotfiles/ultisnips/python.snippets | 25 +++++++++++++ files/dotfiles/ultisnips/rst.snippets | 45 ++++++++++++++++++++++++ tasks/dotfiles.yml | 11 ++++++ 3 files changed, 81 insertions(+) create mode 100644 files/dotfiles/ultisnips/python.snippets create mode 100644 files/dotfiles/ultisnips/rst.snippets diff --git a/files/dotfiles/ultisnips/python.snippets b/files/dotfiles/ultisnips/python.snippets new file mode 100644 index 0000000..caf3f05 --- /dev/null +++ b/files/dotfiles/ultisnips/python.snippets @@ -0,0 +1,25 @@ +# A valid snippet should starts with: +# +# snippet trigger_word [ "description" [ options ] ] +# +# and end with: +# +# endsnippet +# +# Snippet options: +# +# b - Beginning of line. +# i - In-word expansion. +# w - Word boundary. +# r - Regular expression +# e - Custom context snippet +# A - Snippet will be triggered automatically, when condition matches. +# +# Basic example: +# +# snippet emitter "emitter properties" b +# private readonly ${1} = new Emitter<$2>() +# public readonly ${1/^_(.*)/$1/}: Event<$2> = this.$1.event +# endsnippet +# +# Online reference: https://github.com/SirVer/ultisnips/blob/master/doc/UltiSnips.txt diff --git a/files/dotfiles/ultisnips/rst.snippets b/files/dotfiles/ultisnips/rst.snippets new file mode 100644 index 0000000..c5a82d6 --- /dev/null +++ b/files/dotfiles/ultisnips/rst.snippets @@ -0,0 +1,45 @@ +# A valid snippet should starts with: +# +# snippet trigger_word [ "description" [ options ] ] +# +# and end with: +# +# endsnippet +# +# Snippet options: +# +# b - Beginning of line. +# i - In-word expansion. +# w - Word boundary. +# r - Regular expression +# e - Custom context snippet +# A - Snippet will be triggered automatically, when condition matches. +# +# Basic example: +# +# snippet emitter "emitter properties" b +# private readonly ${1} = new Emitter<$2>() +# public readonly ${1/^_(.*)/$1/}: Event<$2> = this.$1.event +# endsnippet +# +# Online reference: https://github.com/SirVer/ultisnips/blob/master/doc/UltiSnips.txt +snippet index "Structure for an index file" b +${1:title} +${1/./#/g} + +:date: ${2:`date +%Y-%m-%d`} +:modified: ${2} +:authors: Bertrand Benjamin +:category: ${3} +:summary: ${1} +endsnippet + +snippet link "link" i +\`${1:link title} <${2:link target}>\`_ +endsnippet + +snippet img "Image" b +.. image:: ${1:filename} + :height: 200px + :alt: ${2:Description} +endsnippet diff --git a/tasks/dotfiles.yml b/tasks/dotfiles.yml index 50ce291..d272f1b 100644 --- a/tasks/dotfiles.yml +++ b/tasks/dotfiles.yml @@ -168,3 +168,14 @@ group: "{{ item.group }}" with_items: "{{ dotusers }}" when: not server + +# coc snippets +- name: dotfiles -- Copying snippets + file: + src: files/dotfiles/ultisnips + dest: /home/{{ item.username }}/.config/coc/ultisnips + state: directory + owner: "{{ item.username }}" + group: "{{ item.group }}" + with_items: "{{ dotusers }}" + when: prompt == 'fish'