Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature addition: scripts for grepping on z list and moving to one of the outputs #290

Open
jerabaul29 opened this issue Jul 5, 2020 · 0 comments

Comments

@jerabaul29
Copy link

First, many thanks for a really great tool!

I have been using a couple of small extra scripts lately, that I found to be very useful. They are quite low quality, and I am now thinking about improving their quality and seeing if they should be added to the project. For reference:

https://github.com/jerabaul29/my_bash_scripts/blob/master/zg.sh

https://github.com/jerabaul29/my_bash_scripts/blob/master/zx.sh

Basically the workflow is as visible under:

  • the grep script takes a list of words, looks for them in the z database, and prints the ordered, numbered outputs. The grepping also has color highlighting, which I find useful.

  • the execute script takes one of these numbers, and moves to the corresponding folder. I find it very convenient when there may be several possible matches.

See the illustration:

Screenshot from 2020-07-05 15-55-24

I was thinking about adding these scripts in the following ways:

  • creating a z -g that does the same as the grep script: 1) take 1 or several words, 2) use these to grep the z database with highlighting etc 3) prints the results

  • creating a z -x that takes in a number n and that does the same as the execute script, in the following way: 1) get the latest history entry 2) check that it is a z -g command 3) if it is not, issue an error message, if it is 4) re-run the command, and grab the output 5) if n > number of output lines, error, otherwise, 6) move to the n-th output.

Any commends around that? Things that could / should be done better?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant