-
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
Feature: only exit a submode explicitly #1
Comments
Thank you for the feedback. I'll consider it later. But I wrote vim-submode as a proof of concept and it has been 2 or more years since the first commit. So that it might take a long time to load the details of vim-submode into my brain... |
Did you mean that you don't want timeout in a submode? If so, set |
In general, I want timeout, but for this kind of submode it probably should be disabled since I would like to exit the submode only explicitly. Feel free to mark the issue as 'wontfix', since now that I think about more deeply, I understand that is probably changing this plugin too much. I probably should try making vim-space more configurable instead (I like a lot how you can configure vim-submode, and the other plugin doesn't allow to use any other key besides , which I don't like at all). |
So, what you want is per-submode timeout, isn't it? |
That, yes, but also be able to say "for this submode, this key is mapped to that, and all other keys instead of exiting the submode, do what they normally do instead of interrupting the submode". That way I could make a submode for "diff-mode", and while I'm on that mode, have some shortcuts for navigating through changes with easier keys, but still be able to enter insert mode and fix a typo. When I'm done, I could exit the submode explicitly by pressing the key configured with submode#leave_with(). As I said, maybe it changes too much the way the plugin works, so don't worry at all if you don't want to implement it! The way it is right now is still very helpful. |
Okay, I've realized that. But it's not possible to implement that fully. For example, Visual mode can be treated as a submode for Normal mode. Though we can enter Insert mode from Visual mode ( Like this, once we enter to another mode from a submode, we can not return to the submode directly.
If I understand correctly, the workflow you want is as follows?
Currently, Though there might be ways to implement that, they're ad hoc or not generic to support all cases. |
Hi Kana. You got right the workflow I suggested. I've been giving this some thought, and you are right, it's probably too complex what I suggested, and might not fully make sense. Thanks for considering it, and feel free to close the issue. |
Just a comment. Suy, I myself want 'view-only' mode which map some basic 'f,b,u,d' keys to |
Hello.
First, I want to congratulate you for vim-submode and your many other great plugins. I like them a lot! And I've just started trying them.
I've been using vim-submode with great pleasure to navigate the changelist and resize windows, but I've found a case in which it would be great if submodes could only be exited explicitly, so you could operate vim normally, and still have available the shortcuts that one has defined for the submode.
The case is: you are in vimdiff mode, and want to navigate the changes, so you create a submode to avoid having to type the tedious ]c]c]c. But in the middle you want to diffget and diffput, so you map something to do it. But now you realize there is a typo in a line, so you have to exit the mode, fix it, and enter it again to continue inspecting. Is not a big deal at all, but it could be even better if you could exit the submode only after or any other key the user has defined.
I don't know if it's possible or easy to do, but if it serves as an inspiration, there is a plugin named vim-space that does something similar: after some "hook" like ]c, g+ or g; it maps and to provide a sort of "generic next/previous". You operate Vim normally, but you still have those shortcuts available.
I like vim-submode a lot more, though, since is much more powerful and configurable, but I would love if it could have this feature too.
Thank you very much, and seriously, congratulations for your plugins, because some (like this) blew my mind when I first saw them.
The text was updated successfully, but these errors were encountered: