Published Mark Package


#1

I just published the Mark package which is similar to the mark support in Sublime Text and emacs. There is a single mark that can be toggled (cmd-k cmd-k). You can select from the cursor to the mark, jump to the mark, and swap the mark and cursor.

If you’ve never used the mark in other editors, it is very handy for selecting large parts of files, particularly when some portion is off screen. Set the mark where you want the selection to begin then navigate to where you want the selection to end easily without worrying about losing the selection. When you find the end, simply press cmd-k cmd-a to select between them.


#2

Nice feat!
Just a detail though, you should use a different symbol than , already used to indicates wrapped lines and can lead to confusion. With *, + and ~already used for git status and > for code folding I would personally opt for something like that indicates the start of the mark range.


#3

Thanks, I did not know that about wrapped lines.

I’m using GitHub icons so maybe something from there would work. Some other choices:

  • bookmark icon but in normal gray to differentiate from blue bookmarks
  • The pin icon looked good
  • The star looked out of place
  • There is a plain square but seems less interesting than the dot.

I could differentiate using color, but I avoided that so themes could control the color.

For now I’ll switch to pin for now. Suggestions are welcome.


#4

How is this different from the Bookmarks feature that is already in Atom? It sounds like you’ve added some functionality though.


#5

Think about it as a not-so-transient selection. You “drop the mark” which is one end of the selection and can then move around the buffer any way you like without losing it. You might set the mark, then perform a search for the end, use a previous bookmark, or any other navigation package added to Atom. When you find the end, one quick keystroke selects the block.

This is handy for moving code, highlighting blocks within a function, etc.


#6

Ok, it sounds like the main benefit over the Bookmarks feature is selecting blocks of code whereas Bookmarks is mainly for navigating. Though I suppose you could make a command or keystroke to “select from here to the last bookmark”.