Hi,
Following the discussion in this thread, I’ve implemented a navigation plugin that allows you to navigate back and forward in a browser-like manner.
Code: github.com/optilude/SublimeText … History.py
Put this in your “Packages” directory and then configure “Key bindings - User” to use it. I use these keybindings for it on OS X:
{ "keys": "super+ctrl+alt+left"], "command": "navigation_history_back"},
{ "keys": "super+ctrl+alt+right"], "command": "navigation_history_forward"}
It works like this:
-
Whenever you navigate (change selection/move the caret) to a location that differs to the previous selection location by more than 2 lines or is in a different file, a history entry is made (this stops history entries from being created every time you type something or use the arrow keys to navigate around)
-
Go back in history, use the navigation_history_back command. I’ve bound this to cmd+alt+ctrl+left above
-
Go forward in history, use the navigation_history_forward command. I’ve bound this to cmd+alt+ctrl+right above
-
You can go back and forth multiple times, but as soon as a new history entry is recorded (i.e. you just somewhere else), the forward history is cleared
-
History is per-window, so it works across files in the same window/project, but not between windows
Feedback/forks/improvements welcome.
Martin