Visidata: Add immediate filtering like a fuzzy finder

Created on 28 May 2019  路  15Comments  路  Source: saulpw/visidata

Tools like fzf filter their input immediately. It would be useful if visidata had a feature where you could filter the rows of a table faster than you can currently with the select ('g|' or '|')/filter ('"') workflow available now.

The immediate filtering could have the same options (e.g. current column, visible rows) that are used now for select/unselect commands. You wouldn't need to hit enter to see the results of your query or have to hit the filter button to reduce the table to the matching/selected rows. Speeding up how fast can search your data.

wishlist

All 15 comments

Thanks for the request, @frosencrantz. I wrote a little plugin to do this, and I'm thinking about how best to incorporate it.

Great. What's the best way to try it? How do you load plugins? I tried to import from visidatarc file.

@frosencrantz Our documentation on manually installing plugins is here =) https://github.com/saulpw/visidata/blob/develop/docs/plugins.md#manually

(The automated installation method has not been shipped yet.)

Let me know if you still have trouble!

In summary:

Move the plugin module into ~/.visidata.
Ensure its dependencies are installed.
Import the module within ~/.visidatarc.

On second thought @frosencrantz these instructions are too vague. I only just caught up on what this issue entails.

Here is the specific how to:

  1. Install VisiData from the develop branch pip3 install git+https://github.com/saulpw/visidata.git@develop (welcome to the cutting edge of VisiData =)
  2. mkdir -p ~/.visidata/plugins
  3. Copy plugins/livesearch.py into ~/.visidata/plugins
  4. Add import plugins.livesearch to ~/.visidatarc

Currently, the instasearch commands are mapped to Alt-s and gAlt-s. You would then press Enter to open a duplicate sheet with those rows. If you would like to change those keybindings, open up ~/.visidata/livesearch.py and locate the Sheet.addCommands at the bottom. Those are the modules that create the actual commands. The keystrokes are the first argument. You can change them to / and g/, or anything else that you like. =)

There may be a couple of bugs in the display. If you have any improvements for the plugin, we would be happy to take them!

@anjakefala is there some way to stay both on cutting edge and stable version of VisiData?
Is there a way to install and use both?

Thank you

P.S. as usual the next Visadata seems really great

@aborruso How comfortable are you with Python virtual environments? =)

The instructions for the plugin worked, thanks for adding the detailed notes. I was looking for the instructions under http://visidata.org/docs/ I didn't think to look at the github wiki.

I tried the plugin a couple times, and it works well. It provides immediate feedback. I'm going to try using this as one of my main filtering commands.

Here's some initial impressions. As I'm typing the search string, there was no prompt on the left. There is no visual feedback about what is matching on the rows. It is common for the fuzzy finders to provide a visual indicator of the string that is matching on each row.

Thanks for adding this!

@anjakefala not so good, but I will try

The instructions for the plugin worked, thanks for adding the detailed notes. I was looking for the instructions under http://visidata.org/docs/ I didn't think to look at the github wiki.

@frosencrantz, it is not on https://visidata.org/docs/ yet because we have not officially shipped that documentation yet!

The reason my detailed notes differed from what was on the WIP docs (github wiki) is because our conceptualisation for plugins has changed on develop, and the documentation has not been updated yet. Haha, this is what I meant by "welcome to the cutting edge". =)

@aborruso Rara!

I know, I wish environment sandboxes in Python were easier. It is the bane of my existence in packaging.

How would I start visidata in this fuzzy finder plugin mode without having to type the key to start it. Additionally how would I pass in an initial value of the search string.

@frosencrantz There's not a good way to start VisiData in the middle of a command like you suggest. We can try to enable this and a starting value but it might not be until after the next version.

@aborruso How comfortable are you with Python virtual environments? =)

@anjakefala I woudl like to try. Is it some guide on how to install and use vd develop version?

@anjakefala got it here, thank you http://visidata.org/install/

Thanks @saulpw that seems like that would be a useful feature, even if it is in the following release.

Was this page helpful?
0 / 5 - 0 ratings