## 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
| 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 |
| 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/) |
| 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 |
#!/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
if which fzf >/dev/null 2>&1; then
fuzzy=fzf
-elif which fzy >/dev/null 2>&1; then
- fuzzy=fzy
else
exit 1
fi
#!/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
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
if which fzf >/dev/null 2>&1; then
fuzzy=fzf
-elif which fzy >/dev/null 2>&1; then
- fuzzy=fzy
else
exit 1
fi
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
#
# 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
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
# 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"
#
if which fzf >/dev/null 2>&1; then
fuzzy=fzf
- elif which fzy >/dev/null 2>&1; then
- fuzzy=fzy
else
exit 1
fi
#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[] = {
"less",
"sh",
"fzf",
- "fzy",
".ntfy",
".cbcp",
".nmv",
if (ctx == 0 || ctx == cfg.curctx + 1) {
xstrsncpy(*lastdir, *path, PATH_MAX);
xstrsncpy(*path, nextpath, PATH_MAX);
+ DPRINTF_S(*path);
} else {
r = ctx - 1;
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;
}