switching between tabs in sublime "ctrl+tab" - sublimetext2

Anyone notice that the default ctrl+tab doesn't work like the typical consecutive tab switching from left to right, e.g., in Chrome? I'm trying to switch to the next adjacent tab, but it seems to jump around (alphabetic order I think).
How can I change the order in which sublime switches tabs?

The default behavior is to goto tab you have used at last. Just add this keybinding to your user keybindings:
{ "keys": ["ctrl+tab"], "command": "next_view" },
{ "keys": ["ctrl+shift+tab"], "command": "prev_view" },

In sublime text 3, there is shortcut to switch tab in similar to ctrl+tab in browser.
{ "keys": ["ctrl+pagedown"], "command": "next_view" },
{ "keys": ["ctrl+pageup"], "command": "prev_view" },
While this ctrl+tab has behavior similar to windows alt+tab to switch apps. CMIIW.
{ "keys": ["ctrl+tab"], "command": "next_view_in_stack" },
{ "keys": ["ctrl+shift+tab"], "command": "prev_view_in_stack" },
You can just make custom key binding and swap them around.
And for anyone looking for shortcut to move tab to left & right, there is a plugin for that.

please try command + shift + ] .This will bring you immediately to the next tab.
Command + Ctrl + P : Switch between the projects that are listed on the sublimeText Sidebar.

Related

In Sublime Text 3, how to have shortcuts for "Build and Run" and "Build only" separately like it was in Sublime Text 2?

In Sublime Text 3,when we press Ctrl+Shift+B, we are given the option to either do "Build and Run" or "only Build", whereas Ctrl+B executes the previously chosen operation among the two. But I want it to be like, it should directly build and run when I press Ctrl+Shift+B and only build when I press Ctrl+B like it was in Sublime Text 2. Can someone help me out?
Addings this to your sublime-keymap should result in the expected behavior:
{ "keys": ["ctrl+b"], "command": "build", "args": { "variant": "" } },
{ "keys": ["ctrl+shift+b"], "command": "build", "args": { "variant": "Run" } },
However you might want to remap keep the list of options to alt+b:
{ "keys": ["alt+b"], "command": "build", "args": { "select": true } },
Not answering the question but good to know, F7 functions the same as Ctrl+b.

Sublime Text Snippets Keyboard Shortcut

I want to create a custom key binding to trigger the Tools > Snippets overlay. I know sublime uses the show_overlay command and overlay enum, but after trial an error I can't figure out what to set the enum to.
{
"keys": ["shortcut"],
"command": "show_overlay", "args": {"overlay": "some_unknown_command"}
}
I'm not looking to insert a specific snippet, just trigger the overlay.
You can find the command by entering sublime.log_commands(True) in the ST console, then using the menu to display the overlay. It will give you the arguments and command you need to use.
{
"keys": [ <your keys here> ],
"command": "show_overlay",
"args": {
"overlay": "command_palette",
"text": "Snippet:"
}
}

Sublime Text: Changing binding for 'unfold' command

In Sublime Text we can change key bindings for our needs. But I can't find way to overwrite basic binding for unfold functionality. I have next code in my Key bindings - User file:
{ "keys": ["ctrl+keypad4"], "command": "fold" },
{ "keys": ["ctrl+keypad5]"], "command": "unfold" },
ctrl+keypad4 works as expected, but binding for ctrl+keypad5 not work at all. How to fix it?
I don't want to change global keymap.
You have an extra close bracket in there. It should be:
{ "keys": ["ctrl+keypad5"], "command": "unfold" },

Change "Next File" and "Previous File" shortcut in Sublime Text 2

I'm having no luck changing the key bindings for switching files in Sublime. Does anybody know that the deal is here? All i'm trying to achieve is cmd+] and cmd+[ to show next and previous files. Then i can use tab and shift+tab for all my indenting.
[
{ "keys": ["super+]"], "command": "Next File" },
{ "keys": ["super+["], "command": "Previous File" }
]
Thanks everyone!
This is actually what you might have been really looking for. I find it more useful to go back to the previous file I was working on, not moving left and right through the tabs. But you can have bindings to both behaviors.
// This is very useful, go back to the previously viewed file regardless of
// tab order
{ "keys": ["super+["], "command": "next_view_in_stack" },
{ "keys": ["super+]"], "command": "prev_view_in_stack" }
Try this:
[
{ "keys": ["ctrl+]"], "command": "next_view" },
{ "keys": ["ctrl+["], "command": "prev_view" }
]
Of course this goes into the "Key Bindings - User" file.

Sublime text 2 vintage mode disable ctrl+[

I recently started using Vintage mode in Sublime Text 2. I also enable Ctrl Keys support by adding "vintage_ctrl_keys": true in my configuration file.
However, this affect my workflow because I am using ctrl+[ and ctrl+] for indentation. Vintage mode basically remap ctrl+[ as escape.
Is there an easy way to disable ctrl+[ mapping in vintage mode ? I am still using ctrl+f and ctrl+b for scrolling.
You could disable vintage_ctrl_keys and set key bindings for Ctrl+F and Ctrl+B for page scroll:
{ "keys": ["ctrl+b"], "command": "move", "args": {"by": "pages", "forward": false} },
{ "keys": ["ctrl+f"], "command": "move", "args": {"by": "pages", "forward": true} }