{"id":18109341,"url":"https://github.com/kennypete/vim-popped","last_synced_at":"2025-03-29T15:30:50.125Z","repository":{"id":204351624,"uuid":"711628743","full_name":"kennypete/vim-popped","owner":"kennypete","description":"A plugin for Vim providing commands that use Vim’s builtin popup window functionality.","archived":false,"fork":false,"pushed_at":"2023-10-29T21:29:24.000Z","size":810,"stargazers_count":9,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-11-01T00:04:53.009Z","etag":null,"topics":["popup-window","vim-plugins","vim9","vim9-plugin","vim9-script","vimscript"],"latest_commit_sha":null,"homepage":"","language":"Vim Script","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kennypete.png","metadata":{"files":{"readme":"README.adoc","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-10-29T20:46:27.000Z","updated_at":"2024-03-23T02:49:24.000Z","dependencies_parsed_at":null,"dependency_job_id":"d1980cb3-46e7-48c6-a935-1055f5aec4ea","html_url":"https://github.com/kennypete/vim-popped","commit_stats":null,"previous_names":["kennypete/vim-popped"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kennypete%2Fvim-popped","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kennypete%2Fvim-popped/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kennypete%2Fvim-popped/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kennypete%2Fvim-popped/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kennypete","download_url":"https://codeload.github.com/kennypete/vim-popped/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246204535,"owners_count":20740330,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["popup-window","vim-plugins","vim9","vim9-plugin","vim9-script","vimscript"],"created_at":"2024-11-01T00:01:42.677Z","updated_at":"2025-03-29T15:30:49.467Z","avatar_url":"https://github.com/kennypete.png","language":"Vim Script","funding_links":[],"categories":["UI"],"sub_categories":[],"readme":"= vim-popped\n:author: Peter Kenny\n:doctype: article\n:icons: font\n:pdf-theme: D:\\git.kennypete\\asciidoc\\adoc\\pdf\\README-theme.yml\n:sectnums:\n//\"experimental\" is needed for kbd:[], which is NOT experimental\n:experimental:\n:toc: preamble\n//there's no need for a toc title in GitHub/HTML, but in PDF there is\nifndef::backend-html5,env-github[:toc-title: Contents]\nifdef::backend-html5,env-github[:toc-title:]\n//only two levels of toc in this README so ....\nifndef::backend-html5,env-github[:toclevels: 2]\nifdef::backend-html5,env-github[:toclevels: 2]\n//Admonitions are unsatisfying on GitHub: they are not prominent and\n//are too small. There seems to be no solution to that?\nifdef::env-github[]\n:important-caption: :heavy_exclamation_mark:\n:tip-caption: :bulb:\n:note-caption: :information_source:\n:caution-caption: :fire:\n:warning-caption: :warning:\nendif::env-github[]\n// Refs to vimhelp.org:\n:h: https://vimhelp.org/\n// :attributes: only use lowercase, numerals, and hyphens.\n// NB: asciidoctor-pdf-2.3.7 processes uppercase literally, so don't use\n// uppercase.\n// Refer -\n// https://docs.asciidoctor.org/asciidoc/latest/attributes/names-and-values/\n:h-ascii: {h}various.txt.html#%3Aascii\n:h-builtin-functions: {h}builtin.txt.html#builtin-functions\n:h-cnoreabbrev: {h}map.txt.html#%3Acnoreabbrev\n:h-digraphs: {h}digraph.txt.html#3Adigraphs\n:h-expand: {h}builtin.txt.html#expand%28%29\n:h-g8: {h}various.txt.html#g8\n:h-getcwd: {h}builtin.txt.html#getcwd%28%29\n:h-has: {h}builtin.txt.html#has%28%29\n:h-highlight-group: {h}syntax.txt.html#highlight-groups\n:h-normal: {h}intro.txt.html#Normal-mode\n:h-packadd: {h}repeat.txt.html#pack-add\n:h-packpath: {h}options.txt.html#%27packpath%27\n:h-packages: {h}repeat.txt.html#packages\n:h-popup-functions: {h}popup.txt.html#popup-functions\n:h-popup-intro: {h}popup.txt.html#popup-intro\n:h-popup-setoptions: {h}popup.txt.html#popup_setoptions%28%29\n:h-popup-window: {h}version8.txt.html#new-popup-window\n:h-statusmsg: {h}eval.txt.html#v%3Astatusmsg\n:h-version9: {h}version9.txt.html#version9.txt\n:h-vim-802: {h}version8.txt.html#vim-8.2\n:h-vimrc: {h}starting.txt.html#%2Evimrc\n:h-vim9-mix: {h}vim9.txt.html#vim9-mix\n:h-vim9-script: {h}vim9.txt.html#Vim9-script\n:h-vversion: {h}eval.txt.html#v%3Aversion\n:h-unlisted-buffer: {h}windows.txt.html#unlisted-buffer\n:h-word: {h}motion.txt.html#word\n:h-word-uc: {h}motion.txt.html#WORD\n\n// Abstract (block) works best for the intro paragraph between the article\n// title and the Installation section.\n// https://docs.asciidoctor.org/asciidoc/latest/sections/abstract-block/\n// For GitHub it is superfluous\nifndef::backend-html5,env-github[[abstract]]\n--\n\n'''\n\nThis plugin provides four commands that use Vim\u0026#x2019;s\n{h-builtin-functions}[builtin] {h-popup-window}[popup window] functionality.\nVim\u0026#x2019;s {h-popup-intro}[popup-intro] provides examples of\nwhen you may want to use popup windows, so that is not explained here.\nThe \u003c\u003cscreenshots\u003e\u003e and \u003c\u003cmappings\u003e\u003e illustrate how to use the commands, and\nways they may be useful.\n\n// Asciidoc footnotes can be challenging in github - they work best when\n// kept as contiguous text, which is an exception to my Asciidoc files\n// generally, which I keep to \u003c80 characters per line.\n_Compatibility_: vim-popped is built primarily for {h-version9}[Vim 9].footnote:[This plugin has been built with both {h-vim9-script}[vim9script] and vimscript functions.  The main script, in vim-popped/plugins/vim-popped.vim, uses {h-vim9-mix}[vim9-mix] capability, determining the script version based on {h-vversion}[v:version] and {h-has}[has()], testing for 8.2 and patch \u0026gt;\u0026#x3D;4057.  If 8.2 and patch \u0026lt;4057, but \u0026gt;\u0026#x3D;3434, vimscript functions/commands are used.]\nIt will not work with Neovim because Neovim has none of\nVim\u0026#x2019;s {h-popup-functions}[popup functions] \u0026#x2014;\nrefer Neovim\u0026#x2019;s help (builtin.txt).\n\n'''\n--\n\n[#screenshots]\n== Screenshots\n\nFour commands are enabled, which are associated with user-defined functions.\nCommand line abbreviations are also provided, which, like the functions,\nare structured as initialisms of the command names.\n\n[cols=\"2,1,1\"]\n|===\n|Command              |Function | Abbreviation\n\n|CpDialogCommand      | Fpdc()  | Cpdc\n|CpDialogCommandTimer | Fpdct() | Cpdct\n|CpDialogTitleCommand | Fpdtc() | Cpdtc\n|CpMenuBuffers        | Fpmb()  | Cpmb\n|===\n\nThe commands are illustrated and annotated in the following screenshots.\n\nimage::./demo/CpDialogCommand.txt.jpg[CpDialogCommand,643,280,align=\"center\"]\n\nifdef::backend-html5,env-github[\u0026#xA0;]\n\nimage::./demo/CpDialogCommandTimer.txt.jpg[CpDialogCommandTimer,644,356,align=\"center\"]\n\nifdef::backend-html5,env-github[\u0026#xA0;]\n\nimage::./demo/CpDialogTitleCommand.txt.jpg[CpDialogTitleCommand,644,339,align=\"center\"]\n\nifdef::backend-html5,env-github[\u0026#xA0;]\n\nimage::./demo/CpMenuBuffers.txt.jpg[CpMenuBuffers,644,617,align=\"center\"]\n\n[#mappings]\n== Mappings\n\n*\u0026lt;Leader\u0026gt;b and \u0026lt;Leader\u0026gt;\u0026lt;S-b\u0026gt;*\n\nUnless the user already has it\nmapped, `\u0026lt;Leader\u0026gt;\u0026lt;S-b\u0026gt;` is mapped,\nin {h-normal}[Normal] mode only, to `:CpMenuBuffers buffers!`,\ndemonstrated immediately above.\n\nSimilarly, `\u0026lt;Leader\u0026gt;b`, unless the user already has\nit mapped, is mapped, in {h-normal}[Normal] mode only,\nto `:CpMenuBuffers buffers`.\n(The only difference is `\u0026lt;Leader\u0026gt;b` will not\nshow {h-unlisted-buffer}[unlisted buffers], which in some\ninstances is preferable.)\n\n*gA*\n\nThe second mapping is `gA`.  This provides an extension to the\n{h-builtin-functions}[builtin] command, kbd:[ga]\n(_aka_ {h-ascii}[:ascii]).  By default, that command provides\ninformation about the character (and combining character(s), when applicable)\nunder the cursor, i.e.,\nthe Unicode code point(s) in decimal, hexadecimal,\nand octal.\nThe `gA` mapping expands on that to provide _lots_ of additional\ninformation in a popup dialog window:\n\n[cols=\"1,6\"]\n|===\n|UTF8 |The UTF8 hex values of the bytes used in the character(s)\n(Equivalent to the {h-g8}[g8] command)\n|hi |{h-highlight-group}[Highlight group] (only when applicable,\notherwise blank)\n|word |The {h-word}[word] under the cursor\n|WORD |The {h-word-uc}[WORD] under the cursor\n|file |The current filename.\n(This is blank if there\u0026#x2019;s no file and is equivalent to\n`:echo {h-expand}[expand]('%:t')`)\n|cwd |The current working directory.\n(Equivalent to `:echo {h-getcwd}[getcwd()]`)\n|===\n\nIllustrating this in action:\n\nimage::./demo/gA.txt.jpg[gA,642,372,align=\"center\"]\n\n[TIP]\n[%unbreakable]\n====\nIf you use Tim Pope\u0026#x2019;s\nhttps://github.com/tpope/vim-characterize[vim-characterize]\nplugin, kbd:[ga] will display the HTML5 named character references, emoji,\nUnicode name, and all {h-digraphs}[digraphs], when applicable.\nFor example, kbd:[ga] on the character \u0026#x1F600;,\nU+1F600, will display, in the cmdline {h-statusmsg}[statusmsg] area:\n//😀\n----\n\u003c😀\u003e 128512, U+1F600 GRINNING FACE, :grinning:\n----\n\nAnother example: a̅ (an 'a' with a combining macron, U+0061,U+0305) will\ndisplay:\n----\n\u003ca\u003e 97, \\141, U+0061 LATIN SMALL LETTER A + \u003c ̅\u003e 773, U+0305 COMBINING OVERLINE\n----\n====\n\n[#borderchars]\n== Borderchars\n\nPopups may have several options set (refer\n{h-popup-setoptions}[popup_setoptions()]).\nOne of those options is `borderchars`, which is a list with\ncharacters that are used for displaying the border around a popup.\nThe example in Vim\u0026#x2019;s help is:\n\n----\n['-', '|', '-', '|', '┌', '┐', '┘', '└']\n----\n\nThose characters have the benefit of being ones that\ndisplay satisfactorily with most fonts: hyphen (U+002D),\nvertical line (U+007C), and box drawing characters\n(U+250C, U+2510, U+2518, and U+2514).\n\nA downside to using those default characters is that they do not _join_\ntogether well.  They may end up looking like this, depending on factors such\nas your operating system, font, etc.:\n\n----\n  ┌---------------------┐\n  | Default borderchars |\n  └---------------------┘\n----\n\nTo address this, and to provide optionality, this plugin uses the\nvariable `g:borderchars`.\nIt enables the user to determine, in their\n{h-vimrc}[~/.vimrc], their own border characters for the popups created by\nthis plugin.\nIf `g:borderchars` has not been set, the following default list is used\n(chosen because it is unobtrusive and should work with any font).\nIt uses an em dash (i.e., U+2014) for the bottom border and bottom corners,\nand a space for everything else:\n\n----\n[' ', ' ', '—', ' ', ' ', ' ', '—', '—']\n----\n\nIf you want no borders on the popup windows,\nadd this to your {h-vimrc}[~/.vimrc]:\n\nifdef::env-github[[source,vim]]\nifndef::env-github[[source,vimscript]]\n----\nlet g:borderchars = [' ']\n----\n\n[#installation]\n== Installation\n\n[IMPORTANT]\n====\n*Vim before 8.2.3434 / Neovim*: vim-popped neither works with Vim versions\nbefore {h-vim-802}[8.2] patch 3434 nor any version of Neovim.\nThat is because:\n\n. Vim versions before 8.2 patch 3434 lack patches that are required to\nrender popup windows produced by vim-popped.\n. Neovim does not have any of Vim\u0026#x2019;s builtin popup window commands.\n\n====\n\nThere are three installation methods outlined here.  Linux is presumed, so\n{h-vimrc}[.vimrc] (not _vimrc),\netc.footnote:[If your operating system is Windows, instead of `~/.vim/` use `$HOME\\vimfiles\\` or `~/vimfiles/` (PowerShell), or `%USERPROFILE%\\vimfiles\\` (cmd.exe).]\n\n*Method 1. Using packadd! in your .vimrc*\n\nThis is a contemporary way to install plugins.  It uses Vim\u0026#x2019;s native\n{h-packadd}[packadd!] functionality.\n\n_Either_ +\n`git clone pass:[https://github.com/kennypete/vim-popped]\n~/.vim/pack/plugins/opt/vim-popped` +\n_Or_ +\nDownload the .zip from\nhttps://github.com/kennypete/vim-popped and unzip the contents within the\nfolder vim-popped-main to `~/.vim/pack/plugins/opt/vim-popped`\n\nIn your {h-vimrc}[~/.vimrc], add the line, `packadd! vim-popped`.\n(If you want to turn vim-popped off, delete or comment out that line.)\n\n*Method 2. Vim\u0026#x2019;s packages method, automatically*\n\nSimilar to the steps above, except substitute `start` for `opt`.\nThis is a less versatile method because to turn the plugin off\nyou need to move it out of the `start` directory.  So, it is easier\nin a way, though neither as transparent nor as flexible.\n\n*Method 3. Using a plugin manager*\n\nFor example, https://github.com/junegunn/vim-plug[vim-plug]\n(NB: using \u0026#x201C;shorthand notation\u0026#x201D;).\n\nIn the vim-plug section of your {h-vimrc}[.vimrc], add\n`Plug 'kennypete/vim-popped'` between `call plug#begin()`\nand `call plug#end()`.\nReload your {h-vimrc}[.vimrc] and then `:PlugInstall`.\n\n[#tene-licence]\n== Licence\n\nhttps://github.com/kennypete/vim-tene/blob/main/LICENCE[BSD 3-Clause License].\nCopyright \u0026#xA9; 2023 Peter Kenny\n\n'''\n\n\u0026#xA0;\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkennypete%2Fvim-popped","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkennypete%2Fvim-popped","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkennypete%2Fvim-popped/lists"}