Maxim Kim wrote:
> I have tried new way of autoload and for me it didn't work (windows > 8.2.4050) > > I have autoload/comment.vim: > > vim9script autoload > > # Toggle comments > # Usage: > # 1. Save in ~/.vim/autoload/comment.vim > # 2. Add following mappings to vimrc: > # import autoload 'comment.vim' > # nnoremap <silent> <expr> gc comment.Toggle() > # xnoremap <silent> <expr> gc comment.Toggle() > # nnoremap <silent> <expr> gcc comment.Toggle() .. '_' > export def Toggle(...args: list<string>): string > ... > > And in my ~/vimfiles/vimrc: > > import autoload 'comment.vim' > nnoremap <silent> <expr> gc comment.Toggle() > xnoremap <silent> <expr> gc comment.Toggle() > nnoremap <silent> <expr> gcc comment.Toggle() .. '_' > # nnoremap <silent> <expr> gc comment#toggle() > # xnoremap <silent> <expr> gc comment#toggle() > # nnoremap <silent> <expr> gcc comment#toggle() .. '_' > > After pressing gcc I get error: > > E121: Undefined variable: comment This isn't fully implemented yet. It turns out it's more complicated. Thanks for the example, I'll try it out after some more changes. -- GALAHAD: Camelot ... LAUNCELOT: Camelot ... GAWAIN: It's only a model. "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org /// -- -- You received this message from the "vim_dev" 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_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/vim_dev/20220110121734.21E991C051B%40moolenaar.net.