On Sat, Apr 5, 2014 at 4:09 PM, Bram Moolenaar <[email protected]> wrote: > > Ben Fritz wrote: > >> On Saturday, April 5, 2014 2:02:23 PM UTC-5, Bram Moolenaar wrote: >> > >> > You can record into a register and replay that. >> > >> >> This is not an option for the desired use case, of creating a plugin >> to automatically insert closing parentheses and the like as you type >> the opening character. For that we need to be able to move the cursor >> in insert mode without breaking undo and without knowing in advance >> that we need to be recording a macro. One cannot start recording a >> macro with a mapping, 'q' does not function in a mapping according to >> the help. So the user would manually need to start recording before >> typing every single time, so mapping every insert-mode entry key would >> not only be annoying, it wouldn't work. Plus, one would want a plugin >> such as this to be itself recordable in a macro, which can't be done >> if you must record a macro to accomplish the task. > > I have no clue how you could repeat the changes a plugin makes with ".". > The plugin could do anything, with any kind of advanced logic. How > would "." know what to repeat? It can't possibly know that you inserted > ")" in a specific place and repeat that. >
Well at least we could join the undo sequence so u/<C-R> work properly afterward. Potentially repeat.vim can help here. I know that by abusing setline() in previous versions of Vim, delimitMate and other plugins managed to get this working. But now nobody seems to have found a working hack. It would be better to support it intentionally. For example, with an insert-mode command to chain two changes together. :undojoin works for arbitrary ex commands. Why can't we have something similar for insert mode segments? -- -- 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 [email protected]. For more options, visit https://groups.google.com/d/optout.
