add aichat, zsh completion dir

This commit is contained in:
Jason Swank 2025-01-19 21:20:57 +00:00
parent 8cfa5d009d
commit 9991e791dd
6 changed files with 81 additions and 4 deletions

View File

@ -34,7 +34,8 @@ for dir in \
sh \ sh \
ssh \ ssh \
tmux \ tmux \
zsh zsh \
aichat
do do
$STOW -t $HOME $dir $STOW -t $HOME $dir
done done

3
ssh/.ssh/known_hosts Normal file
View File

@ -0,0 +1,3 @@
192.168.101.110 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJb5kemGOPwXoNr09PqIEZbHjZprJUrEtHOKk4jvxAlH
192.168.101.110 ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQD3MkIlJXiY/CF1Q9l+C1b5jKj05cIzr7AMTHXLnkvrGZD/n2XwkYKTVIwgiGm4de2MKs1tcFJU4l5y6ARWu2Iit7UHC7Zk9aAydg59przJV/aj9pkLfOYKvWu6f7VGWEMTzy+FZ+7C+ulzIhhV6fN6sDO6Ywa5Pkl/LyXlSWHlfWO7xVYFQwRaACdhdnjl+tygXWISHErtCUXX8qR+c7+yyb/tNKF67yhDX+U55PkMDoHqtQDVAYotUukvHZ4SbE//rTt/xRQAb/GnRV2f4p+Zl65UGBNr7Wh8oRWAdRx/CjU8ujgEZgs99lKLkAUdNz/52eAvoIxccoOdIkbk0snv
192.168.101.110 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBHZCtwh3lEIVtg/rm4p2Lws2zjXbvB8K8hk4ymagckaRdYq/16TqB8A2ki28fkGh7+DmitaCEC+iW/4lcQtEvsQ=

1
ssh/.ssh/known_hosts.old Normal file
View File

@ -0,0 +1 @@
192.168.101.110 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJb5kemGOPwXoNr09PqIEZbHjZprJUrEtHOKk4jvxAlH

View File

@ -0,0 +1 @@
_task

View File

@ -0,0 +1,71 @@
#compdef task
compdef _task task
typeset -A opt_args
_GO_TASK_COMPLETION_LIST_OPTION="${GO_TASK_COMPLETION_LIST_OPTION:---list-all}"
# Listing commands from Taskfile.yml
function __task_list() {
local -a scripts cmd
local -i enabled=0
local taskfile item task desc
cmd=(task)
taskfile=${(Qv)opt_args[(i)-t|--taskfile]}
taskfile=${taskfile//\~/$HOME}
if [[ -n "$taskfile" && -f "$taskfile" ]]; then
enabled=1
cmd+=(--taskfile "$taskfile")
else
for taskfile in {T,t}askfile{,.dist}.{yaml,yml}; do
if [[ -f "$taskfile" ]]; then
enabled=1
break
fi
done
fi
(( enabled )) || return 0
scripts=()
for item in "${(@)${(f)$("${cmd[@]}" $_GO_TASK_COMPLETION_LIST_OPTION)}[2,-1]#\* }"; do
task="${item%%:[[:space:]]*}"
desc="${item##[^[:space:]]##[[:space:]]##}"
scripts+=( "${task//:/\\:}:$desc" )
done
_describe 'Task to run' scripts
}
_task() {
_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.yml]' \
'(-*)'{-h,--help}'[show help]' \
'(-*)--version[show version and exit]' \
'*: :__task_list'
}
# don't run the completion function when being source-ed or eval-ed
if [ "$funcstack[1]" = "_task" ]; then
_task "$@"
fi

View File

@ -4,6 +4,8 @@ alias vim='nvim'
alias vi='nvim' alias vi='nvim'
alias w3='w3m -T text/html' alias w3='w3m -T text/html'
fpath+=~/.local/share/zsh/functions
path+=(~/bin) path+=(~/bin)
path+=(~/.local/bin) path+=(~/.local/bin)
path+=($GOPATH/bin) path+=($GOPATH/bin)
@ -12,8 +14,6 @@ export PATH
# allow for # to be interpreted as a comment on the command line # allow for # to be interpreted as a comment on the command line
setopt interactivecomments setopt interactivecomments
# cd tricks
alias -- -='cd -'
setopt auto_cd # there is no binary by that name in your $PATH, your shell will cd into it that directory setopt auto_cd # there is no binary by that name in your $PATH, your shell will cd into it that directory
# use vi-style keymap # use vi-style keymap
@ -87,7 +87,7 @@ if [ -e $HOME/cfa-work/.zshrc ]; then
. $HOME/cfa-work/.zshrc . $HOME/cfa-work/.zshrc
fi fi
for env in $HOME/.okta/.env $HOME/.aws/.env $HOME/.config/git/.env; do for env in $HOME/.okta/.env $HOME/.aws/.env $HOME/.config/github/.env $HOME/.config/aichat/.env; do
if [ -r $env ]; then if [ -r $env ]; then
export $(xargs < $env) export $(xargs < $env)
fi fi