From 69992167668692b022478b09e74629fb99184f7c Mon Sep 17 00:00:00 2001 From: Daniel Bauer Date: Mon, 25 Mar 2019 08:16:45 +0100 Subject: [PATCH] snakemake autocompletion --- profiles/base/.functions | 10 ++++++++++ profiles/base/.zshrc | 1 + 2 files changed, 11 insertions(+) create mode 100644 profiles/base/.functions diff --git a/profiles/base/.functions b/profiles/base/.functions new file mode 100644 index 0000000..414ad85 --- /dev/null +++ b/profiles/base/.functions @@ -0,0 +1,10 @@ +sm_autocomplete() { + # make zsh emulate bash if necessary + if [[ -n "$ZSH_VERSION" ]]; then + autoload bashcompinit + bashcompinit + fi + + snakemake_options=$(snakemake --snakefile Snakefile --list) + complete -W "${snakemake_options}" 'snakemake' +} \ No newline at end of file diff --git a/profiles/base/.zshrc b/profiles/base/.zshrc index 0cedc0f..ba04bc4 100644 --- a/profiles/base/.zshrc +++ b/profiles/base/.zshrc @@ -18,6 +18,7 @@ if [ -f "$HOME/.environment.local" ]; then fi source $HOME/.aliases +source $HOME/.functions if [ -z "$GMXRC" ]; then GMXRC="/opt/gromacs-2018/bin/GMXRC"