From 9373d75ab28fd7cb702f1a3c8812be2af28ad08c Mon Sep 17 00:00:00 2001 From: Ryan Reed Date: Wed, 22 Dec 2021 09:26:47 -0500 Subject: [PATCH] Updating snippet information --- dot_vim/README.md | 2 ++ dot_vim/UltiSnips/python.snippets | 8 +++++++- dot_vim/vimrc | 1 + 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/dot_vim/README.md b/dot_vim/README.md index 244390b..46debde 100644 --- a/dot_vim/README.md +++ b/dot_vim/README.md @@ -146,6 +146,8 @@ A more in depth example: You can edit the snippets for the current filetype that's open by using `:UltiSnipsEdit` +After making any changes to the snippets, run `:call UltiSnips#RefreshSnippets()` to refresh the snippets + **Important Note**: If using chezmoi, make sure to copy the snippet to the chezmoi repo so it isn't overwritten during next `chezmoi apply` diff --git a/dot_vim/UltiSnips/python.snippets b/dot_vim/UltiSnips/python.snippets index b517867..014563d 100644 --- a/dot_vim/UltiSnips/python.snippets +++ b/dot_vim/UltiSnips/python.snippets @@ -1,4 +1,10 @@ +snippet dataclass "Create a dataclass" +@dataclass +class ${1:MyClass}: + ${0} +endsnippet + snippet forkey "Enumerate an iterable for key/value pair" for ${1:key}, ${2:value} in enumerate(${3}): - pass + pass endsnippet diff --git a/dot_vim/vimrc b/dot_vim/vimrc index 8379426..b3f2404 100644 --- a/dot_vim/vimrc +++ b/dot_vim/vimrc @@ -101,6 +101,7 @@ let g:UltiSnipsListSnippets="" " list all snippets for current filetype let g:UltiSnipsJumpForwardTrigger="" let g:UltiSnipsJumpBackwardTrigger="" + let g:UltiSnipsEditSplit="context" " Split horizontally or vertically with the custom snippets " Plugin - vim-surround " This allows for surrounding test with something