Yes it works also as this : *in vimfiles/helper/autoload/helper.vim* export def TestExportedFunc(): void echomsg 'Exported Func Test is well imported and called for file ' .. expand("%:p") enddef
*in _vimrc* if has('autocmd') autocmd BufEnter *.h,*.cpp call that.TestExportedFunc() Thank you Doug Nicolas Le mardi 18 octobre 2022 à 14:38:07 UTC+2, Doug Kearns a écrit : > On Sun, 16 Oct 2022 at 08:17, Nicolas <niva...@gmail.com> wrote: > > > > Hi, > > > > Using some stuff in helper and calling them through autocommand defined > in _vimrc, > > it seems called vim9 def function is just called one time. > > > > > > This is the autocmd in _vimrc > > import './vimfiles/plugged/nv-helper.vim/autoload/nvhelper.vim' as that > > autocmd BufEnter *.h,*.cpp :call that.TestImportedFunc() > > > > This is the vim9 func: > > export def TestImportedFunc(): void > > echomsg 'Imported Func is well called and tested.' > > enddef > > > > > > Don't understand why only on first buffer as cpp, the echomsg of this > func so this func is called: just one time ? > > It works for me with Vim 9.0.0769. > > Regards, > Doug > -- -- You received this message from the "vim_use" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_use" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/d3e50a8b-efb8-4639-8ffd-2f4c9bf6e359n%40googlegroups.com.