-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Temporary insert mode #14
Comments
|
To me a fast way to reenter the last submode (#15) would probably solve the need for this entirely and would provide a very fluid workflow. |
First of all, submodes are never sticky by design. Submodes are like Visual mode on Normal mode. Like
What commands are "complex"? It depends on users' tastes. And some commands preserve the last submode while other commands don't so? It's totally inconsistent. |
FYI these issues are just thinking out loud, I am in no way insistent on these features. For the sake of argument, of course it depends on the user's taste: It would be the responsibility of the user anyway to define such special mappings. There should be no sticky mode by default at all, the general behaviour of submode is just fine. But giving users the chance to customize things is a good thing, it's their decision after all what they want to do. I'll gladly close this issue again, as I agree that it's a little bit overboard and a too opinionated feature. I still think it would be a good idea to have an API for setup/teardown (#16) and entering/leaving (#17). Such an interface would provide a user with all the tools he needs to do quite a lot of things with submodes - whatever it is he wants to do then is totally his decision. |
Feature proposal mentioned in #13
This has been talked about in #1 already (btw, hi again @suy) and is relatively easy to implement. I'd say this makes only sense when you invoke it from a normal mode submode anyway, so I didn't try it for any other modes. I implemented a
submode#temporary_insert_mode
function, meant to be therhs
of a mapping as insubmode#map('submode', 'n, '', 'i', ':call submode#temporary_insert_mode()<cr>'
The function leaves the current submode, enters insert mode and defines an
augroup
that holds anaucmd
triggered by theInsertLeave
event which reenters the submode that has just been left. The reenter function clears the aforementionedaugroup
again, so that we aren't left with any deadweight afterwards.The text was updated successfully, but these errors were encountered: