From d29cfc6aab19fb9b1514b8931e9d204e5b87062d Mon Sep 17 00:00:00 2001 From: "Kenneth Benzie (Benie)" Date: Thu, 30 Mar 2023 15:28:42 +0100 Subject: [PATCH] Remove support for _template snippets --- UltiSnips/help.snippets | 10 ---------- autoload/snippet.vim | 16 ---------------- plugin/autocmds.vim | 4 ---- 3 files changed, 30 deletions(-) delete mode 100644 autoload/snippet.vim diff --git a/UltiSnips/help.snippets b/UltiSnips/help.snippets index f4551ce..1388ffa 100644 --- a/UltiSnips/help.snippets +++ b/UltiSnips/help.snippets @@ -1,13 +1,3 @@ -snippet _template "help file template" -*`!p snip.rv = snip.fn`* For Vim version 8.0 Last change: `!p -from datetime import datetime -snip.rv = datetime.now().strftime('%B %d, %Y')` - -$0 - - vim:tw=78:ts=8:ft=help:norl: -endsnippet - snippet s "help section" ============================================================================== ${1:1}. ${2:Section}`!p diff --git a/autoload/snippet.vim b/autoload/snippet.vim deleted file mode 100644 index 90f163f..0000000 --- a/autoload/snippet.vim +++ /dev/null @@ -1,16 +0,0 @@ -" Description: Expand snippet on file creation. - -" Attempt to expand the _template snippet if this is a new file. -" https://noahfrederick.com/log/vim-templates-with-ultisnips-and-projectionist -function! snippet#template() abort - " Return if non-empty buffer or file exists. - if !(line('$') == 1 && getline('$') ==# '') || filereadable(expand('%')) - return - endif - " Attempt to expand the _template snippet. - execute "normal! i_template\=UltiSnips#ExpandSnippet()\" - if g:ulti_expand_res == 0 - " Expansions failed, undo insert. - silent! undo - endif -endfunction diff --git a/plugin/autocmds.vim b/plugin/autocmds.vim index a5cdfb1..05572fb 100644 --- a/plugin/autocmds.vim +++ b/plugin/autocmds.vim @@ -18,10 +18,6 @@ augroup benieAugroup " Read template into buffer then send line 1 to the black hold register au BufNewFile todo.md read ~/.vim/templates/skeleton.todo.md | 1delete _ - " Attempt to expand snippet named `_template` if it exists - au BufNewFile * silent! call snippet#template() - " Do the same when filetype changes to help - au FileType help silent! call snippet#template() " Augment vim-signify by modifying it's autocmds au User SignifyAutocmds call do#signify()