Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

request to provide ivy interface?? #20

Open
zilongshanren opened this issue May 10, 2016 · 5 comments
Open

request to provide ivy interface?? #20

zilongshanren opened this issue May 10, 2016 · 5 comments

Comments

@zilongshanren
Copy link

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.

@Sliim
Copy link
Owner

Sliim commented May 10, 2016

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?

@zilongshanren
Copy link
Author

zilongshanren commented May 11, 2016

@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! 😄

@Sliim
Copy link
Owner

Sliim commented May 11, 2016

It looks interesting :)
Thanks for these resources, I will try it as soon as possible!

@xuchunyang
Copy link
Contributor

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))))

@Sliim
Copy link
Owner

Sliim commented Jun 12, 2016

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants