Remove support for _template snippets
This commit is contained in:
parent
024268db74
commit
d29cfc6aab
@ -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
|
||||
|
@ -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\<C-r>=UltiSnips#ExpandSnippet()\<CR>"
|
||||
if g:ulti_expand_res == 0
|
||||
" Expansions failed, undo insert.
|
||||
silent! undo
|
||||
endif
|
||||
endfunction
|
@ -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()
|
||||
|
Loading…
x
Reference in New Issue
Block a user