umstrukturiert

This commit is contained in:
Christopher Beckmann
2023-05-26 17:00:58 +02:00
parent 1b227a5892
commit 4f35a25c10
16 changed files with 10 additions and 23 deletions

52
.config/sh/_kfg.rc Normal file
View File

@@ -0,0 +1,52 @@
function _kfg {
local -a _options _commands _programs
_programs=(
'all:Install everything'
'zsh:Powerful Shell'
'tmux:Terminal Multiplexer'
'unp:Perl script to make file archive extraction easier'
'bat:cat replacement with syntax highlighting and git integration'
'lsd:ls replacement with colors, icons, tree-view and more'
'omp:Customisable shell prompt renderer'
'zoxide:A smarter cd command'
'fzf:A command-line fuzzy finder'
'fzf-tab:Replace zsh default completion selection menu with fzf'
)
_commands=(
'update:Update kfg'
'install:Install programs and configs'
'version:Print version number'
)
_options=(
{-h,--help}'[Show this help]'
{-y,--yes}'[Skip confirmation questions]'
#{-a,--arch}' STRING [Set the architecture string to be used when downloading files from repositories. Most common are "amd64", "arm64", "armhf", etc]'
{-d,--debug}'[Print debug output]'
)
function _kfg_install {
_arguments -C '*:: :->subcmds'
if (( CURRENT == 1 ));then
_describe -t programs "kfg install programs" _programs
return
else
_arguments $_options
return
fi
}
_arguments -C '*:: :->subcmds'
if (( CURRENT == 1 ));then
_describe -t commands "kfg command" _commands
return
fi
case "$words[1]" in
install) _kfg_install && return 0 ;;
*) return 0 ;;
esac
}
compdef _kfg kfg

View File

@@ -0,0 +1,2 @@
bindkey "^[[1;5C" forward-word
bindkey "^[[1;5D" backward-word

7
.config/sh/util.rc Normal file
View File

@@ -0,0 +1,7 @@
if command -v bat &> /dev/null; then
alias myip="curl https://ipinfo.io/json 2> /dev/null | bat -l JSON --file-name=https://ipinfo.io/json -p --paging=never"
else
alias myip="curl https://ipinfo.io/json 2> /dev/null"
fi
alias ip='ip -c'