Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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!

like image 595
alsweet Avatar asked Apr 23 '13 19:04

alsweet


People also ask

How do I use shortcuts in Sublime Text?

Sublime Text works with all the standard Windows shortcuts: In addition to the arrow keys, home, end, page up, etc, there is: Ctrl+Left / Ctrl+Right: Move by words. Ctrl+Home / Ctrl+End: Move to the beginning / end of the file. Ctrl+L: Expand selection to line.

What is the shortcut key for Sublime Text?

The shortcut key for this purpose is Ctrl+Shift+P for Windows and Cmd+Shift+P for Mac.


1 Answers

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" }
like image 170
stonefury Avatar answered Sep 30 '22 05:09

stonefury