Make ctrl+tab only cycle tabs in current group (and in order of appearance)

T-R 13 років тому оновлено Aleksandr Beliaev 8 років тому 8
I find the ctrl+tab behavior a little hard to follow at times. Since we have ctrl+1/2/3 to change focus to different groups, could the behavior be changed (possibly via a setting) so that it only cycles through tabs in the current group?
Also, could we have a setting to make ctrl+tab cycle in the order the tabs appear, similar to Chrome.  In chrome I tend to order my tabs according to how often I'll be switching to them, it would be nice to be able to do the same with SublimeText.
You can change the key bindings so that Ctrl+tab and Ctrl+shift+tab works in the same way as Google Chrome.

Put this in your User keymap file. (Preferences -> Key Bindings - User)

    { "keys": ["ctrl+tab"], "command": "next_view" },
    { "keys": ["ctrl+shift+tab"], "command": "prev_view" }

This will still loop through all open tabs, as opposed to all in current pane.


I agree. We should only be able to cycle through the tabs in the current focus group. On OSX the commands to switch to previous/next tabs are:




Almost. In Sublime Text 2, the exact code is:

   { "keys": ["ctrl+tab"], "command": "next_view" },
   { "keys": ["ctrl+shift+tab"], "command": "prev_view" }


This should be the default behaviour. Keyboard shortcuts should behave predictably. The point of keyboard shortcuts is to make you faster. 

Sure, but not everybody has the same set of "default fastest" keybindings in their head.  That's why we have customization.


this should do what you're looking for: https://github.com/borist/SublimePaneNavigation

Here's the quick ST3 plugin that would allow to go to the last tab in the active group:

import sublime, sublime_plugin

class GotolasttabCommand(sublime_plugin.WindowCommand):
	def run(self):
		activegroup = self.window.active_group()
		self.window.focus_view(self.window.views_in_group(activegroup)[len(self.window.views_in_group(activegroup)) - 1])