• Stars
    star
    410
  • Rank 102,434 (Top 3 %)
  • Language
    Emacs Lisp
  • Created over 6 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

ivy-posframe is a ivy extension, which let ivy use posframe to show its candidate menu, ivy-posframe is a **GNU ELPA** package.

Note: this file is auto converted from ivy-posframe.el by el2org, please do not edit it by hand!!!

目录

  1. ivy-posframe README
    1. What is ivy-posframe
    2. Display functions
    3. How to enable ivy-posframe
      1. Global mode
      2. Per-command mode.
    4. Tips
      1. How to show fringe to ivy-posframe
      2. How to custom your ivy-posframe style

ivy-posframe README

What is ivy-posframe

ivy-posframe is a ivy extension, which let ivy use posframe to show its candidate menu.

NOTE: ivy-posframe requires Emacs 26 and do not support mouse click.

Display functions

  1. ivy-posframe-display
  2. ivy-posframe-display-at-frame-center
  3. ivy-posframe-display-at-window-center img
  4. ivy-posframe-display-at-frame-bottom-left
  5. ivy-posframe-display-at-window-bottom-left img
  6. ivy-posframe-display-at-frame-bottom-window-center
  7. ivy-posframe-display-at-point img

How to enable ivy-posframe

Global mode

(require 'ivy-posframe)
;; display at `ivy-posframe-style'
(setq ivy-posframe-display-functions-alist '((t . ivy-posframe-display)))
;; (setq ivy-posframe-display-functions-alist '((t . ivy-posframe-display-at-frame-center)))
;; (setq ivy-posframe-display-functions-alist '((t . ivy-posframe-display-at-window-center)))
;; (setq ivy-posframe-display-functions-alist '((t . ivy-posframe-display-at-frame-bottom-left)))
;; (setq ivy-posframe-display-functions-alist '((t . ivy-posframe-display-at-window-bottom-left)))
;; (setq ivy-posframe-display-functions-alist '((t . ivy-posframe-display-at-frame-top-center)))
(ivy-posframe-mode 1)

Per-command mode.

(require 'ivy-posframe)
;; Different command can use different display function.
(setq ivy-posframe-display-functions-alist
      '((swiper          . ivy-posframe-display-at-point)
        (complete-symbol . ivy-posframe-display-at-point)
        (counsel-M-x     . ivy-posframe-display-at-window-bottom-left)
        (t               . ivy-posframe-display)))
(ivy-posframe-mode 1)

You can use ivy original display function on specify function. You may want to use the original display function because display of Swiper at point hides the contents of the buffer.

(require 'ivy-posframe)
;; Different command can use different display function.
(setq ivy-posframe-display-functions-alist
      '((swiper          . ivy-display-function-fallback)
        (complete-symbol . ivy-posframe-display-at-point)
        (counsel-M-x     . ivy-posframe-display-at-window-bottom-left)
        (t               . ivy-posframe-display)))
(ivy-posframe-mode 1)

You may want to change the height of ivy by a function only while using posframe. This is possible with the code below.

The following example displays swiper on 20 lines by default for ivy, and displays other functions in posframe at the location specified on 40 lines.

(require 'ivy-posframe)
;; Different command can use different display function.
(setq ivy-posframe-height-alist '((swiper . 20)
                                  (t      . 40)))

(setq ivy-posframe-display-functions-alist
      '((swiper          . ivy-display-function-fallback)
        (complete-symbol . ivy-posframe-display-at-point)
        (counsel-M-x     . ivy-posframe-display-at-window-bottom-left)
        (t               . ivy-posframe-display)))
(ivy-posframe-mode 1)

NOTE: Using swiper as example: swiper's display function only take effect when you call swiper command with global keybinding, if you call swiper command with 'M-x' (for example: counsel-M-x), counsel-M-x's display function will take effect instead of swiper's.

The value of variable `this-command' will be used as the search key by ivy to find display function in `ivy-display-functions-alist', "C-h v this-command" is a good idea.

Tips

How to show fringe to ivy-posframe

(setq ivy-posframe-parameters
      '((left-fringe . 8)
        (right-fringe . 8)))

By the way, User can set any parameters of ivy-posframe with the help of `ivy-posframe-parameters'.

How to custom your ivy-posframe style

The simplest way is:

(defun ivy-posframe-display-at-XXX (str)
  (ivy-posframe--display str #'your-own-poshandler-function))
(setq ivy-posframe-display-functions-alist '((t . ivy-posframe-display-at-XXX)))
(ivy-posframe-mode 1) ; This line is needed.

More Repositories

1

pyim

一个 emacs 中文输入法,支持全拼,双拼,五笔,仓颉和Rime,pyim 是 GNU elpa 包。
Emacs Lisp
876
star
2

cnfonts

emacs中文字体配置工具。可以快速方便的的实现中文字体和英文字体等宽(也就是常说的中英文对齐)。
Emacs Lisp
677
star
3

posframe

Pop a posframe (just a child-frame) at point, posframe is a **GNU ELPA** package!
Emacs Lisp
387
star
4

company-posframe

Emacs Lisp
114
star
5

org2web

A static site generator based on org-mode
Emacs Lisp
89
star
6

exwm-x

A derivative WM based on EXWM (emacs x window manager)
Emacs Lisp
80
star
7

el2org

Convert an emacs-lisp file to org file
Emacs Lisp
64
star
8

vertico-posframe

Emacs Lisp
60
star
9

eltips

Emacs-lisp 奇淫异技
45
star
10

emacs-helper

(tumashu's emacs configure)
Emacs Lisp
35
star
11

org2ctex

Export org to ctex (a latex macro for Chinese)
Emacs Lisp
32
star
12

org-capture-pop-frame

Pop a new frame, then run org-capture
Emacs Lisp
31
star
13

pyim-greatdict

A chinese-pyim dict, which include three million words!
Emacs Lisp
28
star
14

chinese-yasdcv

一个简单的sdcv字典程序的emacs前端。
Emacs Lisp
26
star
15

helm-posframe

Emacs Lisp
24
star
16

pyim-bigdict

这个文件是一个 Chinese-pyim 拼音词库文件,词量超过100万,词库大于20M,这个词库仅供个人使用。
21
star
17

pyim-wbdict

Wubi dicts for pyim
Emacs Lisp
11
star
18

pyim-basedict

The default pyim dict, this package is a **GNU ELPA** package.
Emacs Lisp
10
star
19

ox-bibtex-chinese

Let ox-bibtex works well for chinese users
TeX
9
star
20

gitpatch

Mail git patch in emacs
Emacs Lisp
9
star
21

gnus-select-account

Emacs Lisp
6
star
22

geeguix

Tumashu's guixsd configure
Scheme
4
star
23

org-picklink

Pop up a org-agenda window, and select a headline's link, then insert to current org-buffer.
Emacs Lisp
4
star
24

share2computer

Emacs Lisp
3
star