Last updated
Last updated
pimp looks for commands to expand in a . Pimpfiles are YAML files where you can define patterns to match, and what they should be matched to.
Let's say you want to show the status of your git repository whenever "git" alone is matched, this is what you would put in your Pimpfile:
You can test this with pimp git
, this will execute git status -sb
.
Now, what if you also want to add a custom git command? Let's say git co
alone should offer you a list of branches you can checkout to. This is how you would do it;
Great, now what if you want to make git co
point to git checkout
? You can use the ...
operator for that. It catches variadic arguments, and pass them along to the end of your expanded command:
pimp git co readme.md
will actually execute git checkout readme.md
whereas git co
will execute git checkout <branch>
, with <branch> being the result of the {{GitBranches | fzf}}
being rendered.
Congratulations, you have expanded your first commands! Read more about the to explore the full potential of command expansion with pimp. The section is also helpful to understand how to integrate pimp within your shell.
Next, let's see how we can use pimp as a task runner.