update readme file
Add a `compact` formatting for the `--what` option.
Update the Git example to use `command`.
Simple shell utility to quickly run scripts in specific directories.
Have commands you only run in certain places of your filesystem only a few keystrokes away ! Define rules to match your current working directory and make your commands available immediately.
The rulebooks define which directories will have which here-scripts. For example to make your basic git commands available in any Git repo :
rules: # Match directories whose ancestors contain a `.git/` directory
- sibling: '.git/'
actions:
- # hs l
binding: l
title: pull
description: Pull from origin.
shell: git pull
- # hs p
binding: p
title: push
description: Push to origin
shell: git push
- # hs c
binding: c
title: commit
description: Commit
shell: git commit
- #hs f
binding: f
title: fetch
description: Fetch from origin
shell: git fetch
- #hs
binding: default
title: status
description: Show the repo's status
shell: git status
Each rulebook has a set of rules
and a set of actions
and is written using YAML. Right now they are to be located in ~/.config/rules/
.
Use either hs -w
or hs --what
to know which here-scripts are available in the current location :
$ hs --what
l Pull from origin
p Push to origin
c Commit
$
You can also use the oneline format in order to print it in places like your shell prompt using hs -w oneline
( example with my fish prompt ) :
┬─[schube@host:~/Code/here-script]─[16:19:33]─[l pull, p push, c commit]
╰─>$