pier icon indicating copy to clipboard operation
pier copied to clipboard

:feature-request: add fuzzy search menu bolow

Open sl5net opened this issue 5 years ago • 2 comments

may its a bit different concept. i possible please add to your to-do-list: add fuzzy search menu bolow. i tried to do something with https://github.com/sl5net/Lintalist4Linux thanks

sl5net avatar Aug 29 '20 21:08 sl5net

Hey,

Thanks for the suggestion this is something we would like to add to Pier, just haven't decided which route to go down for what kinda interface.

Here's a few two examples that I've been using if that helps you out:

Emacs (requires ivy, s.el, dash.el)

(defun pier-list-function ()
  (s-lines (shell-command-to-string "pier ls -q")))

(defun pier-run-action (alias)
  (shell-command
   (format "pier run %s"
	   (shell-quote-argument
	    (substring alias 0 (string-match-p " " alias))))))



(defun pier-list-ivy ()
  (interactive)
  (ivy-read "Run pier script: " (pier-list-function)
	    :action 'pier-run-action))

Shell version, requires fzf

pier-fzy () {
    pier ls -q | fzf --bind='enter:execute(pier show {})+abort,ctrl-e:execute(pier edit {}),ctrl-r:execute(pier run {} | less)'
}

Plommonsorbet avatar Sep 25 '20 00:09 Plommonsorbet

Enough example of using pier with fzf. You can added this to your alias. Hope this will be helpful.

pier_fzf() {
  pier $(pier list | awk NR\>2 | fzf | awk '{print $1}')
}

CHNB128 avatar Oct 18 '20 19:10 CHNB128