Sublime Forum

Permanent Line Highlighting

#1

Hi All,

Scenario:
Copy config from firewall - drop into sublime text
Manual/visual run-through - highlight all lines related to a specific NAT
Extract run through - manually copy all highlighted lines to a new file for editing.

In this scenario it is key to be able to find the relevant lines that were highlighted in the visual run-through to efficiently copy them out in the extract run-through.

QUESTION:
Is there any plugin that will allow me to do this Permanent Line Highlighting in ST?

Would expect that if the original config file were saved that the highlighting would be preserved and also if lines were removed from the config that the highlighting would stay associated with the original text of the line and not just the line number.

Thanks,
Greg

0 Likes

#2

maybe try
https://packagecontrol.io/packages/Better%20Bookmarks

0 Likes

#3

Bumping this some years later…


Note the blue bubbles to highlight ilnes.
Still have the question:
Is there any way to do this with sublime?

0 Likes

#4

Have you at least tried ST’s built-in Bookmarks feature and got a sense of what all it can do?

Goto > Bookmarks section in the menu.

0 Likes

#5

It is certainly possible to bookmark lines in Sublime to mark them like that; if you look in the Command Palette for commands starting with Bookmarks: you will see commands to toggle a bookmark on and off for the current line as well as for selecting all of them (which would select all of the lines that have bookmarks so you can copy it over).

Bookmarks attach to the text they’re placed at, so if you add or remove text around them, they will shift to stay as attached as is possible (given the edit) to the point of the buffer they’re placed it. Note however that the bookmark is placed at the literal insertion point in the buffer, so if you want them to follow the line, make sure that the cursor is in the first column.

What the default doesn’t allow for is the bookmarks that are placed in the buffer remaining in the buffer when you close and re-open the file. Presumably this is because while the file is closed, any external application can modify the content of that file at will, which would leave Sublime unable to know for sure exactly where the bookmarks are supposed to be if the content of the file changed. In such a case, the only person that knows for sure the person that created them (i.e. you).

That said, the package that @kingkeith mentioned above extends the built in functionality of bookmarks to include this ability.

Did you try that in the past and find it lacking?

0 Likes