rename system to lib
This commit is contained in:
parent
ddbcf98ee3
commit
90c554df4e
17 changed files with 68 additions and 5 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -19,7 +19,7 @@ dist/
|
|||
downloads/
|
||||
eggs/
|
||||
.eggs/
|
||||
lib/
|
||||
#lib/
|
||||
lib64/
|
||||
parts/
|
||||
sdist/
|
||||
|
|
|
@ -15,7 +15,7 @@ fi
|
|||
|
||||
PATH="$DOTFILES_DIR/bin:$PATH"
|
||||
|
||||
for DOTFILE in "$DOTFILES_DIR"/system/{path,env,prompt,alias,function,conda,custom}.sh; do
|
||||
for DOTFILE in "$DOTFILES_DIR"/lib/{path,env,prompt,alias,function,conda,custom}.sh; do
|
||||
[ -f "$DOTFILE" ] && . "$DOTFILE"
|
||||
done
|
||||
|
||||
|
|
60
lib/completions/_task
Normal file
60
lib/completions/_task
Normal file
|
@ -0,0 +1,60 @@
|
|||
#compdef task
|
||||
|
||||
local context state state_descr line
|
||||
typeset -A opt_args
|
||||
|
||||
# Listing commands from Taskfile.yml
|
||||
function __task_list() {
|
||||
local -a scripts cmd
|
||||
local -i enabled=0
|
||||
local taskfile item task desc
|
||||
|
||||
cmd=(task)
|
||||
taskfile="${(v)opt_args[(i)-t|--taskfile]}"
|
||||
|
||||
if [[ -n "$taskfile" && -f "$taskfile" ]]; then
|
||||
enabled=1
|
||||
cmd+=(--taskfile "$taskfile")
|
||||
else
|
||||
for taskfile in Taskfile{,.dist}.{yaml,yml}; do
|
||||
if [[ -f "$taskfile" ]]; then
|
||||
enabled=1
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
(( enabled )) || return 0
|
||||
|
||||
scripts=()
|
||||
for item in "${(@)${(f)$("${cmd[@]}" --list)}[2,-1]#\* }"; do
|
||||
task="${item%%:[[:space:]]*}"
|
||||
desc="${item##[^[:space:]]##[[:space:]]##}"
|
||||
scripts+=( "${task//:/\\:}:$desc" )
|
||||
done
|
||||
_describe 'Task to run' scripts
|
||||
}
|
||||
|
||||
_arguments \
|
||||
'(-C --concurrency)'{-C,--concurrency}'[limit number of concurrent tasks]: ' \
|
||||
'(-p --parallel)'{-p,--parallel}'[run command-line tasks in parallel]' \
|
||||
'(-f --force)'{-f,--force}'[run even if task is up-to-date]' \
|
||||
'(-c --color)'{-c,--color}'[colored output]' \
|
||||
'(-d --dir)'{-d,--dir}'[dir to run in]:execution dir:_dirs' \
|
||||
'(--dry)--dry[dry-run mode, compile and print tasks only]' \
|
||||
'(-o --output)'{-o,--output}'[set output style]:style:(interleaved group prefixed)' \
|
||||
'(--output-group-begin)--output-group-begin[message template before grouped output]:template text: ' \
|
||||
'(--output-group-end)--output-group-end[message template after grouped output]:template text: ' \
|
||||
'(-s --silent)'{-s,--silent}'[disable echoing]' \
|
||||
'(--status)--status[exit non-zero if supplied tasks not up-to-date]' \
|
||||
'(--summary)--summary[show summary\: field from tasks instead of running them]' \
|
||||
'(-t --taskfile)'{-t,--taskfile}'[specify a different taskfile]:taskfile:_files' \
|
||||
'(-v --verbose)'{-v,--verbose}'[verbose mode]' \
|
||||
'(-w --watch)'{-w,--watch}'[watch-mode for given tasks, re-run when inputs change]' \
|
||||
+ '(operation)' \
|
||||
{-l,--list}'[list describable tasks]' \
|
||||
{-a,--list-all}'[list all tasks]' \
|
||||
{-i,--init}'[create new Taskfile.yaml]' \
|
||||
'(-*)'{-h,--help}'[show help]' \
|
||||
'(-*)--version[show version and exit]' \
|
||||
'*: :__task_list'
|
|
@ -14,3 +14,6 @@ echo "-----------------------------"
|
|||
gen sheldon completions --shell zsh
|
||||
gen just --completions zsh
|
||||
gen zellij setup --generate-completion zsh
|
||||
|
||||
echo "FETCHING COMPLETION SCRIPTS"
|
||||
wget https://raw.githubusercontent.com/go-task/task/master/completion/zsh/_task
|
|
@ -11,7 +11,7 @@ export HISTCONTROL=ignoredups:erasedups
|
|||
export LESS='-R'
|
||||
|
||||
# add completions to fpath
|
||||
fpath=($DOTFILES_DIR/system/completions $fpath)
|
||||
fpath=($DOTFILES_DIR/lib/completions $fpath)
|
||||
|
||||
# Append to the history file, rather than overwriting it
|
||||
setopt APPEND_HISTORY
|
||||
|
@ -21,7 +21,7 @@ unsetopt autocd
|
|||
|
||||
# Vim Settings
|
||||
# export VIMINIT='source $MYVIMRC'
|
||||
# export MYVIMRC='$DOTFILES_DIR/system/.vimrc'
|
||||
# export MYVIMRC='$DOTFILES_DIR/lib/.vimrc'
|
||||
if is-executable lvim; then
|
||||
export EDITOR=lvim
|
||||
elif is-executable nvim; then
|
||||
|
@ -41,7 +41,7 @@ if [[ $PATH != *$HOME/.fzf/bin* ]]; then
|
|||
fi
|
||||
|
||||
if is-executable fzf; then
|
||||
source $DOTFILES_DIR/system/fzf.zsh
|
||||
source $DOTFILES_DIR/lib/fzf.zsh
|
||||
fi
|
||||
# ---------
|
||||
|
Loading…
Reference in a new issue