summaryrefslogtreecommitdiff
path: root/dot_zsh/plugins
diff options
context:
space:
mode:
authorChloe Kudryavtsev <toast@toast.cafe>2020-01-13 22:30:22 -0500
committerChloe Kudryavtsev <toast@toast.cafe>2020-01-13 22:30:22 -0500
commit1c0068229111351ca6ecde7d22bfd8c0bf05c92b (patch)
tree8df34fd9c1f531f1a7a2c4674ebdf21ce71a5aff /dot_zsh/plugins
parentadd bin symlink and auto-create target directory (diff)
zsh: add common toasty plugins I use
Diffstat (limited to 'dot_zsh/plugins')
-rw-r--r--dot_zsh/plugins/exa9
-rw-r--r--dot_zsh/plugins/fuzzy28
2 files changed, 37 insertions, 0 deletions
diff --git a/dot_zsh/plugins/exa b/dot_zsh/plugins/exa
new file mode 100644
index 0000000..a940f8c
--- /dev/null
+++ b/dot_zsh/plugins/exa
@@ -0,0 +1,9 @@
+#!/bin/zsh
+# 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..eadedd1
--- /dev/null
+++ b/dot_zsh/plugins/fuzzy
@@ -0,0 +1,28 @@
+#!/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