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

Change ivy height to function of Emacs frame height #1722

Closed
jthaman opened this issue Aug 19, 2018 · 1 comment

Comments

@jthaman
Copy link

commented Aug 19, 2018

Hi, thanks for your great work on this Emacs package.

I would like to set ivy-height to some variable that depends on my monitor situation. Since I use monitors in portrait configuration when my laptop is docked, I like to have ivy-height set to about 30 or 40. When I'm plugged into a landscape monitor or undocked, 30 is too much, I have been manually lowering ivy-height to about 15.

Any tips on how to set ivy-height to about 1/3 of Emacs frame height so that I don't have to manually fiddle with this variable?

Thanks,

@abo-abo abo-abo closed this in 65f8658 Aug 20, 2018

@abo-abo

This comment has been minimized.

Copy link
Owner

commented Aug 20, 2018

Thanks, this config should work now:

(add-to-list 'ivy-height-alist
             (cons 'counsel-find-file
                   (lambda (_caller)
                     (/ (frame-height) 2))))

If you want it for all callers, use t as key:

(setq ivy-height-alist
      '((t
         lambda (_caller)
         (/ (frame-height) 2))))

Let me know if it works as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.