How do you use bookmarks


#1

Hi guys,

I am not really used to using bookmarks in editor, so I would like to ask you , how exactly do you use bookmark package?


#2

There are key bindings to do all the normal bookmark things like toggle it, go to next or prev one, delete all, etc. Type in bookmark in the key binding list in settings.


#3

Sorry I think I wasn’t clear enough. I am interested in use cases, not how to but rather when and why.


#4

I can only think of one use case. You mark places of interest to get there quickly. When I am editing code in different places at once I use bookmarks to quickly hop between those places.


#5

I think I have the same question as @Trudko. @mark_hahn, could you perhaps tell a little story? Which files are you editing, which of them receive a bookmark and why? How do you prune the list of bookmarks?

Perhaps you can tell the story of how you’re editing some piece of code (perhaps one of your packages) and then explain why.

I guess just a little experimentation will tell me which keys to press, but still I’m unsure when to place a bookmark and where. Just to provide a counter-example: It never occurred to me to use bookmarks. I just open various files in tabs and then I switch between tabs to switch between places.

Let me use another analogy: I can read a programming language spec to see how a language works. I can also read an existing program. Those are completely different things. Both of them are useful. So consider your story to be like the existing program, to complement the “language spec” I get after searching the command pallette for “bookmark”.


#6

I map my keys this way …

  • ctrl-' is toggle bookmark.
  • ctrl-< is go to prev
  • ctrl-> is go to next

Whenever I am editing and I realize I need to go somewhere else and come back, I drop a bookmark. The after editing the other place I drop one there also. Then I go back and forth between bookmarks. Sometimes when I’m editing a larger file I’ll drop them at multiple places like major functions so I can march quickly through the file. I use navigation lists on the side but I find it easier to keep my hands on the keyboard.

I don’t really worry about deleting them. They do no harm lying around. When I start using them and I run into an old one I’ll delete it and move on. I have a key to delete all but I never use it.


#7

@mark_hahn that make sense. There is one thing thing which seems like might be helpful:
Being able to add description to bookmark. Seems that way I can bookmark interesting parts of the code and add some description to them. What do you think?

Also do you use them if you need to jump between let say two or three files? Jump to next / previous bookmark works only inside of one file and you can toggle all bookmarks, but that doesn’t seems practical.


#8

Navigation aids like coffee navigator provide a list of functions and fill that need for me. I use bookmarks as a temporary solution.

I don’t know how I would use them if they were across files. I would have to try it. Right now I count on them being in the same file and I usually visit them all by using only the forward key and wrapping the file. I use the tabs to switch files and the bookmarks inside a file.


#9

Just wanted to add a note, I may either use these along with the minimap and minimap-bookmarks packages, or just open separate panes for viewing different parts of the same file at once. For example, when working on a method and another that uses the first.