Hi,
I use M-: (shell-command) often, and have turned on the history, I would love to have a counsel interface instead of the default behavior. I'm pretty new to elisp but this snippet was my first attempt
at it, using counsel-describe-function as a start. Well obviously this did not work. Would someone be kind enough to help.
Thanks in advance
(defun counsel-shell-command ()
"Forward to `shell-command'."
(interactive)
(ivy-read "Shell Command: "
(let (cands)
(mapatoms
(lambda (x)
(when (fboundp x)
(push (symbol-name x) cands))))
cands)
:keymap counsel-ag-map
:history 'counsel-shell-command-symbol-history
:require-match t
:sort t
:action (lambda (x)
(shell-command
(intern x)))
:caller 'counsel-shell-command))
Hi,
I use M-: (shell-command) often, and have turned on the history, I would love to have a counsel interface instead of the default behavior. I'm pretty new to elisp but this snippet was my first attempt
at it, using counsel-describe-function as a start. Well obviously this did not work. Would someone be kind enough to help.
Thanks in advance