diff --git a/dot_config/sheldon/plugins.toml b/dot_config/sheldon/plugins.toml index 3cf499e..7e27b84 100644 --- a/dot_config/sheldon/plugins.toml +++ b/dot_config/sheldon/plugins.toml @@ -20,7 +20,7 @@ use = [".p10k.zsh"] [plugins.ownfiles] local = "~/.config/zsh/files/" -use = ["{compinit,aliases,keybinds,distroicon,transfer}.zsh"] +use = ["{compinit,aliases,functions,distroicon}.zsh"] # completions [plugins.completions] @@ -42,7 +42,7 @@ use = ["{completion,key-bindings,history,directories}.zsh"] [plugins.ohmyzshplugins] github = "ohmyzsh/ohmyzsh" dir = "plugins" -use = ["{systemd,fzf,command-not-found}/*.plugin.zsh"] +use = ["{systemd,fzf,command-not-found,transfer}/*.plugin.zsh"] [plugins.fzftab] github = "Aloxaf/fzf-tab" @@ -86,10 +86,35 @@ github = "zsh-users/zsh-syntax-highlighting" [plugins.asdf] github = "asdf-vm/asdf" +[plugins.hoco] +github = "Felixoid/zsh-hoco" + [plugins.sshcomp] local = "~/.config/zsh/files/" use = ["sshcomp.zsh"] -# theme +# themes [plugins.powerlevel10k] github = "romkatv/powerlevel10k" + +#[plugins.starship] +#inline = "_evalcache starship init zsh --print-full-init" + +#[plugins.ohmyposh] +#inline = "_evalcache oh-my-posh init zsh --config /usr/share/oh-my-posh/themes/kali.omp.json" + +# evals +[plugins.zoxide] +inline = "_evalcache zoxide init zsh" + +[plugins.atuin] +inline = "_evalcache atuin init zsh" + +[plugins.navi] +inline = "_evalcache navi widget zsh" + +[plugins.direnv] +inline = "_evalcache direnv hook zsh" + +[plugins.keychain] +inline = 'eval "$(keychain --dir "$XDG_CACHE_HOME"/keychain --eval --quiet id_rsa)"' diff --git a/dot_config/zsh/env.zsh b/dot_config/zsh/env.zsh index e3784dc..8d71a50 100644 --- a/dot_config/zsh/env.zsh +++ b/dot_config/zsh/env.zsh @@ -62,4 +62,5 @@ export TERMINALNAME=$(fastfetch --pipe 2>/dev/null | grep -i terminal: | awk '{p # zsh specific export SAVEHIST=$(( 1000 * 1000 )) export HISTSIZE=$(( 1.2 * SAVEHIST )) -export HISTFILE="$XDG_CACHE_HOME"/zsh/history +export ZSH_CACHE_DIR="$XDG_CACHE_HOME"/zsh +export HISTFILE="$ZSH_CACHE_DIR"/history diff --git a/dot_config/zsh/files/functions.zsh b/dot_config/zsh/files/functions.zsh new file mode 100644 index 0000000..6a40a2f --- /dev/null +++ b/dot_config/zsh/files/functions.zsh @@ -0,0 +1,15 @@ +pet_select () { + BUFFER=$(pet search --query "$LBUFFER") + CURSOR=$#BUFFER + zle redisplay +} +zle -N pet_select +bindkey '^l' pet_select + +run_ranger () { + echo + ranger < $TTY + zle redisplay +} +zle -N run_ranger +bindkey '^f' run_ranger diff --git a/dot_config/zsh/files/keybinds.zsh b/dot_config/zsh/files/keybinds.zsh deleted file mode 100644 index 854db4d..0000000 --- a/dot_config/zsh/files/keybinds.zsh +++ /dev/null @@ -1,7 +0,0 @@ -run_ranger () { echo; ranger < $TTY; zle redisplay } -zle -N run_ranger -bindkey '^f' run_ranger - -pet_select () { BUFFER=$(pet search --query "$LBUFFER"); CURSOR=$#BUFFER; zle redisplay } -zle -N pet_select -bindkey '^l' pet_select diff --git a/dot_config/zsh/files/transfer.zsh b/dot_config/zsh/files/transfer.zsh deleted file mode 100644 index 394bdf3..0000000 --- a/dot_config/zsh/files/transfer.zsh +++ /dev/null @@ -1,26 +0,0 @@ -transfer () { - if test $# -eq 0; then - echo "No arguments specified.\nUsage:\n transfer \n ... | transfer ">&2 - return 1 - fi - - if tty -s; then - file="$1" - file_name=$(basename "$file") - - if test ! -e "$file"; then - echo "$file: No such file or directory">&2 - return 1 - fi - - if test -d "$file"; then - file_name="$file_name.zip" - (cd "$file" && zip -r -q - .) | curl --progress-bar --upload-file "-" "https://transfer.sh/$file_name" | tee /dev/null - else - cat "$file" | curl --progress-bar --upload-file "-" "https://transfer.sh/$file_name" | tee /dev/null - fi - else - file_name=$1 - curl --progress-bar --upload-file "-" "https://transfer.sh/$file_name" | tee /dev/null - fi -} diff --git a/dot_config/zsh/rc.zsh b/dot_config/zsh/rc.zsh index a2a95e7..8916d84 100644 --- a/dot_config/zsh/rc.zsh +++ b/dot_config/zsh/rc.zsh @@ -1,20 +1,9 @@ if test -v DISTROBOX_HOST_HOME; then unset ZDOTDIR; exec zsh; fi # fix distrobox if test $TERMINALNAME = "alacritty"; then eval "$(zellij setup --generate-auto-start zsh)"; fi # autostart zellij only in alacritty -#fastfetch -bofh; echo " - BOFH" -#hackerquotes -#colorscript random +potentialBanner=('bofh; echo " - BOFH"' 'fastfetch' 'hackerquotes' 'colorscript random') +eval "$potentialBanner[$RANDOM%$#potentialBanner+1]" () { test -r $1 && source $1 } "$XDG_CACHE_HOME"/p10k-instant-prompt-$USERNAME.zsh eval "$(sheldon source)" - -# eval stuff + other themes -#_evalcache starship init zsh -#_evalcache oh-my-posh init zsh --config /usr/share/oh-my-posh/themes/kali.omp.json -_evalcache zoxide init zsh -_evalcache atuin init zsh -_evalcache navi widget zsh -_evalcache direnv hook zsh -eval "$(keychain --dir "$XDG_CACHE_HOME"/keychain --eval --quiet id_rsa)"