Settings

Theme

Show HN: Ltag – A Go CLI tool to tag your text lines

github.com

4 points by mebble 2 years ago · 4 comments · 1 min read

Reader

This is a tool I wrote to address a need I had: to search over lines of text, but by "tag" or "category". I created ltag to add tags to plaintext lines, and rely on fzf to do the searching for me. ltag interacts with the outside world only through stdin and stdout, so that it interfaces easily with other CLI tools.

treebeard5440 2 years ago

This is really cool - thanks for sharing! Is there a way to have multiple categories in a file that aren’t subcategories of the first tag?

  • mebbleOP 2 years ago

    Thanks! And yeah we can put an empty line to break off into a new category. So essentially it's one category per paragraph. Within a paragraph, there can be sub-categories one level deep. You can also put tags inline.

    I'm still trying to figure out how to allow nesting categories an arbitrary number of levels deep. But I don't want to introduce extra symbols and stuff, it'll be too much complexity too early on. I can imagine that for most cases, headings, sub-headings and inline tags are enough.

    I will allow more customisation soon, such as using multiple heading identifiers. I'll add features as the need arises. I haven't used it for very long myself.

    • jotaen 2 years ago

      My naive initial assumption (just due to my own bias) was that nesting would work the same way as in Markdown – i.e., that the number of `#`’s indicates the heading level.

      Maybe worth for you to consider? It’s a well known convention, it should be fairly self-explanatory, and it would work independent of the notion of paragraphs.

          # animals
          elephant
          ## felines
          cats
          # plants
          apple tree
          ## flowers
          lily
      • mebbleOP 2 years ago

        Ahh I don’t know how i missed that. I guess i didn’t see the forest for the trees. This looks like the right way to go

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection