From 5cf34717161bd866a634d8a9ad209afb4004857b Mon Sep 17 00:00:00 2001 From: Arun Prakash Jana Date: Thu, 18 Apr 2019 20:27:35 +0530 Subject: Plugins! --- plugins/picker | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100755 plugins/picker (limited to 'plugins/picker') diff --git a/plugins/picker b/plugins/picker new file mode 100755 index 0000000..a500435 --- /dev/null +++ b/plugins/picker @@ -0,0 +1,26 @@ +#!/usr/bin/env sh + +# Description: Pick files and pipe the newline-separated list to another utility +# +# Shell: POSIX compliant +# Author: Arun Prakash Jana +# +# Usage: +# Copy this file in your $PATH, make it executable and preferably name it to picker. +# Run commands like: +# ls -l `picker` +# cd `picker` +# vimdiff `picker` +# or, in fish shell: +# ls -l (picker) +# cd (picker) +# vimdiff (picker) +# +# NOTE: This use case is limited to picking files, other functionality may not work as expected. + +nnn -p /tmp/picked + +if [ -f /tmp/picked ]; then + cat /tmp/picked | tr '\0' '\n' + rm /tmp/picked +fi -- cgit v1.2.3-70-g09d2