{"id":13409200,"url":"https://github.com/kosayoda/nvim-lightbulb","last_synced_at":"2025-05-15T04:04:24.296Z","repository":{"id":37999899,"uuid":"334948101","full_name":"kosayoda/nvim-lightbulb","owner":"kosayoda","description":"VSCode 💡 for neovim's built-in LSP.","archived":false,"fork":false,"pushed_at":"2025-03-29T14:36:49.000Z","size":89,"stargazers_count":841,"open_issues_count":5,"forks_count":33,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-14T04:59:18.499Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kosayoda.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,"zenodo":null}},"created_at":"2021-02-01T12:48:37.000Z","updated_at":"2025-04-09T12:50:16.000Z","dependencies_parsed_at":"2024-10-26T04:53:17.420Z","dependency_job_id":"34b0297e-f0b2-4e82-86ae-b397560e3122","html_url":"https://github.com/kosayoda/nvim-lightbulb","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kosayoda%2Fnvim-lightbulb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kosayoda%2Fnvim-lightbulb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kosayoda%2Fnvim-lightbulb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kosayoda%2Fnvim-lightbulb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kosayoda","download_url":"https://codeload.github.com/kosayoda/nvim-lightbulb/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254270641,"owners_count":22042858,"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":[],"created_at":"2024-07-30T20:00:58.777Z","updated_at":"2025-05-15T04:04:24.245Z","avatar_url":"https://github.com/kosayoda.png","language":"Lua","funding_links":[],"categories":["LSP","Lua"],"sub_categories":["(requires Neovim 0.5)"],"readme":"# nvim-lightbulb\n\nVSCode 💡 for neovim's built-in LSP.\n\n\n## Table of contents\n\n- [Introduction](#introduction)\n- [Prerequisites](#prerequisites)\n- [Installation](#installation)\n- [Usage](#usage)\n- [Configuration](#configuration)\n\n## Introduction\nThe plugin shows a lightbulb in the sign column whenever a `textDocument/codeAction` is available at the current cursor position.\n\nThis makes code actions both [discoverable and efficient](https://rust-analyzer.github.io/blog/2020/09/28/how-to-make-a-light-bulb.html#the-mighty), as code actions can be available even when there are no visible diagnostics (warning, information, hints etc.).\n\n### Features\n\n\u003cimg width=\"450\" alt=\"nvim-lightbulb\" src=\"https://github.com/kosayoda/nvim-lightbulb/assets/41782385/f29d9c64-592f-4163-a7cc-d1494e72f020\"\u003e\n\n\u003e In the screenshot, colorscheme is [catppuccin](https://github.com/catppuccin/nvim), font is [iosevka](https://typeof.net/Iosevka/), programming language is [rust](https://www.rust-lang.org/)\n\nWhen there is a *code action* available at the current cursor location, show a lightbulb...\n1. in the **sign column**\n2. as **virtual text**\n3. in a **floating window**\n\nor, change the look of\n\n4. the **number column**\n5. the **current line**\n\nor, get a configured message\n\n6. as **status text**, retrievable with `require(\"nvim-lightbulb\").get_status_text()`\n\n## Prerequisites\n\n* Neovim v0.9.0 and above. Older versions may work but are not tested.\n* Working LSP server configuration.\n\n## Installation\n\nJust like any other plugin.\n\nExample using [lazy.nvim](https://github.com/folke/lazy.nvim):\n```lua\n{ 'kosayoda/nvim-lightbulb' }\n```\n\nExample using [packer.nvim](https://github.com/wbthomason/packer.nvim):\n```lua\nuse { 'kosayoda/nvim-lightbulb' }\n```\n\nExample using [vim-plug](https://github.com/junegunn/vim-plug):\n```vim\nPlug 'kosayoda/nvim-lightbulb'\n```\n\n## Usage\n\nPlace this in your neovim configuration.\n\n```lua\nrequire(\"nvim-lightbulb\").setup({\n  autocmd = { enabled = true }\n})\n```\n\n- Configuration can be passed to `NvimLightbulb.setup`, or to `NvimLightbulb.update_lightbulb`.\n- Any configuration passed to `update_lightbulb` will override the one in `setup`.\n- For all options, see the [Configuration](#configuration) section.\n- To debug `nvim-lightbulb` see `NvimLightbulb.debug`\n\n## Configuration\n\n```lua\nlocal default_config = {\n    -- Priority of the lightbulb for all handlers except float.\n    priority = 10,\n\n    -- Whether or not to hide the lightbulb when the buffer is not focused.\n    -- Only works if configured during NvimLightbulb.setup\n    hide_in_unfocused_buffer = true,\n\n    -- Whether or not to link the highlight groups automatically.\n    -- Default highlight group links:\n    --   LightBulbSign -\u003e DiagnosticSignInfo\n    --   LightBulbFloatWin -\u003e DiagnosticFloatingInfo\n    --   LightBulbVirtualText -\u003e DiagnosticVirtualTextInfo\n    --   LightBulbNumber -\u003e DiagnosticSignInfo\n    --   LightBulbLine -\u003e CursorLine\n    -- Only works if configured during NvimLightbulb.setup\n    link_highlights = true,\n\n    -- Perform full validation of configuration.\n    -- Available options: \"auto\", \"always\", \"never\"\n    --   \"auto\" only performs full validation in NvimLightbulb.setup.\n    --   \"always\" performs full validation in NvimLightbulb.update_lightbulb as well.\n    --   \"never\" disables config validation.\n    validate_config = \"auto\",\n\n    -- Code action kinds to observe.\n    -- To match all code actions, set to `nil`.\n    -- Otherwise, set to a table of kinds.\n    -- Example: { \"quickfix\", \"refactor.rewrite\" }\n    -- See: https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#codeActionKind\n    action_kinds = nil,\n\n    -- Enable code lens support.\n    -- If the current position has executable code lenses, the icon is changed from `text` to `lens_text`\n    -- for sign, virtual_text, float and status_text.\n    -- The code lens icon is configurable per handler.\n    code_lenses = false,\n\n    -- Configuration for various handlers:\n    -- 1. Sign column.\n    sign = {\n        enabled = true,\n        -- Text to show in the sign column.\n        -- Must be between 1-2 characters.\n        text = \"💡\",\n        lens_text = \"🔎\",\n        -- Highlight group to highlight the sign column text.\n        hl = \"LightBulbSign\",\n    },\n\n    -- 2. Virtual text.\n    virtual_text = {\n        enabled = false,\n        -- Text to show in the virt_text.\n        text = \"💡\",\n        lens_text = \"🔎\",\n        -- Position of virtual text given to |nvim_buf_set_extmark|.\n        -- Can be a number representing a fixed column (see `virt_text_pos`).\n        -- Can be a string representing a position (see `virt_text_win_col`).\n        pos = \"eol\",\n        -- Highlight group to highlight the virtual text.\n        hl = \"LightBulbVirtualText\",\n        -- How to combine other highlights with text highlight.\n        -- See `hl_mode` of |nvim_buf_set_extmark|.\n        hl_mode = \"combine\",\n    },\n\n    -- 3. Floating window.\n    float = {\n        enabled = false,\n        -- Text to show in the floating window.\n        text = \"💡\",\n        lens_text = \"🔎\",\n        -- Highlight group to highlight the floating window.\n        hl = \"LightBulbFloatWin\",\n        -- Window options.\n        -- See |vim.lsp.util.open_floating_preview| and |nvim_open_win|.\n        -- Note that some options may be overridden by |open_floating_preview|.\n        win_opts = {\n            focusable = false,\n        },\n    },\n\n    -- 4. Status text.\n    -- When enabled, will allow using |NvimLightbulb.get_status_text|\n    -- to retrieve the configured text.\n    status_text = {\n        enabled = false,\n        -- Text to set if a lightbulb is available.\n        text = \"💡\",\n        lens_text = \"🔎\",\n        -- Text to set if a lightbulb is unavailable.\n        text_unavailable = \"\",\n    },\n\n    -- 5. Number column.\n    number = {\n        enabled = false,\n        -- Highlight group to highlight the number column if there is a lightbulb.\n        hl = \"LightBulbNumber\",\n    },\n\n    -- 6. Content line.\n    line = {\n        enabled = false,\n        -- Highlight group to highlight the line if there is a lightbulb.\n        hl = \"LightBulbLine\",\n    },\n\n    -- Autocmd configuration.\n    -- If enabled, automatically defines an autocmd to show the lightbulb.\n    -- If disabled, you will have to manually call |NvimLightbulb.update_lightbulb|.\n    -- Only works if configured during NvimLightbulb.setup\n    autocmd = {\n        -- Whether or not to enable autocmd creation.\n        enabled = false,\n        -- See |updatetime|.\n        -- Set to a negative value to avoid setting the updatetime.\n        updatetime = 200,\n        -- See |nvim_create_autocmd|.\n        events = { \"CursorHold\", \"CursorHoldI\" },\n        -- See |nvim_create_autocmd| and |autocmd-pattern|.\n        pattern = { \"*\" },\n    },\n\n    -- Scenarios to not show a lightbulb.\n    ignore = {\n        -- LSP client names to ignore.\n        -- Example: {\"null-ls\", \"lua_ls\"}\n        clients = {},\n        -- Filetypes to ignore.\n        -- Example: {\"neo-tree\", \"lua\"}\n        ft = {},\n        -- Ignore code actions without a `kind` like refactor.rewrite, quickfix.\n        actions_without_kind = false,\n    },\n\n    --- A general filter function for code actions.\n    --- The function is called for code actions *after* any `ignore` or `action_kinds`\n    --- options are applied.\n    --- The function should return true to keep the code action, false otherwise.\n    ---@type (fun(client_name:string, result:lsp.CodeAction|lsp.Command):boolean)|nil\n    filter = nil,\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkosayoda%2Fnvim-lightbulb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkosayoda%2Fnvim-lightbulb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkosayoda%2Fnvim-lightbulb/lists"}