github github
star 511
alert-circle 10
open issues
users 5
git-branch 11



last month


VSCode 💡 for neovim's built-in LSP.

Code Action selection window shown in the gif is telescope.nvim


The plugin shows a lightbulb in the sign column whenever a textDocument/codeAction is available at the current cursor position.

This makes code actions both discoverable and efficient, as code actions can be available even when there are no visible diagnostics (warning, information, hints etc.).

Getting Started


  • neovim with LSP capabilities.
  • The FixCursorHold.nvim plugin is strongly recommended to work around existing Neovim issues surrounding the CursorHold and CursorHoldI autocmd events.


Just like any other plugin.

Example using vim-plug:

Plug 'kosayoda/nvim-lightbulb'
Plug 'antoinemadec/FixCursorHold.nvim'

Example using packer.nvim:

use {
    requires = 'antoinemadec/FixCursorHold.nvim',


Call require('nvim-lightbulb').update_lightbulb() whenever you want to show a lightbulb if a code action is available at the current cursor position. Example with an autocmd for all filetypes:


autocmd CursorHold,CursorHoldI * lua require('nvim-lightbulb').update_lightbulb()


vim.cmd [[autocmd CursorHold,CursorHoldI * lua require('nvim-lightbulb').update_lightbulb()]]

It is also possible to let the plugin create this autocommand for you. This can be enabled using the setup function:

require('nvim-lightbulb').setup({autocmd = {enabled = true}})

For all options, see the Configuration section.


Set defaults

Configuration can be passed to the setup function.

-- Showing defaults
    -- LSP client names to ignore
    -- Example: {"sumneko_lua", "null-ls"}
    ignore = {},
    sign = {
        enabled = true,
        -- Priority of the gutter sign
        priority = 10,
    float = {
        enabled = false,
        -- Text to show in the popup float
        text = "💡",
        -- Available keys for window options:
        -- - height     of floating window
        -- - width      of floating window
        -- - wrap_at    character to wrap at for computing height
        -- - max_width  maximal width of floating window
        -- - max_height maximal height of floating window
        -- - pad_left   number of columns to pad contents at left
        -- - pad_right  number of columns to pad contents at right
        -- - pad_top    number of lines to pad contents at top
        -- - pad_bottom number of lines to pad contents at bottom
        -- - offset_x   x-axis offset of the floating window
        -- - offset_y   y-axis offset of the floating window
        -- - anchor     corner of float to place at the cursor (NW, NE, SW, SE)
        -- - winblend   transparency of the window (0-100)
        win_opts = {},
    virtual_text = {
        enabled = false,
        -- Text to show at virtual text
        text = "💡",
        -- highlight mode to use for virtual text (replace, combine, blend), see :help nvim_buf_set_extmark() for reference
        hl_mode = "replace",
    status_text = {
        enabled = false,
        -- Text to provide when code actions are available
        text = "💡",
        -- Text to provide when no actions are available
        text_unavailable = ""
    autocmd = {
        enabled = false,
        -- see :help autocmd-pattern
        pattern = {"*"},
        -- see :help autocmd-events
        events = {"CursorHold", "CursorHoldI"}
Per-call configuration

You can overwrite the defaults by passing options to the update_lightbulb function.


autocmd CursorHold,CursorHoldI * lua require'nvim-lightbulb'.update_lightbulb({ ignore = {"null-ls"} })


vim.cmd [[autocmd CursorHold,CursorHoldI * lua require'nvim-lightbulb'.update_lightbulb({ ignore = {"null-ls"} })]]
Modify the lightbulb sign:

Fill text, texthl, linehl, and numhl according to your preferences


call sign_define('LightBulbSign', { text = "", texthl = "", linehl="", numhl="" })


vim.fn.sign_define('LightBulbSign', { text = "", texthl = "", linehl="", numhl="" })
Modify the lightbulb float window and virtual text colors

Fill ctermfg, ctermbg, guifg, guibg according to your preferences


augroup HighlightOverride
  au ColorScheme * highlight LightBulbFloatWin ctermfg= ctermbg= guifg= guibg=
  au ColorScheme * highlight LightBulbVirtualText ctermfg= ctermbg= guifg= guibg=
augroup END


vim.api.nvim_command('highlight LightBulbFloatWin ctermfg= ctermbg= guifg= guibg=')
vim.api.nvim_command('highlight LightBulbVirtualText ctermfg= ctermbg= guifg= guibg=')
Status-line text usage

With the status_text option enabled you can access the current lightbulb state through the lua function require('nvim-lightbulb').get_status_text(). This allows easy integration with multiple different status line plugins.