/LspUI.nvim

A modern and useful UI plugin that wraps lsp operations.

Primary LanguageLuaMIT LicenseMIT

🧰LspUI.nvim

A modern and useful UI plugin that wraps lsp operations.

As neovim is the host system, its plugins should be kept as minimally intrusive as possible

🛎️Features Supported

  • Code Action(menu and lighthulb)
  • Rename
  • Hover Document
  • Diagnostic
  • Peek Definition

🪡Recommend

For other features of lsp, such as Defination, References, implementations, you use this plugin DNLHC/glance.nvim, it is very good for above

🛠️Install

Neovim(stable), but recommend you use Neovim(nightly), now stable not support title_pos

Lazy.nvim

{
    "jinzhongjia/LspUI.nvim",
    event="Verylazy",
    config=function()
        require("LspUI").setup()
    end
}

Packer.nvim

use {
        "jinzhongjia/LspUI.nvim",
        -- event = 'VimEnter',
        config=function()
            require("LspUI").setup()
        end
    }

💾Config

-- Default config
require("LspUI").setup({
    lightbulb = {
        enable = false, -- close by default
        command_enable = false, -- close by default, this switch does not have to be turned on, this command has no effect
        icon = "💡",
    },
    code_action = {
        enable = true,
        command_enable = true,
        icon = "💡",
        keybind = {
            exec = "<CR>",
            prev = "k",
            next = "j",
            quit = "q",
        },
    },
    hover = {
        enable = true,
        command_enable = true,
        keybind = {
            prev = "p",
            next = "n",
            quit = "q",
        },
    },
    rename = {
        enable = true,
        command_enable = true,
        auto_select = true, -- whether select all automatically
        keybind = {
            change = "<CR>",
            quit = "<ESC>",
        },
    },
    diagnostic = {
        enable = true,
        command_enable = true,
        icons = {
            Error = "",
            Warn = "",
            Info = "",
            Hint = "",
        },
    },
    peek_definition = {
        enable = false, -- close by default
        command_enable = true,
        keybind = {
            edit = "op",
            vsplit = "ov",
            split = "os",
            quit = "q",
        },
    },
})

🎁Command

  • LspUI hover
  • LspUI rename
  • LspUI code_action
  • LspUI diagnostic next
  • LspUI diagnostic prev
  • LspUI peek_definition

🧭Design ideas

  • Highly controllable functions
  • Least invasive

📸Screenshot

Code Action:

code_action_menu

code_action_lightbulb

Rename:

rename

Hover Document:

hover_document

Diagnostic:

diagnostic

Peek Definition:

peek_definition

📔Todo

  • Define(Defination and Type Definitions)
  • Finder(References and implementations)

🔮Thanks