Closed eemed closed 4 years ago
I am using skeleton files to template certain filetype files. I would like to move these to use miniSnip functionality for vimscript evaluation. Is it possible to trigger a certain snippet from an autocmd BufNewFile?
autocmd BufNewFile
Yes, it is possible by combining :h :normal and :h i_CTRL-R_=. For example, to insert snippet hello into C file:
:h :normal
:h i_CTRL-R_=
hello
autocmd BufNewFile *.c exec "norm! i" . 'hello' . "\<C-r>=miniSnip#trigger()\<CR>"
I am using skeleton files to template certain filetype files. I would like to move these to use miniSnip functionality for vimscript evaluation. Is it possible to trigger a certain snippet from an
autocmd BufNewFile
?