Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 46 additions & 2 deletions doc/popup.jax
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
*popup.txt* For Vim バージョン 9.2. Last change: 2026 Feb 14
*popup.txt* For Vim バージョン 9.2. Last change: 2026 Feb 18


VIM リファレンスマニュアル by Bram Moolenaar
Expand All @@ -22,8 +22,9 @@
ポップアップフィルタ |popup-filter|
ポップアップコールバック |popup-callback|
ポップアップスクロールバー |popup-scrollbar|
ポップアップの透過度 |popup-opacity|
ポップアップマスク |popup-mask|
3. 例 |popup-examples|
4. 例 |popup-examples|


{|+popupwin| 機能無効でコンパイルされたときは使用できない}
Expand Down Expand Up @@ -776,6 +777,13 @@ popup_create() に渡す。
プウィンドウを閉じない。
highlight 'wincolor' オプションに格納されている、テキストに使用
するハイライトグループ名。
opacity ポップアップの透過度。0 から 100 までの値である。
0 は完全に透明 (背景テキストが完全に表示される)。100
は完全に不透明 (デフォルト、不透明)。この間の値を指定
すると、ポップアップの背景と下のテキストがブレンドさ
れ、部分的に透明になる。'termguicolors' を設定する必要
がある。
|popup-opacity| も参照。
padding ポップアップの上/右/下/左のパディングを定義する数値の
リスト(CSSと同様)。空のリストは、すべて 1 のパディング
を使用する。パディングは、テキストをボーダーの内側で囲
Expand Down Expand Up @@ -1040,6 +1048,42 @@ Note "x" はポップアップを閉じる通常の方法である。Escを使
ないように制限されている。



☆ポップアップの透過度 *popup-opacity*

ポップアップウィンドウは、"opacity" オプションを設定することで半透明にすること
ができる。透過度の値は 0 から 100 の範囲である。
0 完全に透明 - ポップアップの背景は見えず、ポップアップの背後に
あるテキストは完全に表示される。
100 完全に不透明 (デフォルト) - ポップアップは完全に不透明になる。
1-99 半透明 - ポップアップの背景が下にあるテキストとブレンドされ、
両方がうっすらと表示される。

透明効果を使用するには、GUI を使用するか、ターミナルで 'termguicolors' を有効
にする必要がある。有効にしない場合、透過度設定は効果がない。

ポップアップが透明な場合:
- ポップアップの背景色は背景のテキストとブレンドされる
- ポップアップのテキスト (前景) は完全に表示され、ブレンドされない
- ポップアップの背後のテキストは透明な領域を通して見える
- ポップアップの透明度が高いほど (不透明度が低いほど)、背景のテキストがよりはっ
きりと見える

これは以下の場合に役立つ:
- 下のテキストを完全に隠さないオーバーレイウィンドウの作成
- 画面を遮ることなくコンテキスト情報を表示する
- 視覚効果とモダンな UI デザインを作成する

透過度 50 %の例: >
let winid = popup_create('Semi-transparent text', #{
\ line: 5,
\ col: 10,
\ opacity: 50,
\ })

透過度は |popup_setoptions()| を使用して動的に変更できる: >
call popup_setoptions(winid, #{opacity: 80})

☆ポップアップマスク *popup-mask*

ポップアップがカバーするテキストを最小化するために、その一部を透明にすることが
Expand Down
46 changes: 45 additions & 1 deletion en/popup.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
*popup.txt* For Vim version 9.2. Last change: 2026 Feb 14
*popup.txt* For Vim version 9.2. Last change: 2026 Feb 18


VIM REFERENCE MANUAL by Bram Moolenaar
Expand All @@ -21,6 +21,7 @@ Displaying text in a popup window. *popup* *popup-window* *popupwin*
Popup filter |popup-filter|
Popup callback |popup-callback|
Popup scrollbar |popup-scrollbar|
Popup opacity |popup-opacity|
Popup mask |popup-mask|
4. Examples |popup-examples|

Expand Down Expand Up @@ -772,6 +773,13 @@ The second argument of |popup_create()| is a dictionary with options:
the popup window.
highlight Highlight group name to use for the text, stored in
the 'wincolor' option.
opacity Opacity of the popup, a value between 0 and 100:
0 is fully transparent (background text fully visible)
100 is fully opaque (default, no transparency)
Values in between blend the popup background with the
underlying text, making it partially transparent.
Requires 'termguicolors' to be set.
Also see |popup-opacity|.
padding List with numbers, defining the padding
above/right/below/left of the popup (similar to CSS).
An empty list uses a padding of 1 all around. The
Expand Down Expand Up @@ -1046,6 +1054,42 @@ A click in the lower half will scroll the text up one line. However, this is
limited so that the popup does not get smaller.



POPUP OPACITY *popup-opacity*

A popup window can be made semi-transparent by setting the "opacity" option.
The opacity value ranges from 0 to 100:
0 Fully transparent - the popup background is invisible and the
text behind the popup is fully visible.
100 Fully opaque (default) - the popup is not transparent at all.
1-99 Partially transparent - the popup background is blended with
the underlying text, making both partially visible.

The transparency effect requires using the GUI or having 'termguicolors'
enabled in the terminal. Without it, the opacity setting has no effect.

When a popup is transparent:
- The popup's background color is blended with the background text
- The popup's text (foreground) remains fully visible and unblended
- Text behind the popup is visible through transparent areas
- The more transparent the popup (lower opacity), the more clearly the
background text can be seen

This can be useful for:
- Creating overlay windows that don't completely obscure underlying text
- Showing contextual information without blocking the view
- Creating visual effects and modern UI designs

Example with 50% opacity: >
let winid = popup_create('Semi-transparent text', #{
\ line: 5,
\ col: 10,
\ opacity: 50,
\ })

The opacity can be changed dynamically using |popup_setoptions()|: >
call popup_setoptions(winid, #{opacity: 80})

POPUP MASK *popup-mask*

To minimize the text that the popup covers, parts of it can be made
Expand Down