diff --git a/fish/.config/fish/conf.d/z.fish b/fish/.config/fish/conf.d/z.fish new file mode 100644 index 0000000..4033eba --- /dev/null +++ b/fish/.config/fish/conf.d/z.fish @@ -0,0 +1,44 @@ +if test -z "$Z_DATA" + if test -z "$XDG_DATA_HOME" + set -U Z_DATA_DIR "$HOME/.local/share/z" + else + set -U Z_DATA_DIR "$XDG_DATA_HOME/z" + end + set -U Z_DATA "$Z_DATA_DIR/data" +end + +if test ! -e "$Z_DATA" + if test ! -e "$Z_DATA_DIR" + mkdir -p -m 700 "$Z_DATA_DIR" + end + touch "$Z_DATA" +end + +if test -z "$Z_CMD" + set -U Z_CMD "z" +end + +set -U ZO_CMD "$Z_CMD"o + +if test ! -z $Z_CMD + function $Z_CMD -d "jump around" + __z $argv + end +end + +if test ! -z $ZO_CMD + function $ZO_CMD -d "open target dir" + __z -d $argv + end +end + +if not set -q Z_EXCLUDE + set -U Z_EXCLUDE $HOME +end + +# Setup completions once first +__z_complete + +function __z_on_variable_pwd --on-variable PWD + __z_add +end diff --git a/fish/.config/fish/fish_variables b/fish/.config/fish/fish_variables index 9429466..ca50685 100644 --- a/fish/.config/fish/fish_variables +++ b/fish/.config/fish/fish_variables @@ -7,7 +7,11 @@ SETUVAR FZF_PREVIEW_FILE_CMD:head\x20\x2dn\x2010 SETUVAR FZF_TMUX_HEIGHT:40\x25 SETUVAR --export TERM:screen\x2d256color SETUVAR THEME_EDEN_PROMPT_CHAR:\u00bb -SETUVAR Z_DATA_DIR:/Users/colinpowell/\x2elocal/share/z +SETUVAR ZO_CMD:zo +SETUVAR Z_CMD:z +SETUVAR Z_DATA:/home/powellc/\x2elocal/share/z/data +SETUVAR Z_DATA_DIR:/home/powellc/\x2elocal/share/z +SETUVAR Z_EXCLUDE:/home/powellc SETUVAR __done_min_cmd_duration:5000 SETUVAR __fish_init_2_39_8:\x1d SETUVAR __fish_init_2_3_0:\x1d diff --git a/fish/.config/fish/fishfile b/fish/.config/fish/fishfile index f1f8ac3..38bd484 100644 --- a/fish/.config/fish/fishfile +++ b/fish/.config/fish/fishfile @@ -6,3 +6,4 @@ joseluisq/gitnow fishpkg/fish-git-util oh-my-fish/theme-krisleech lfiolhais/theme-simple-ass-prompt +jethrokuan/z