Taskpaper-esque boolean search


#1

It would be awesome if FoldingText had a search similar to Taskpaper that could smartly search tags and headings and whatnot. So I could search for something like… “@tag or @othertag” or “@tag > 2014-07-29” or what-have-you. Ehh?!


#2

It has all that and more. (Outline-defined search scope as well as global search).

Resources:

  1. Help file on ‘nodepaths’ give the syntax
  2. Jamie Kowalski’s filter plugin provides UI

#3

Back at my desk …
More specifically:

FoldingText > Help > Nodepath’s Guide

and

For global search, start with //
e.g.

//@tag > 2014-07-29

for search of particular indent levels, or only within descendants of an Inbox header etc, see the NodePath’s Guide

( /@tag > 2014-07-29 and @tag > 2014-07-29 would both search only the top level (unindented or single hash) lines, as the default search scope is the lines which are the immediate children of the document itself. i.e. any single hash headers, and any unindented material which precedes them)


#4

In my experience, the filter plugin (and maybe the node path query itself?) doesn’t properly evaluate dates formatted as “2014-07-29”. The filter returns results with: “//@start > 2014” but once I type to dash to enter the month digits it stops returning results, and won’t return results on the complete date either (e.g., //@start > 2014-07-24)


#5

Good catch.

It’s a string comparison, and the string value needs to be quoted.

I think you’ll find that it works once you write:

//@start > "2014-07-04"

#6

Thanks for the help! I can’t seem to get that plugin working, though. :confused: cmd-shift-’ keeps giving me the little error sound and nothing happens. Is there another way to invoke the plugin? It’s showing up in the list of plugins. Sorry, I’m a noob with this.


#7

It’s showing up in the list of plugins.

Have you also installed the JMK_Panel plugin ?

( See the install section of https://github.com/jamiekowalski/foldingtext-extra/blob/master/filter.ftplugin/README.md )


#8

D’oh. I totally missed that part of the readme while skimming it. My bad! >_< Thanks again.


#9

To return to the original post… the fact that this is a workaround—er, plugin—without a proper interface easily visible and accessible by mouse makes it a little bit more tedious and hard to work with. In Taskpaper (2.x at least), you can click on a tag and it filters by that tag. You don’t have to remember how many slashes to put for what. It’s easy. -a +d removes parents and adds descendants. It would be really nice if Taskpaper’s simple and elegant system were implemented natively. But that’s just me…


#10

I think Jesse is planning to give it UI, perhaps separating the scope/context choices from the pattern matching choice (in adjacent controls).

As the engines and search languages underlying the new TP3 and FoldingText have converged, I imagine that FT is likely to get any new UI developed for the release of TaskPaper 3.


#11

As @complexpoint says a UI is planned, just not there yet. But in the current FoldingText you can click on a tag to filter it.