1- *popup.txt* For Vim version 9.2. Last change: 2026 Feb 14
1+ *popup.txt* For Vim version 9.2. Last change: 2026 Feb 18
22
33
44 VIM REFERENCE MANUAL by Bram Moolenaar
@@ -21,6 +21,7 @@ Displaying text in a popup window. *popup* *popup-window* *popupwin*
2121 Popup filter | popup-filter |
2222 Popup callback | popup-callback |
2323 Popup scrollbar | popup-scrollbar |
24+ Popup opacity | popup-opacity |
2425 Popup mask | popup-mask |
25264. Examples | popup-examples |
2627
@@ -772,6 +773,13 @@ The second argument of |popup_create()| is a dictionary with options:
772773 the popup window.
773774 highlight Highlight group name to use for the text, stored in
774775 the 'wincolor' option.
776+ opacity Opacity of the popup, a value between 0 and 100:
777+ 0 is fully transparent (background text fully visible)
778+ 100 is fully opaque (default, no transparency)
779+ Values in between blend the popup background with the
780+ underlying text, making it partially transparent.
781+ Requires 'termguicolors' to be set.
782+ Also see | popup-opacity | .
775783 padding List with numbers, defining the padding
776784 above/right/below/left of the popup (similar to CSS).
777785 An empty list uses a padding of 1 all around. The
@@ -1046,6 +1054,42 @@ A click in the lower half will scroll the text up one line. However, this is
10461054limited so that the popup does not get smaller.
10471055
10481056
1057+
1058+ POPUP OPACITY *popup-opacity*
1059+
1060+ A popup window can be made semi-transparent by setting the "opacity" option.
1061+ The opacity value ranges from 0 to 100:
1062+ 0 Fully transparent - the popup background is invisible and the
1063+ text behind the popup is fully visible.
1064+ 100 Fully opaque (default) - the popup is not transparent at all.
1065+ 1-99 Partially transparent - the popup background is blended with
1066+ the underlying text, making both partially visible.
1067+
1068+ The transparency effect requires using the GUI or having 'termguicolors'
1069+ enabled in the terminal. Without it, the opacity setting has no effect.
1070+
1071+ When a popup is transparent:
1072+ - The popup's background color is blended with the background text
1073+ - The popup's text (foreground) remains fully visible and unblended
1074+ - Text behind the popup is visible through transparent areas
1075+ - The more transparent the popup (lower opacity), the more clearly the
1076+ background text can be seen
1077+
1078+ This can be useful for:
1079+ - Creating overlay windows that don't completely obscure underlying text
1080+ - Showing contextual information without blocking the view
1081+ - Creating visual effects and modern UI designs
1082+
1083+ Example with 50% opacity: >
1084+ let winid = popup_create('Semi-transparent text', #{
1085+ \ line: 5,
1086+ \ col: 10,
1087+ \ opacity: 50,
1088+ \ })
1089+
1090+ The opacity can be changed dynamically using | popup_setoptions() | : >
1091+ call popup_setoptions(winid, #{opacity: 80})
1092+
10491093 POPUP MASK *popup-mask*
10501094
10511095To minimize the text that the popup covers, parts of it can be made
0 commit comments