A modern Neovim plugin that enhances LSP functionality with beautiful and intuitive user interfaces.
LspUI.nvim provides 13 enhanced LSP modules with custom UI implementations:
Requirements:
Using lazy.nvim:
{
"jinzhongjia/LspUI.nvim",
branch = "main",
config = function()
require("LspUI").setup({
-- config options go here
})
end
}
Using packer.nvim:
use {
"jinzhongjia/LspUI.nvim",
branch = "main",
config = function()
require("LspUI").setup({
-- config options go here
})
end
}
Basic setup:
local LspUI = require("LspUI")
LspUI.setup()
Custom configuration:
require("LspUI").setup({
-- Rename configuration
rename = {
enable = true,
command_enable = true,
auto_select = true,
fixed_width = false,
width = 30,
key_binding = {
exec = "<CR>",
quit = "<ESC>",
},
border = "rounded",
transparency = 0,
},
-- Code Action configuration
code_action = {
enable = true,
command_enable = true,
gitsigns = true,
key_binding = {
exec = "<cr>",
prev = "k",
next = "j",
quit = "q",
},
border = "rounded",
transparency = 0,
},
-- Hover configuration
hover = {
enable = true,
command_enable = true,
key_binding = {
prev = "p",
next = "n",
quit = "q",
},
border = "rounded",
transparency = 0,
},
-- Diagnostic configuration
diagnostic = {
enable = true,
command_enable = true,
border = "rounded",
transparency = 0,
severity = nil,
show_source = true,
show_code = true,
show_related_info = true,
max_width = 0.6,
},
-- Lightbulb configuration
lightbulb = {
enable = true,
is_cached = true,
icon = "💡",
debounce = 250,
},
-- Inlay Hint configuration
inlay_hint = {
enable = true,
command_enable = true,
filter = {
whitelist = {},
blacklist = {},
},
},
-- Signature configuration
signature = {
enable = false,
icon = "✨",
color = {
fg = "#FF8C00",
bg = nil,
},
debounce = 300,
},
-- Definition, Reference, Implementation, Type Definition, Declaration
definition = {
enable = true,
command_enable = true,
},
reference = {
enable = true,
command_enable = true,
},
implementation = {
enable = true,
command_enable = true,
},
type_definition = {
enable = true,
command_enable = true,
},
declaration = {
enable = true,
command_enable = true,
},
-- Call Hierarchy configuration
call_hierarchy = {
enable = true,
command_enable = true,
},
-- Position keybinds for definition, reference, etc.
pos_keybind = {
main = {
back = "<leader>l",
hide_secondary = "<leader>h",
},
secondary = {
jump = "o",
jump_split = "sh",
jump_vsplit = "sv",
jump_tab = "t",
toggle_fold = "<CR>",
next_entry = "J",
prev_entry = "K",
quit = "q",
hide_main = "<leader>h",
fold_all = "w",
expand_all = "e",
enter = "<leader>l",
},
transparency = 0,
main_border = "none",
secondary_border = "single",
},
})
Jump History and Virtual Scroll configuration:
require("LspUI").setup({
jump_history = {
enable = true,
command_enable = true,
max_size = 50,
win_max_height = 20,
smart_jumplist = {
min_distance = 5,
cross_file_only = false,
},
},
virtual_scroll = {
threshold = 500,
chunk_size = 200,
load_more_threshold = 50,
},
})
For more detailed configuration options, see the Configuration Wiki at https://github.com/jinzhongjia/LspUI.nvim/wiki/Config
Basic LSP Operations:
Navigation Commands:
Diagnostic Commands:
Call Hierarchy Commands:
Utility Commands:
Keybinding example:
vim.keymap.set("n", "K", "<cmd>LspUI hover<CR>")
vim.keymap.set("n", "gr", "<cmd>LspUI reference<CR>")
vim.keymap.set("n", "gd", "<cmd>LspUI definition<CR>")
vim.keymap.set("n", "gt", "<cmd>LspUI type_definition<CR>")
vim.keymap.set("n", "gi", "<cmd>LspUI implementation<CR>")
vim.keymap.set("n", "<leader>rn", "<cmd>LspUI rename<CR>")
vim.keymap.set("n", "<leader>ca", "<cmd>LspUI code_action<CR>")
vim.keymap.set("n", "<leader>ci", "<cmd>LspUI call_hierarchy incoming_calls<CR>")
vim.keymap.set("n", "<leader>co", "<cmd>LspUI call_hierarchy outgoing_calls<CR>")
See https://github.com/jinzhongjia/LspUI.nvim/wiki/Screen-Shot for visual examples of all features.
This plugin was inspired by and references: