From ee9a615cfe8f3c906461368a6f583afe316e456d Mon Sep 17 00:00:00 2001 From: FollieHiyuki Date: Sat, 9 Oct 2021 13:08:33 +0700 Subject: [PATCH] shells: drop z.lua, add fish completion for zoxide --- home/.bashrc-bloated | 25 ------------------------- home/.config/fish/completions/z.fish | 2 ++ home/.config/fish/conf.d/env.fish | 9 --------- home/.config/fish/conf.d/evaluate.fish | 18 ------------------ home/.config/lf/lfrc | 10 +++------- home/.config/nnn/plugins/fzz | 13 +------------ home/.config/vifm/scripts/fzfz | 7 ------- home/.config/vifm/vifmrc | 4 ++-- home/.config/zsh/.zshenv | 9 --------- home/.config/zsh/.zshrc | 8 -------- home/.config/zsh/plugins.zsh | 1 - 11 files changed, 8 insertions(+), 98 deletions(-) create mode 100644 home/.config/fish/completions/z.fish delete mode 100755 home/.config/vifm/scripts/fzfz diff --git a/home/.bashrc-bloated b/home/.bashrc-bloated index fcfb02e..28d2525 100644 --- a/home/.bashrc-bloated +++ b/home/.bashrc-bloated @@ -79,15 +79,6 @@ export _ZO_DATA_DIR="$HOME/.local/share/zoxide" export _ZO_ECHO=1 export _ZO_FZF_OPTS="$FZF_DEFAULT_OPTS --no-multi" export _ZO_RESOLVE_SYMLINKS=1 -# z.lua -# export _ZL_DATA="$HOME/.local/share/zlua/zlua" -# export _ZL_HYPHEN=1 -# export _ZL_ECHO=1 -# export _ZL_MATCH_MODE=1 -# export _ZL_FZF_FLAG="--exact --no-multi" -# export _ZL_INT_SORT=1 -# export _ZL_ROOT_MARKERS=".git,.svn,.hg,.root,package.json,.projectile,.pro" -# export RANGER_ZLUA="$HOME/.local/share/bash/z.lua" # nodenv export NODENV_ROOT="$HOME/.local/share/nodenv" # pyenv @@ -536,22 +527,6 @@ fi # fi # eval "$(nodenv init -)" -# z.lua -# if [[ ! -f "$HOME/.local/share/bash/z.lua" ]]; then -# curl -fLo $HOME/.local/share/bash/z.lua https://raw.githubusercontent.com/skywind3000/z.lua/master/z.lua -# mkdir -p $HOME/.local/share/zlua -# fi -# eval "$(lua $HOME/.local/share/bash/z.lua --init bash fzf)" -# if command -v ranger >/dev/null; then -# if [ ! -f "$HOME/.config/ranger/plugins/ranger_zlua.py" ]; then -# curl -fLo $HOME/.config/ranger/plugins/ranger_zlua.py https://github.com/skywind3000/z.lua/raw/master/ranger_zlua.py -# fi -# fi -# alias zz='z -c' # restrict matches to subdirs of $PWD -# alias zi='z -i' # cd with interactive selection -# alias zf='z -I' # use fzf to select in multiple matches -# alias zb='z -b' # quickly cd to the parent directory - # zoxide if command -v zoxide >/dev/null; then eval "$(zoxide init bash)" diff --git a/home/.config/fish/completions/z.fish b/home/.config/fish/completions/z.fish new file mode 100644 index 0000000..1acf348 --- /dev/null +++ b/home/.config/fish/completions/z.fish @@ -0,0 +1,2 @@ +complete z -f -a "(__fish_complete_directories (commandline -t) '')" +complete z -n "test -n (commandline -t)" -a "(zoxide query -l -- (commandline -t))" -k diff --git a/home/.config/fish/conf.d/env.fish b/home/.config/fish/conf.d/env.fish index dd1d6b2..719ee7f 100644 --- a/home/.config/fish/conf.d/env.fish +++ b/home/.config/fish/conf.d/env.fish @@ -96,15 +96,6 @@ set -gx _ZO_DATA_DIR $HOME/.local/share/zoxide set -gx _ZO_ECHO 1 set -gx _ZO_FZF_OPTS "$FZF_DEFAULT_OPTS --no-multi" set -gx _ZO_RESOLVE_SYMLINKS 1 -# z.lua -# set -gx _ZL_DATA $HOME/.local/share/zlua/zlua -# set -gx _ZL_ECHO 1 -# set -gx _ZL_HYPHEN 1 -# set -gx _ZL_MATCH_MODE 1 -# set -gx _ZL_FZF_FLAG '--exact --no-multi' -# set -gx _ZL_INT_SORT 1 -# set -gx _ZL_ROOT_MARKERS ".git,.svn,.hg,.root,package.json,.projectile,.pro" -# set -gx RANGER_ZLUA $HOME/.config/fish/z.lua # forgit if test -n "$XDG_SESSION_TYPE" if test $XDG_SESSION_TYPE = "wayland" diff --git a/home/.config/fish/conf.d/evaluate.fish b/home/.config/fish/conf.d/evaluate.fish index 9eef0fa..9bcbb77 100644 --- a/home/.config/fish/conf.d/evaluate.fish +++ b/home/.config/fish/conf.d/evaluate.fish @@ -60,24 +60,6 @@ if not test -f "$HOME/.config/fish/functions/fzf_key_bindings.fish" end fzf_key_bindings -# z.lua -# if not test -f "$HOME/.config/fish/z.lua" -# curl -fLo $HOME/.config/fish/z.lua https://raw.githubusercontent.com/skywind3000/z.lua/master/z.lua -# mkdir -p $HOME/.local/share/zlua -# end -# lua $HOME/.config/fish/z.lua --init fish | source -# if command -v ranger >/dev/null -# if not test -f "$HOME/.config/ranger/plugins/ranger_zlua.py" -# curl -fLo $HOME/.config/ranger/plugins/ranger_zlua.py https://github.com/skywind3000/z.lua/raw/master/ranger_zlua.py -# end -# end -# alias zc='z -c' # restrict matches to subdirs of $PWD -# alias zz='z -i' # cd with interactive selection -# alias zf='z -I' # use fzf to select in multiple matches -# alias zb='z -b' # quickly cd to the parent directory -# alias zbi='z -b -i' # interactive jump backward -# alias zbf='z -b -I' # interactive jump backward with fzf - # zoxide if command -v zoxide >/dev/null zoxide init fish | source diff --git a/home/.config/lf/lfrc b/home/.config/lf/lfrc index a69ef87..a281dc8 100644 --- a/home/.config/lf/lfrc +++ b/home/.config/lf/lfrc @@ -197,13 +197,9 @@ cmd Link %{{ fi }} -# fzf + zlua/zoxide +# fzf + zoxide cmd fzz ${{ - if command -v zoxide >/dev/null; then - sel=$(zoxide query --list | fzf --no-multi) - else - sel=$(awk -F "|" '{print $1}' "$HOME/.local/share/zlua/zlua" | fzf --no-multi | awk '{$1=$1};1') - fi + sel=$(zoxide query --list | fzf --no-multi) lf -remote "send $id cd \"$sel\"" }} @@ -233,7 +229,7 @@ map o open-with # fzf map $vi $(fzf) -map zlua +map fzz map f :fzf_jump # archives diff --git a/home/.config/nnn/plugins/fzz b/home/.config/nnn/plugins/fzz index 55a9e0a..d8d7533 100755 --- a/home/.config/nnn/plugins/fzz +++ b/home/.config/nnn/plugins/fzz @@ -1,9 +1,6 @@ #!/usr/bin/env sh # Description: cd to any dir in the z database using an fzf pane -# -# Shell: POSIX compliant -# Author: Nick Waywood . "$(dirname "$0")"/.nnn-plugin-helper @@ -16,15 +13,7 @@ fi if command -v zoxide >/dev/null; then sel=$(zoxide query --list | $fuzzy) else - datafile="${_ZL_DATA:-$HOME/.local/share/zlua/zlua}" - if [ -f "$datafile" ]; then - # I read the data from z's file instead of calling the z command so that the data doesn't need to be processed twice - sel=$(awk -F "|" '{print $1}' "$datafile" | $fuzzy | awk '{$1=$1};1') - # NOTE: Uncomment this line and comment out the line above if you want to see the weightings of the dir's in the fzf pane - # sel=$(awk -F "|" '{printf "%s %s\n", $2, $1}' "$datafile" | $fuzzy | sed 's/^[0-9,.]* *//' | awk '{$1=$1};1') - else - exit 1 - fi + exit 1 fi printf "%s" "0c$sel" > "$NNN_PIPE" diff --git a/home/.config/vifm/scripts/fzfz b/home/.config/vifm/scripts/fzfz deleted file mode 100755 index aff0662..0000000 --- a/home/.config/vifm/scripts/fzfz +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh - -if command -v zoxide >/dev/null; then - zoxide query --list | fzf --no-multi -else - awk -F "|" '{print $1}' "$HOME/.local/share/zlua/zlua" | fzf --no-multi | awk '{$1=$1};1' -fi diff --git a/home/.config/vifm/vifmrc b/home/.config/vifm/vifmrc index 1221530..4a6c0b1 100644 --- a/home/.config/vifm/vifmrc +++ b/home/.config/vifm/vifmrc @@ -151,8 +151,8 @@ command! fzd : let $FZF_RES = term('fd --type d --follow --hidden --exclude .git \| cd $FZF_RES \| endif -" fzf zoxide/zlua -command! z : let $FZF_RES = term('fzfz 2>&0') +" fzf zoxide +command! z : let $FZF_RES = term('zoxide query --list | fzf --no-multi 2>&0') \| if $FZF_RES != '' \| cd $FZF_RES \| endif diff --git a/home/.config/zsh/.zshenv b/home/.config/zsh/.zshenv index cdc76ce..3514290 100644 --- a/home/.config/zsh/.zshenv +++ b/home/.config/zsh/.zshenv @@ -378,15 +378,6 @@ export ZSH_PLUGINS_ALIAS_TIPS_TEXT="💡 => " # zsh-autosuggestions export ZSH_AUTOSUGGEST_STRATEGY=(history completion) export ZSH_AUTOSUGGEST_USE_ASYNC=1 -# z.lua -# export _ZL_DATA="$HOME/.local/share/zlua/zlua" -# export _ZL_ECHO=1 -# export _ZL_HYPHEN=1 -# export _ZL_MATCH_MODE=1 -# export _ZL_FZF_FLAG="--exact --no-multi" -# export _ZL_INT_SORT=1 -# export _ZL_ROOT_MARKERS=".git,.svn,.hg,.root,package.json,.projectile,.pro" -# export RANGER_ZLUA="$HOME/.local/share/zsh/zinit/plugins/skywind3000---z.lua/z.lua" # zsh-abbr export ABBR_USER_ABBREVIATIONS_FILE="$HOME/.local/share/zsh/abbreviations" # gencomp diff --git a/home/.config/zsh/.zshrc b/home/.config/zsh/.zshrc index 355959a..1831b94 100644 --- a/home/.config/zsh/.zshrc +++ b/home/.config/zsh/.zshrc @@ -148,14 +148,6 @@ zinit light wfxr/forgit zinit light olets/zsh-abbr # zinit light djui/alias-tips -# cd around faster with zlua -# zinit light skywind3000/z.lua -# if command -v ranger >/dev/null; then -# if [ ! -f "$HOME/.config/ranger/plugins/ranger_zlua.py" ]; then -# curl -fLo $HOME/.config/ranger/plugins/ranger_zlua.py https://github.com/skywind3000/z.lua/raw/master/ranger_zlua.py -# fi -# fi - # Plugins' configurations source $ZDOTDIR/plugins.zsh diff --git a/home/.config/zsh/plugins.zsh b/home/.config/zsh/plugins.zsh index 4ad2059..f33fcd9 100644 --- a/home/.config/zsh/plugins.zsh +++ b/home/.config/zsh/plugins.zsh @@ -30,7 +30,6 @@ bindkey '^O' autosuggest-accept zstyle ':fzf-tab:*' single-group '' zstyle ':fzf-tab:*' continuous-trigger '/' zstyle ':fzf-tab:*' print-query alt-enter -zstyle ':fzf-tab:complete:_zlua:*' query-string input zstyle ':fzf-tab:complete:kill:argument-rest' fzf-preview 'ps --pid=$word -o cmd --no-headers -w -w' zstyle ':fzf-tab:complete:kill:argument-rest' fzf-flags '--preview-window=down:3:wrap' zstyle ':fzf-tab:complete:kill:*' popup-pad 0 3