{"id":22006327,"url":"https://github.com/javiorfo/nvim-popcorn","last_synced_at":"2025-05-05T21:51:08.491Z","repository":{"id":151649821,"uuid":"622344126","full_name":"javiorfo/nvim-popcorn","owner":"javiorfo","description":"Neovim library for popup utilities written in Lua ","archived":false,"fork":false,"pushed_at":"2024-08-14T02:23:35.000Z","size":84,"stargazers_count":12,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-08-14T03:59:35.093Z","etag":null,"topics":["lua","neovim","neovim-plugin","popup"],"latest_commit_sha":null,"homepage":"","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/javiorfo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-04-01T20:39:32.000Z","updated_at":"2024-08-14T02:23:38.000Z","dependencies_parsed_at":"2023-07-10T03:15:54.922Z","dependency_job_id":"812f3728-212d-49ef-817f-78454b6a8b96","html_url":"https://github.com/javiorfo/nvim-popcorn","commit_stats":null,"previous_names":["charkuils/nvim-popcorn","javiorfo/nvim-popcorn","caosystema/nvim-popcorn","progrimorio/nvim-popcorn","orfosys/nvim-popcorn","chaosystema/nvim-popcorn"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/javiorfo%2Fnvim-popcorn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/javiorfo%2Fnvim-popcorn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/javiorfo%2Fnvim-popcorn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/javiorfo%2Fnvim-popcorn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/javiorfo","download_url":"https://codeload.github.com/javiorfo/nvim-popcorn/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227246914,"owners_count":17753428,"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":["lua","neovim","neovim-plugin","popup"],"created_at":"2024-11-30T01:11:37.456Z","updated_at":"2025-05-05T21:51:08.472Z","avatar_url":"https://github.com/javiorfo.png","language":"Lua","readme":"# nvim-popcorn\nNeovim library for popup utilities written in Lua\n\n## Caveats\n- This library has been developed on and for Linux following open source philosophy.\n\n## Installation\n`Packer`\n```lua\nuse 'javiorfo/nvim-popcorn'\n```\n`Lazy`\n```lua\n{ 'javiorfo/nvim-popcorn' }\n```\n\n## Overview\n| Feature | nvim-popcorn | NOTE |\n| ------- | ------------- | ---- |\n| Popup borders | :heavy_check_mark: | Includes 5 different borders (also opened to implementation) |\n| Set width and height | :heavy_check_mark: |  |\n| Set title | :heavy_check_mark: | Optional. Centered with highlighting options |\n| Set footer | :heavy_check_mark: | Optional. Centered with highlighting options |\n| Title or footer with right or left align | :x: | |\n| Backgroung color | :x: | Same of editor |\n| Content in text format | :heavy_check_mark: | By table. With highlighting options |\n| Content file | :heavy_check_mark: | By string |\n| Content open to implementation | :heavy_check_mark: | By function |\n| Callback | :heavy_check_mark: | Optional. By function |\n| Close popup | :heavy_check_mark: | Pressing \u003cESC\u003e or Clicking outside of it |\n\n## Usage\n- This is an object description. Notice that some values are required and others are optional:\n```lua\nlocal popcorn = require'popcorn'\nlocal borders = require'popcorn.borders'\n\nlocal opts = {\n    -- Required\n    width = 50,\n\n    -- Required\n    height = 8,\n\n    -- Optional. If not set then simple_thick_border will be the default\n    border = borders.rounded_corners_border,\n\n    -- Optional. The first table value is the title text, the second one is the group to link\n    -- The second value is optional too. In this case It will highlight \"Popcorn Title\" linking to \"Type\" group\n    title = { \"Popcorn Title\", \"Type\" },\n\n    -- Optional. The first table value is the footer text, the second one is the group to link\n    -- The second value is optional too. In this case It will highlight \"Popcorn Footer\" linking to \"String\" group\n    footer = { \"Popcorn Footer\", \"String\" },\n\n    -- Optional. This will be the body of the popup \n    -- content is a table\n    content = {\n        { \"Results: \", \"Constant\" }, -- The second value is the group to link to\n        { \"     - Some text here\" },\n        { \"     - More text here\" }\n    },\n\n    -- Optional. A second approach could be to open a file and show the content in the popup body\n    -- content is a string\n    -- content = \"path/to/file/to/show/file.txt\"\n\n    -- Optional. A third approach could be to implement some code in a function\n    -- content is a function\n    -- In this example a terminal is opened in the popup body\n    -- content = function() vim.cmd(\"start | term\") end \n\n    -- Optional. If a callback is necessary this is the keymap to execute it\n    -- Default value is \u003cCR\u003e if this variable is not set\n    callback_keymap = \"\u003cCR\u003e\",\n    \n    -- Optional. If a callback is necessary this is the implementation\n    -- Pressing \u003cCR\u003e (variable above) will execute the callback\n    -- In this example It will print the first line of the popup body\n    callback = function()\n        print(\"Callback result =\u003e \" .. vim.fn.getline(1))\n    end,\n    \n    -- Optional\n    -- Add some actions after all the popup configuration is set\n    -- It could be autocmd's for example\n    do_after = function()\n        -- do something after...\n    end,\n\n    -- Optional\n    -- Add some actions after the popup is closed\n    -- It could be autocmd's for example\n    on_close = function()\n        -- do something after...\n    end\n}\n\n-- Open popup\npopcorn:new(opts):pop() -- pop() returns popup buffer id\n```\n\n#### BORDERS\n- Check the borders available in [this file](https://github.com/javiorfo/nvim-popcorn/blob/master/lua/popcorn/borders.lua)\n- You can add your own border if you like. Further information in `:help popcorn`\n\n## Screenshots\n#### Examples of the differents popup's included in this library. Run `:luafile %` in [these files](https://github.com/javiorfo/nvim-popcorn/blob/master/examples)\n\n\u003cimg src=\"https://github.com/javiorfo/img/blob/master/nvim-popcorn/popcorn.gif?raw=true\" alt=\"popcorn\" /\u003e\n\n**NOTE:** The colorscheme **umbra** from [nvim-nyctophilia](https://github.com/javiorfo/nvim-nyctophilia) is used in this image.\n\n---\n\n### Donate\n- **Bitcoin** [(QR)](https://raw.githubusercontent.com/javiorfo/img/master/crypto/bitcoin.png)  `1GqdJ63RDPE4eJKujHi166FAyigvHu5R7v`\n- [Paypal](https://www.paypal.com/donate/?hosted_button_id=FA7SGLSCT2H8G)\n","funding_links":["https://www.paypal.com/donate/?hosted_button_id=FA7SGLSCT2H8G"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaviorfo%2Fnvim-popcorn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjaviorfo%2Fnvim-popcorn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaviorfo%2Fnvim-popcorn/lists"}