Open zilongshanren opened 8 years ago
Hi!
Hmm why not :). But I'm not a ivy-mode
user so I don't know how it works. Do you have some diff to share where I can see the effort to add this support?
Maybe consider to rename the project to github-stars
that provides both helm-github-stars
and ivy-github-stars
separately?
@Sliim
Hi, thanks. I think rename the repo to emacs-github-stars
might be more clearer.
Here is a example for flyspell:
The helm interface: https://github.com/pronobis/helm-flyspell
The ivy interface: https://github.com/d12frosted/flyspell-correct (This repo also provide helm interface)
And here are many helm porting elisp functions rewritten with ivy:
https://github.com/abo-abo/swiper/blob/master/counsel.el
And a few blog posts:
ivy-mode
uses minubuffer for overview, it's suuuuuuuuuuper faster than helm...
I hope these links helps and look forward to have ivy for github-stars! 😄
It looks interesting :) Thanks for these resources, I will try it as soon as possible!
I don't use ivy either, instead of writing helm or ivy specific code, we can also provide a universal command which uses Emacs standard completing function completing-read
, as far as I know, both helm-mode and ivy-mode can "hijack" that function.
(defun github-stars (&optional refresh)
"Search and open your GitHub stars.
With prefix argument, refresh cache."
(interactive "P")
(when refresh (hgs/clear-cache-file))
(let ((repo
(completing-read
"> "
(mapcar #'hgs/get-repo-name (hgs/get-github-stars)))))
(browse-url (concat "https://github.com/" repo))))
(defun github-repos (&optional refresh)
"Search and open your GitHub repos.
With prefix argument, refresh cache."
(interactive "P")
(when refresh (hgs/clear-cache-file))
(let ((repo
(completing-read
"> "
(mapcar #'hgs/get-repo-name (hgs/get-github-repos)))))
(browse-url (concat "https://github.com/" repo))))
Thx @xuchunyang
So we can split code in several files:
github-stars.el
that contains core functions and Emacs standard completing support.helm-github-stars.el
that adds Helm support.ivy-github-stars.el
that adds Ivy support.
I know helm is a good interface for completion, but ivy wins in performance.
Recently I have replaced all the helm stuff in my Spacemacs config with ivy replacement and it works fine and I gain lots of performance boost.
One thing I miss most might be the helm-github-stars, could you consider add ivy support?
Thanks.