diff options
author | Toby Vincent <tobyv13@gmail.com> | 2021-11-15 12:17:31 -0600 |
---|---|---|
committer | Toby Vincent <tobyv13@gmail.com> | 2021-11-15 12:17:31 -0600 |
commit | 00cfe49cc38d693300cf213da11a0f59f31d198d (patch) | |
tree | dda266795a822581a343e5a41ee46d2864df95ac | |
parent | 00a699c41b24e6149fdf7d12ad15cb1a77024bb1 (diff) |
feat: improved crate installer
-rw-r--r-- | bash/aliases.sh | 4 | ||||
-rw-r--r-- | install.conf.yaml | 2 | ||||
-rwxr-xr-x | scripts/install-crate.sh | 12 | ||||
-rw-r--r-- | zsh/keybindings.zsh | 10 | ||||
-rw-r--r-- | zsh/setopt.zsh | 10 | ||||
-rw-r--r-- | zshrc | 9 |
6 files changed, 28 insertions, 19 deletions
diff --git a/bash/aliases.sh b/bash/aliases.sh index 99104e7..c695792 100644 --- a/bash/aliases.sh +++ b/bash/aliases.sh @@ -10,8 +10,8 @@ alias grep='grep --color' alias ipa="ip -s -c -h a" alias untar="tar -zxvf" # scripts -alias dfi="$DOTFILES/install" -alias dfu="$DOTFILES/update" +alias dfi=~/dotfiles/install +alias dfu=~/dotfiles/update # docker alias dexec="docker exec -it" alias dps="docker ps" diff --git a/install.conf.yaml b/install.conf.yaml index 88d75b1..b148641 100644 --- a/install.conf.yaml +++ b/install.conf.yaml @@ -54,7 +54,7 @@ - description: Installing bat command: target=$(rustc -Vv | grep host | cut -d' ' -f2 | sed s/armv7/arm/) && - scripts/install-crate.sh --git sharkdp/bat --target $target --completion-bash --completion-zsh ~/.local/share/zsh/site-functions && + scripts/install-crate.sh --git sharkdp/bat --target $target --completion-bash --completion-zsh - description: Installing cheat.sh command: curl https://cht.sh/:cht.sh >~/.local/bin/cht.sh && diff --git a/scripts/install-crate.sh b/scripts/install-crate.sh index b7da98d..1c1578a 100755 --- a/scripts/install-crate.sh +++ b/scripts/install-crate.sh @@ -194,12 +194,16 @@ if [ -z $dest ]; then dest="$HOME/.cargo/bin" fi -if [ $no_tag = false ]; then - crate_tag="-$tag" +if [ $no_tag = true ]; then + crate_tag="$crate" +elif case $tag in "$crate"*) true ;; *) false ;; esac then + crate_tag="$tag" +else + crate_tag="$crate-$tag" fi say_err "Installing to: $dest" -url="$url/download/$tag/$crate${crate_tag}-$target.tar.gz" +url="$url/download/$tag/${crate_tag}-$target.tar.gz" say_err "Downloading: $url" @@ -211,7 +215,7 @@ for f in $(find "$td" -type f); do *".bash") [ $completion_bash ] && install -D $f "$comp_dir_bash/$crate" ;; - *".zsh") + *".zsh" | *"_$crate") [ $completion_zsh ] && install -D $f "$comp_dir_zsh/_$crate" ;; *".fish") diff --git a/zsh/keybindings.zsh b/zsh/keybindings.zsh index 35093c4..d210181 100644 --- a/zsh/keybindings.zsh +++ b/zsh/keybindings.zsh @@ -1,5 +1,11 @@ #!/usr/bin/env zsh +if [ -n "${WSL_DISTRO_NAME+1}" ]; then + clip=clip.exe +else + clip=/dev/null +fi + function r-delregion() { if ((REGION_ACTIVE)) then zle kill-region @@ -36,7 +42,7 @@ function r-undo { function r-copy() { if ((REGION_ACTIVE)) then zle copy-region-as-kill - (( ${+aliases[cb]} )) && printf "$CUTBUFFER" | cb + printf "$CUTBUFFER" | $clip else zle kill-whole-line fi @@ -48,7 +54,7 @@ function r-cut() { else zle kill-whole-line fi - (( ${+aliases[cb]} )) && printf "$CUTBUFFER" | cb + printf "$CUTBUFFER" | $clip } for key kcap seq mode widget ( diff --git a/zsh/setopt.zsh b/zsh/setopt.zsh deleted file mode 100644 index df15355..0000000 --- a/zsh/setopt.zsh +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env zsh - -typeset -A ZSH_HIGHLIGHT_STYLES -ZSH_HIGHLIGHT_STYLES[path]='fg=cyan' -HYPHEN_INSENSITIVE="true" -DISABLE_UPDATE_PROMPT="true" -DISABLE_AUTO_TITLE="true" -setopt HIST_IGNORE_ALL_DUPS -setopt NO_BEEP -setopt MENU_COMPLETE @@ -1,5 +1,14 @@ #!/usr/bin/env zsh +typeset -A ZSH_HIGHLIGHT_STYLES +ZSH_HIGHLIGHT_STYLES[path]='fg=cyan' +HYPHEN_INSENSITIVE="true" +DISABLE_UPDATE_PROMPT="true" +DISABLE_AUTO_TITLE="true" +setopt HIST_IGNORE_ALL_DUPS +setopt NO_BEEP +setopt MENU_COMPLETE + fpath=(~/.local/share/zsh/site-functions "${fpath[@]}") if [ -d "${HOME}/.zsh" ]; then for f in ~/.zsh/*; do source $f; done; fi |