]> Sergey Matveev's repositories - nnn.git/commitdiff
Drop fzy support
authorArun Prakash Jana <engineerarun@gmail.com>
Wed, 6 May 2020 13:11:01 +0000 (18:41 +0530)
committerArun Prakash Jana <engineerarun@gmail.com>
Wed, 6 May 2020 13:11:01 +0000 (18:41 +0530)
plugins/.nnn-plugin-helper
plugins/README.md
plugins/fzcd
plugins/fzhist
plugins/fzopen
plugins/fzz
plugins/launch
plugins/pskill
src/nnn.c

index 0f74fc740f72d4734b831b12fbf5b254348e382a..bcb9649fc42541b6738bb0d49398f5cf3e5a1563 100644 (file)
@@ -15,7 +15,7 @@ export CUR_CTX
 ## Ask nnn to switch to directory $1 in context $2.
 ## If $2 is not provided, the function asks explicitly.
 nnn_cd () {
-    dir=$1
+    dir="$1"
 
     if [ -z "$NNN_PIPE" ]; then
         echo "No pipe file found" 1>&2
index ff168a2db294ac0eaf31dd6f3d1f141505ad0334..c902a00099d2413f879e0f09ec7a6e68bba881e3 100644 (file)
@@ -34,10 +34,10 @@ Plugins are installed to `${XDG_CONFIG_HOME:-$HOME/.config}/nnn/plugins`.
 | diffs | Diff for selection (limited to 2 for directories) | sh | vimdiff |
 | dragdrop | Drag/drop files from/into nnn | sh | [dragon](https://github.com/mwh/dragon) |
 | finder | Run custom find command and list | sh | - |
-| fzcd | Change to the directory of a fuzzy-selected file/dir | sh | fzf/fzy<br>fd/fdfind/find |
-| fzhist | Fuzzy-select a cmd from history, edit in `$EDITOR` and run | sh | fzf/fzy |
-| fzopen | Fuzzy find a file in dir subtree and edit or open | sh | fzf/fzy, xdg-open |
-| fzz | Change to any directory in the z database with fzf/fzy | sh | fzf/fzy, z |
+| fzcd | Change to the directory of a fuzzy-selected file/dir | sh | fzf |
+| fzhist | Fuzzy-select a cmd from history, edit in `$EDITOR` and run | sh | fzf |
+| fzopen | Fuzzy find a file in dir subtree and edit or open | sh | fzf, xdg-open |
+| fzz | Change to any directory in the z database with fzf | sh | fzf, z |
 | getplugs | Update plugins to installed `nnn` version | sh | curl |
 | gutenread | Browse, download, read from Project Gutenberg | sh | curl, unzip, w3m<br>[epr](https://github.com/wustho/epr) (optional) |
 | hexview | View a file in hex in `$PAGER` | sh | xxd |
@@ -47,7 +47,7 @@ Plugins are installed to `${XDG_CONFIG_HOME:-$HOME/.config}/nnn/plugins`.
 | imgview | Browse images, set wallpaper, copy path ([config](https://wiki.archlinux.org/index.php/Sxiv#Assigning_keyboard_shortcuts)), [rename](https://github.com/jarun/nnn/wiki/Basic-use-cases#browse-rename-images)| sh | sxiv/[viu](https://github.com/atanunq/viu), less|
 | ipinfo | Fetch external IP address and whois information | sh | curl, whois |
 | kdeconnect | Send selected files to an Android device | sh | kdeconnect-cli |
-| launch | GUI application launcher | sh | fzf/fzy |
+| launch | GUI application launcher | sh | fzf |
 | mediainf | Show media information | sh | mediainfo |
 | mimelist | List files by mime in subtree | sh | fd/find |
 | moclyrics | Show lyrics of the track playing in moc | sh | [ddgr](https://github.com/jarun/ddgr), [moc](http://moc.daper.net/) |
@@ -63,7 +63,7 @@ Plugins are installed to `${XDG_CONFIG_HOME:-$HOME/.config}/nnn/plugins`.
 | picker | Pick files and list one per line (to pipe) | sh | nnn |
 | preview-tabbed | `tabbed`/xembed based file previewer | bash | _see in-file docs_ |
 | preview-tui | Simple TUI file previewer (needs NNN_FIFO) | sh | tmux/xterm/<br>\$TERMINAL, file, tree |
-| pskill | Fuzzy list by name and kill process or zombie | sh | fzf/fzy, ps,<br>sudo/doas |
+| pskill | Fuzzy list by name and kill process or zombie | sh | fzf, ps, sudo/doas |
 | renamer | Batch rename selection or files in dir | sh | [qmv](https://www.nongnu.org/renameutils/)/[vidir](https://joeyh.name/code/moreutils/) |
 | ringtone | Create a variable bitrate mp3 ringtone from file | sh | date, ffmpeg |
 | splitjoin | Split file or join selection | sh | split, cat |
index 5e0b5f0958c6e8a9404af3af6aa1eabfa5da1efc..1925d776842438694c39d22efd54d24cdbb31fbe 100755 (executable)
@@ -1,23 +1,13 @@
 #!/usr/bin/env sh
 
-# Description: Run fzf/fzy, fd/fdfind/find and go to the directory of the file selected
+# Description: Run fzf and go to the directory of the file selected
 #
 # Shell: POSIX compliant
 # Author: Anna Arad
 
 . "$(dirname "$0")"/.nnn-plugin-helper
 
-if [ "$(cmd_exists fzy)" -eq "0" ]; then
-       if [ "$(cmd_exists fd)" -eq "0" ]; then
-               fd=fd
-       elif [ "$(cmd_exists fdfind)" -eq "0" ]; then
-               fd=fdfind
-       else
-               fd=find
-       fi
-
-       sel=$($fd | fzy)
-elif [ "$(cmd_exists fzf)" -eq "0" ]; then
+if [ "$(cmd_exists fzf)" -eq "0" ]; then
        sel=$(fzf)
 else
        exit 1
index e5618ae93838f9dc4c55f3ae0f000c427a0abfbd..a3aac3a3af0e9ed2bf6d1db73157625b2cb9205d 100755 (executable)
@@ -8,8 +8,6 @@
 
 if which fzf >/dev/null 2>&1; then
     fuzzy=fzf
-elif which fzy >/dev/null 2>&1; then
-    fuzzy=fzy
 else
     exit 1
 fi
index a678627d1327f6e02b493ae54212b97c77c08221..677ea26a97390bcac1ab6b825c34b277097bd2e4 100755 (executable)
@@ -1,10 +1,10 @@
 #!/usr/bin/env sh
 
-# Description: Fuzzy find a file in directory subtree with fzy
+# Description: Fuzzy find a file in directory subtree
 #              Opens in $VISUAL or $EDITOR if text
 #              Opens other type of files with xdg-open
 #
-# Dependencies: fd/find, fzf/fzy/skim, xdg-open
+# Dependencies: fd/find, fzf/skim, xdg-open
 #
 # Shell: POSIX compliant
 # Author: Arun Prakash Jana
@@ -19,8 +19,6 @@ if which fzf >/dev/null 2>&1; then
     entry="$(eval "$cmd" | fzf --delimiter / --nth=-1 --tiebreak=begin --info=hidden)"
     # To show only the file name
     # entry=$(find . -type f 2>/dev/null | fzf --delimiter / --with-nth=-1 --tiebreak=begin --info=hidden)
-elif which fzy >/dev/null 2>&1; then
-    entry=$(find . -type f 2>/dev/null | fzy)
 elif which sk >/dev/null 2>&1; then
        entry=$(find . -type f 2>/dev/null | sk)
 else
index 5b40269829398f607ff401d9185c273ef39a2238..049cf9dca49d8c400ef6e4a95bab110e33ddfa41 100755 (executable)
@@ -9,8 +9,6 @@
 
 if which fzf >/dev/null 2>&1; then
     fuzzy=fzf
-elif which fzy >/dev/null 2>&1; then
-    fuzzy=fzy
 else
     exit 1
 fi
@@ -19,7 +17,7 @@ datafile="${_Z_DATA:-$HOME/.z}"
 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/fzy pane
+    # 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
index e98314071ee5b9024a27f367839c55f70beaf981..19855f980cdce27b408a1e7f3df8da112187fd1b 100755 (executable)
@@ -9,7 +9,7 @@
 #
 #              xfce4-terminal -e "${XDG_CONFIG_HOME:-$HOME/.config}/nnn/plugins/launch
 #
-# Dependencies: fzf/fzy
+# Dependencies: fzf
 #
 # Usage: launch [delay]
 #        delay is in seconds, if omitted launch waits for 1 sec
@@ -26,8 +26,6 @@ IFS=':'
 get_selection() {
     if which fzf >/dev/null 2>&1; then
         { IFS=':'; ls -H $PATH; } | sort | fzf
-    elif which fzy >/dev/null 2>&1; then
-        { IFS=':'; ls -H $PATH; } | sort | fzy
     else
         exit 1
     fi
index c23034f7b6b46c0723b81f9ad2fbca8fee96123d..063be3520a25afe4e66f433f37dbfa381fe194b9 100755 (executable)
@@ -2,7 +2,7 @@
 
 # Description: Fuzzy list and kill a (zombie) process by name
 #
-# Dependencies: fzf or fzy, ps
+# Dependencies: fzf, ps
 #
 # Note: To kill a zombie process enter "zombie"
 #
@@ -24,8 +24,6 @@ if ! [ -z "$psname" ]; then
 
     if which fzf >/dev/null 2>&1; then
         fuzzy=fzf
-    elif which fzy >/dev/null 2>&1; then
-        fuzzy=fzy
     else
         exit 1
     fi
index 73e656ce2b14d3645c025b7b0fa5266ce0b2cc09..0bafe234c5cf9c3b940358272da1da5d83c058c5 100644 (file)
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -431,10 +431,9 @@ static uint g_states;
 #define UTIL_LESS 13
 #define UTIL_SH 14
 #define UTIL_FZF 15
-#define UTIL_FZY 16
-#define UTIL_NTFY 17
-#define UTIL_CBCP 18
-#define UTIL_NMV 19
+#define UTIL_NTFY 16
+#define UTIL_CBCP 17
+#define UTIL_NMV 18
 
 /* Utilities to open files, run actions */
 static char * const utils[] = {
@@ -470,7 +469,6 @@ static char * const utils[] = {
        "less",
        "sh",
        "fzf",
-       "fzy",
        ".ntfy",
        ".cbcp",
        ".nmv",
@@ -4287,6 +4285,7 @@ static void readpipe(int fd, char **path, char **lastname, char **lastdir)
                if (ctx == 0 || ctx == cfg.curctx + 1) {
                        xstrsncpy(*lastdir, *path, PATH_MAX);
                        xstrsncpy(*path, nextpath, PATH_MAX);
+                       DPRINTF_S(*path);
                } else {
                        r = ctx - 1;
 
@@ -4351,7 +4350,7 @@ static void launch_app(const char *path, char *newpath)
 
        mkpath(plugindir, utils[UTIL_LAUNCH], newpath);
 
-       if (!(getutil(utils[UTIL_FZF]) || getutil(utils[UTIL_FZY])) || access(newpath, X_OK) < 0) {
+       if (!getutil(utils[UTIL_FZF]) || access(newpath, X_OK) < 0) {
                tmp = xreadline(NULL, messages[MSG_APP_NAME]);
                r = F_NOWAIT | F_NOTRACE | F_MULTI;
        }