When I press Ctrl+Tab, Ctrl+Shift+Tab or Ctrl+W the tab I get switched to is not the one just near the one I was on (as I would like to) but to some else. When I press Ctl+N the new tab is created right near the tab I am at while I always want it to be created at the end of the tabs list. How to configure it to achieve the behaviour I desire?
3 Answers
To achieve the Ctrl+Tab and Ctrl+Shift+Tab behavior you can add the following lines to your sublime-keymap
:
{ "keys": ["ctrl+tab"], "command": "next_view" },
{ "keys": ["ctrl+shift+tab"], "command": "prev_view" }
To open sublime-keymap
:
- click "Preferences"
- click "Key Bindings"
- You will see two settings file, select a file that named "User"
This is a visual example on how it should look.

- 40,416
- 14
- 65
- 133

- 4,376
- 1
- 21
- 16
-
1Thanks. What about changing where does a new tab appear and where do I get when I close a tab? – Ivan Aug 29 '14 at 15:14
-
Unfortunately these other configs I haven't been able to achieve yet :\ – Miguelgraz Aug 29 '14 at 15:16
-
2@Miguelgraz See my answer for a solution to new file. – skuroda Aug 29 '14 at 18:52
-
45For people who don't know how to directly edit the `sublime-keymap` (like me): Click preferences -> Key Bindings - User. Copy above code in the file (between the brackets) – Mathias711 Jan 13 '15 at 08:12
-
91 little side note, if your user key bindings file is completely empty, put the above code between these: `[` key bindings here `]`. After one frustrating our finally found that out, so I hope that this will help somebody in the future. – Mathlight Feb 17 '15 at 21:31
-
Totally true @Mathlight, I'm really sorry I forgot to mention that. – Miguelgraz Feb 19 '15 at 17:02
-
Using Sublime Text 2 here, and awesome, working just fine - thanks for this! Now if only I could figure out how to keep this behaviour when *closing* a tab... – Breakthrough Aug 06 '15 at 02:17
-
1@Breakthrough What do you mean? – Jay Jun 06 '16 at 17:00
-
is there still no way to open new tabs at the end of the tab list (without using a plugin)? thanks for your help! – Crashalot Dec 28 '20 at 01:28
With the default key bindings, ControlPage Up and ControlPage Down will allow you to move right and left among your open tabs, respectively, in their visual order. (The keybinding solution replicates this functionality using your preferred keys.)
Because the package installer is now included with Sublime Text, it's also straightforward to add the MoveTab extension, which adds the shortcuts ShiftControlPage Up and ShiftControlPage Down to move the current tab within that visual order.
To access the package installer in Sublime Text 3 (in Windows, anyway), type ShiftControlp, then Package Control: Install Package
.

- 353
- 1
- 12
You can use a plugin to get the new file behavior you want.
import sublime_plugin
class MyNewFile(sublime_plugin.WindowCommand):
def run(self):
window = self.window
view = window.new_file()
active_group = window.active_group()
views_in_group = window.views_in_group(active_group)
window.set_view_index(view, active_group, len(views_in_group) - 1)
Save the above in Packages/User
as <somename>.py
. Then use the command my_new_file
in your key binding for ctrl+n
I wouldn't be surprised if there was aplugin to do this already, but it's pretty simple, so easier to write it yourself, than to search package control :) You can likely lose a plugin to do what you want for ctrl+w
also, but you didn't describe the behavior you wanted.

- 19,514
- 4
- 50
- 34
-
I have described the behaviour I want for Ctrl+W - close the active tab and move to the tab right near (now it closes the active tab and moves to some other tab, using the same logic as Ctrl+Tab does by default most probably). – Ivan Sep 02 '14 at 14:28
-
I think https://github.com/facelessuser/TabsExtra will do what you want. The default logic looks to fallback to the right. I haven't used the plugin, but by description it looks correct. – skuroda Sep 03 '14 at 02:10