123456789101112131415161718192021222324252627282930313233 |
- SUFFIX := plugin.zsh
- PLUGINS := zoxide hatch pipx broot
- # DIFF := diff -du --color
- DIFF := delta
- .PHONY: all
- all: $(foreach x,${PLUGINS},${x}.${SUFFIX})
- # ${1}: cmd
- define plugin
- {${1}; } > new.${@}
- @[ -f "${@}" ] && ${DIFF} ${@} new.${@} ||:
- @mv new.${@} ${@}
- endef
- .PHONY: zoxide.${SUFFIX}
- zoxide.${SUFFIX}:
- $(call plugin, zoxide init zsh --cmd cd --hook pwd)
- .PHONY: hatch.${SUFFIX}
- hatch.${SUFFIX}:
- $(call plugin, _HATCH_COMPLETE=zsh_source hatch)
- .PHONY: pipx.${SUFFIX}
- pipx.${SUFFIX}:
- $(call plugin, register-python-argcomplete -s zsh pipx)
- .PHONY: broot.${SUFFIX}
- broot.${SUFFIX}:
- $(call plugin, broot --print-shell-function zsh)
|