Oops, I take it back -- it doesn't work :) вторник, 11 января 2022 г. в 09:31:54 UTC+3, Maxim Kim:
> Following: > > import autoload 'comment.vim' > nnoremap <silent> <expr> gc comment.Toggle() > xnoremap <silent> <expr> gc comment.Toggle() > nnoremap <silent> <expr> gcc comment.Toggle() .. '_' > > Now works (as of 8.2.4058) > понедельник, 10 января 2022 г. в 15:17:40 UTC+3, Bram Moolenaar: > >> >> 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 -- br...@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/150ae53a-06c2-41ad-9e1c-2f45a62a3452n%40googlegroups.com.