~schube/here-script

in-context aliases for the command line
update readme file
7f12e057 — Victor Schubert 8 years ago
Add a `compact` formatting for the `--what` option.
92a0ced3 — Victor Schubert 8 years ago
Update the Git example to use `command`.

refs

master
browse  log 

clone

read-only
https://git.sr.ht/~schube/here-script
read/write
git@git.sr.ht:~schube/here-script

You can also use your local clone with git send-email.

#here-script

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.

#Rulebooks

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/.

#Showing available here-scripts

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]
╰─>$