Skip to content
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

Exit insert mode when changing tabs #314

Closed
terminalmage opened this issue Mar 7, 2011 · 9 comments
Closed

Exit insert mode when changing tabs #314

terminalmage opened this issue Mar 7, 2011 · 9 comments

Comments

@terminalmage
Copy link

I like using the Vimium tab navigation shortcuts, but if I leave a tab in insert mode and use the normal Alt+number shortcuts to switch to a specific tab, then start cycling through tabs again using the Vimium shortcuts, the tab switching will stop once I get to a tab that is still in insert mode, until I hit Esc to go back to command mode. It would be nice if, when I leave a tab, it reverts back to command mode.

I understand this may not be a default behavior that many people want, but perhaps this could be something that is configurable in the Options menu.

@int3
Copy link
Collaborator

int3 commented Jan 9, 2012

I'd like this, and I think it should be the default -- it seems to me that most people would not have a need for tabs to remain permanently in insert mode. @philc and @ilya, what do you guys think?

@philc
Copy link
Owner

philc commented Jan 10, 2012

I don't use insert mode much, but when I do it's because I want Vimium to pass keystrokes through to the underlying webpage. In that use case it's nice to have it persist until I unset it using esc.

@int3
Copy link
Collaborator

int3 commented Jan 11, 2012

Hmm -- if I understand your use case correctly, you're explicitly activating insert mode to turn Vimium off on certain pages. How about having explicit insert mode be persistent, but implicit insert mode (enterInsertModeWithoutShowingIndicator) exit upon tab switch?

@philc
Copy link
Owner

philc commented Jan 11, 2012

Sounds like a good idea Jez, assuming the code doesn't become significantly harder to understand because of it.

@int3 int3 closed this as completed in 9e14b51 Jan 13, 2012
@philc
Copy link
Owner

philc commented Jan 14, 2012

Let's keep an eye on this behavior after the next release to see if people consider this behavior a regression.

@int3
Copy link
Collaborator

int3 commented Jan 27, 2012

After a few weeks of using this, I have to say that I am growing to dislike it. Particularly, when switching back-and-forth between two tabs quickly, I often forget that I am no longer in insert mode and I end up typing a bunch of Vimium commands. I'm thinking of two alternatives:

  1. Exit insert mode only if the switched-to tab is not adjacent, i.e. the user used Alt- rather than Ctrl-Tab.
  2. Have the equivalent of Alt-<num> as Vimium commands -- perhaps g-<num>. Since g-<num> will only work in normal mode, if the user is trained to rely on g-<num> rather than Alt-<num>, he will remember to explicitly exit insert mode every time before making a tab switch.

@philc
Copy link
Owner

philc commented Jan 27, 2012

The problem with #2 is we need to train the user. Cmd+# works for every OSX app and is ingrained in many users muscble memory. Since it's a universal shortcut and does exactly what g-# does, I would always prefer to use that instead of g-# for switching tabs.

@philc
Copy link
Owner

philc commented Feb 13, 2012

@int3, should we revert this for now?

@philc philc reopened this Feb 13, 2012
@int3
Copy link
Collaborator

int3 commented Feb 24, 2012

Apparently Pentadactyl also exits upon tab switch. I think the reason I haven't found it to be a problem there is because their inbuilt tab-switching commands work much better, so I'm in the habit of always exiting insert mode before switching tabs. In particular pressing Esc to exit insert mode doesn't change the state of the page (c.f. Facebook chat window issue), and more importantly, the keyboard shortcuts work all the time, so there's no need to resort to ctrl-tab to avoid getting stuck on partially loaded tabs. Let's back this out for now and reconsider when global hotkeys land.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants