From 415a6edd4a553d2ecf3b2b26b79ab844473127a3 Mon Sep 17 00:00:00 2001 From: Nick Waywood Date: Thu, 2 Apr 2020 16:24:24 +1100 Subject: Added support for fzy (#505) * Added fzfz plugin * Fixed shellcheck errors * Fixed copy/paste error * Added support for fzy, also renamed plugin since it's not specific to fzf anymore * Refactored code * Clean spillovers (jarun) --- plugins/fzfz | 23 ----------------------- 1 file changed, 23 deletions(-) delete mode 100755 plugins/fzfz (limited to 'plugins/fzfz') diff --git a/plugins/fzfz b/plugins/fzfz deleted file mode 100755 index cb5e08a..0000000 --- a/plugins/fzfz +++ /dev/null @@ -1,23 +0,0 @@ -#!/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 - -if [ "$(cmd_exists fzf)" -eq "0" ]; then - if [ -f "$HOME/.z" ]; 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}' "$HOME/.z" | fzf | 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}' "$HOME/.z" | fzf | sed 's/^[0-9,.]* *//' | awk '{$1=$1};1') - else - exit 1 - fi -else - exit 1 -fi - -printf "%s" "0$sel" > "$NNN_PIPE" -- cgit v1.3.1