103

In Visual Studio, we can use:
CTRL+kk to place a marker on the current line
and
CTRL+kn to navigate through marked lines.

My question is: is there a way to do this with Sublime Text2?

Thanks

André Alçada Padez
  • 10,987
  • 24
  • 67
  • 120

3 Answers3

202

Yep! Go on the menus to Preferences>Key Bindings - Default this is a file with all the default key bindings. Read the whole thing! (lots of goodies) Here is a cut and paste of the bookmarks info (linux), which should be self explanatory.

{ "keys": ["f2"], "command": "next_bookmark" },
{ "keys": ["shift+f2"], "command": "prev_bookmark" },
{ "keys": ["ctrl+f2"], "command": "toggle_bookmark" },
{ "keys": ["ctrl+shift+f2"], "command": "clear_bookmarks" },
{ "keys": ["alt+f2"], "command": "select_all_bookmarks" },
fraxel
  • 34,470
  • 11
  • 98
  • 102
  • Ok, that is really good. But it doesn't work kind of like i expected, and probably because what i want is not feasible in Sublime. What i'd like, was two actions "add_mark" and "go_to_next_mark", so i could set various marks and walk quickly from one to another. – André Alçada Padez Apr 19 '12 at 18:17
  • if you tell me this is impossible, i will accept your answer and post it as a request for feature in their site – André Alçada Padez Apr 19 '12 at 18:17
  • 11
    @André Alçada Padez - Hey :) for me on Linux, I use `Ctrl-F2` to toggle/set a bookmark. And then I just use `F2` to jump between these bookmarks, this is the kind of functionality I think you mean???....maybe.... – fraxel Apr 19 '12 at 22:14
  • Do you guys know if it's possible to jump between bookmarks in different files? For me it's only working on bookmarks in the same file. – MAckerman Oct 29 '12 at 17:36
  • @MAckerman - I don't think so. But it'd probably not be too hard to write a plug-in that could do it.. – fraxel Oct 30 '12 at 17:55
  • These are also accessible via Goto -> Bookmarks from native menu. – xixixao Jun 10 '13 at 22:13
  • 2
    I really need to stop rushing through these solutions, I actually added these to my keybindings xD and when I was about to comment that you were a genius, noticed that this were the defaults bindings, anyway, really appreciated, this is definitely going to the things I would use in my everyday work and +1 for the customization, I ended tweaking this to my linking, regards! – Alexis Nov 27 '17 at 05:16
55

Actually, you can. Here's the menu screenshot from a mac. I hope this helps.

Sublime text2

juanchod
  • 681
  • 5
  • 7
17

The bookmarks system is pretty OK, but I would suggest you to try the plug-in "SublimeBookmarks" which extends the capabilities of the built-in mechanism.

Check it out here: https://github.com/bollu/sublimeBookmark

Preview: http://i.imgur.com/gtjChPG.gif enter image description here

George Mastro
  • 307
  • 2
  • 5