diff options
Diffstat (limited to 'dot_zsh')
| -rw-r--r-- | dot_zsh/functions/twitch | 6 | ||||
| -rw-r--r-- | dot_zsh/plugins/exa | 11 | ||||
| -rw-r--r-- | dot_zsh/plugins/fuzzy | 27 | ||||
| -rw-r--r-- | dot_zsh/source/path.zsh | 25 |
4 files changed, 69 insertions, 0 deletions
diff --git a/dot_zsh/functions/twitch b/dot_zsh/functions/twitch new file mode 100644 index 0000000..8b852f4 --- /dev/null +++ b/dot_zsh/functions/twitch @@ -0,0 +1,6 @@ +#!/bin/zsh +[[ $# -gt 0 ]] || return +(( $+commands[streamlink] )) || return +zstyle -s :function:twitch ${1:l} stream || stream=${1:l} +shift +streamlink twitch.tv/$stream "$@" diff --git a/dot_zsh/plugins/exa b/dot_zsh/plugins/exa new file mode 100644 index 0000000..afdee79 --- /dev/null +++ b/dot_zsh/plugins/exa @@ -0,0 +1,11 @@ +#!/bin/zsh +(( $+commands[exa] )) || return + +# removes default ls-likes, replaces them with exa variants +unalias ls ll l la + +# old ones +alias ls=exa ll='ls -l' l=ll la='l -a' +# extras +alias lr='l -T' +alias lp='lr --git-ignore' diff --git a/dot_zsh/plugins/fuzzy b/dot_zsh/plugins/fuzzy new file mode 100644 index 0000000..ed419c1 --- /dev/null +++ b/dot_zsh/plugins/fuzzy @@ -0,0 +1,27 @@ +#!/bin/zsh +(( $+commands[fd] )) || return # find(1) sucks, not worth without fd + +# if it's not set yet, set it +[[ -z $fuzzy_command ]] && (( $+commands[fzf] )) && fuzzy_command=fzf +[[ -z $fuzzy_command ]] && (( $+commands[sk] )) && fuzzy_command=sk + +local FUZZY_DEFAULT='fd -t f' +local FUZZY_ALT_C='fd -t d' +local FUZZY_CTRL_T="$FUZZY_DEFAULT" + +case $fuzzy_command in + fzf) + export FZF_DEFAULT_COMMAND="$FUZZY_DEFAULT" + export FZF_ALT_C_COMMAND="$FUZZY_ALT_C" + export FZF_CTRL_T_COMMAND="$FUZZY_CTRL_T" + . /usr/share/fzf/key-bindings.zsh + . /usr/share/fzf/completion.zsh + ;; + sk) + export SKIM_DEFAULT_COMMAND="$FUZZY_DEFAULT" + export SKIM_ALT_C_COMMAND="$FUZZY_ALT_C" + export SKIM_CTRL_T_COMMAND="$FUZZY_CTRL_T" + . /usr/share/skim/key-bindings.zsh + . /usr/share/skim/completion.zsh + ;; +esac diff --git a/dot_zsh/source/path.zsh b/dot_zsh/source/path.zsh new file mode 100644 index 0000000..42b8c9d --- /dev/null +++ b/dot_zsh/source/path.zsh @@ -0,0 +1,25 @@ +export CARGO_HOME=~/.local/cargo +export DENO_DIR=~/.local/deno +export GOPATH=~/.local/go +export LUAROCKS_CONFIG=~/.config/luarocks/config.lua + +path+=( + ~/bin + ~/Applications + ~/.local/cargo/bin + ~/.local/go/bin + ~/.local/yarn/bin + ~/.gem/ruby/*/bin(N) +) + +if (( $+commands[luarocks] )); then + PATH="$PATH:$(luarocks path --lr-bin)" # luarocks puts :s in the output + eval $(luarocks path --no-bin) +fi +if (( $+commands[opam] )); then + eval $(opam env) +fi +if (( $+commands[yarn] )) && [[ ! -f ~/.yarnrc ]]; then + yarn config set global-folder ~/.local/yarn/global + yarn config set prefix ~/.local/yarn +fi |
