Skip to content

jinzhongjia/LspUI.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

LspUI.nvim

A modern, customizable Neovim plugin that enhances LSP functionality with beautiful and intuitive user interfaces.

โœจ Features

  • 13 Enhanced LSP Modules: Custom implementations of essential LSP operations with improved UI/UX
  • Beautiful Out-of-the-box UI: Thoughtfully designed interfaces for better code navigation and editing
  • Optimized Performance: Reimplemented LSP functions for potentially better performance than builtin Neovim functions
  • Highly Customizable: Extensive configuration options for each module
  • Smart UI Components:
    • Floating windows with borders and highlights
    • Interactive lightbulb indicators for code actions
    • Breadcrumb navigation for call hierarchy
    • Customizable keybindings for all interfaces

Supported LSP Features:

  • Code Action - Enhanced code action menu with plugin registration support
  • Rename - Smart symbol renaming with preview
  • Hover - Rich hover information with markdown support
  • Diagnostics - Beautiful diagnostic displays with navigation
  • Definition - Go to definition with enhanced UI
  • Type Definition - Navigate to type definitions
  • Declaration - Jump to symbol declarations
  • Reference - Find all references with organized display
  • Implementation - Locate implementations with filtering
  • Inlay Hint - Toggle inlay hints with visual feedback
  • Signature Help - Enhanced function signature assistance
  • Call Hierarchy - Interactive call hierarchy navigation
  • Lightbulb - Visual indicators for available code actions

๐Ÿ“ฆ Installation

Requirements

{
  "jinzhongjia/LspUI.nvim",
  branch = "main",
  config = function()
    require("LspUI").setup({
	  -- config options go here
	  })
  end
}
use {
  "jinzhongjia/LspUI.nvim",
	branch = 'main',
	config = function()
    require("LspUI").setup({
	  -- config options go here
	  })
  end
}

โš™๏ธ Configuration

Basic Setup

local LspUI = require("LspUI")
LspUI.setup()

Custom Configuration

require("LspUI").setup({
  -- General settings
  prompt = {
    border = true,
    borderchars = { "โ”€", "โ”‚", "โ”€", "โ”‚", "โ•ญ", "โ•ฎ", "โ•ฏ", "โ•ฐ" },
  },
  
  -- Code Action configuration
  code_action = {
    enable = true,
    command_enable = true,
    gitsigns = false,
    extend_gitsigns = false,
    ui = {
      title = "Code Action",
      border = "rounded",
      winblend = 0,
    },
    keys = {
      quit = "q",
      exec = "<CR>",
    },
  },
  
  -- Hover configuration  
  hover = {
    enable = true,
    command_enable = true,
    ui = {
      title = "Hover",
      border = "rounded",
      winblend = 0,
    },
    keys = {
      quit = "q",
    },
  },
  
  -- Rename configuration
  rename = {
    enable = true,
    command_enable = true,
    auto_save = false,
    ui = {
      title = "Rename",
      border = "rounded",
      winblend = 0,
    },
    keys = {
      quit = "<C-c>",
      exec = "<CR>",
    },
  },
  
  -- Diagnostic configuration
  diagnostic = {
    enable = true,
    command_enable = true,
    ui = {
      title = "Diagnostic",
      border = "rounded",
      winblend = 0,
    },
    keys = {
      quit = "q",
      exec = "<CR>",
    },
  },
  
  -- Definition configuration
  definition = {
    enable = true,
    command_enable = true,
    ui = {
      title = "Definition",
      border = "rounded",
      winblend = 0,
    },
    keys = {
      quit = "q",
      exec = "<CR>",
      vsplit = "v",
      split = "s",
      tabe = "t",
    },
  },
  
  -- Reference configuration
  reference = {
    enable = true,
    command_enable = true,
    ui = {
      title = "Reference",
      border = "rounded",
      winblend = 0,
    },
    keys = {
      quit = "q",
      exec = "<CR>",
      vsplit = "v",
      split = "s",
      tabe = "t",
    },
  },
  
  -- Implementation configuration
  implementation = {
    enable = true,
    command_enable = true,
    ui = {
      title = "Implementation",
      border = "rounded",
      winblend = 0,
    },
    keys = {
      quit = "q",
      exec = "<CR>",
      vsplit = "v",
      split = "s",
      tabe = "t",
    },
  },
  
  -- Type Definition configuration
  type_definition = {
    enable = true,
    command_enable = true,
    ui = {
      title = "Type Definition",
      border = "rounded",
      winblend = 0,
    },
    keys = {
      quit = "q",
      exec = "<CR>",
      vsplit = "v",
      split = "s",
      tabe = "t",
    },
  },
  
  -- Declaration configuration
  declaration = {
    enable = true,
    command_enable = true,
    ui = {
      title = "Declaration",
      border = "rounded",
      winblend = 0,
    },
    keys = {
      quit = "q",
      exec = "<CR>",
      vsplit = "v",
      split = "s",
      tabe = "t",
    },
  },
  
  -- Call Hierarchy configuration
  call_hierarchy = {
    enable = true,
    command_enable = true,
    ui = {
      title = "Call Hierarchy",
      border = "rounded",
      winblend = 0,
    },
    keys = {
      quit = "q",
      exec = "<CR>",
      expand = "o",
      jump = "e",
      vsplit = "v",
      split = "s",
      tabe = "t",
    },
  },
  
  -- Lightbulb configuration
  lightbulb = {
    enable = true,
    command_enable = true,
    icon = "๐Ÿ’ก",
    action_kind = {
      QuickFix = "๐Ÿ”ง",
      Refactor = "โ™ป๏ธ",
      RefactorExtract = "๐Ÿ“ค",
      RefactorInline = "๐Ÿ“ฅ",
      RefactorRewrite = "โœ๏ธ",
      Source = "๐Ÿ“„",
      SourceOrganizeImports = "๐Ÿ“ฆ",
    },
  },
  
  -- Inlay Hint configuration
  inlay_hint = {
    enable = true,
    command_enable = true,
  },
  
  -- Signature Help configuration
  signature = {
    enable = true,
    command_enable = true,
    ui = {
      title = "Signature Help",
      border = "rounded",
      winblend = 0,
    },
    keys = {
      quit = "q",
    },
  },
})

For more detailed configuration options, see the Configuration Wiki.

๐Ÿš€ Commands

Basic LSP Operations

  • LspUI hover - Open an LSP hover window above cursor
  • LspUI rename - Rename the symbol below the cursor
  • LspUI code_action - Open a code action selection prompt

Navigation Commands

  • LspUI definition - Go to definition
  • LspUI type_definition - Go to type definition
  • LspUI declaration - Go to declaration
  • LspUI reference - Show all references
  • LspUI implementation - Show all implementations

Diagnostic Commands

  • LspUI diagnostic next - Go to the next diagnostic
  • LspUI diagnostic prev - Go to the previous diagnostic

Call Hierarchy Commands

  • LspUI call_hierarchy incoming_calls - Show incoming calls
  • LspUI call_hierarchy outgoing_calls - Show outgoing calls

Utility Commands

  • LspUI inlay_hint - Toggle inlay hints on/off
  • LspUI signature - Show signature help

Advanced Features

  • Lightbulb: Automatically shows visual indicators when code actions are available
  • Plugin Integration: Supports code action registration from other Neovim plugins

๐Ÿ“– Documentation

For comprehensive documentation including keybindings, API reference, and advanced configuration:

:help LspUI

Or visit the Wiki for additional resources.

๐Ÿ’ก Quick Start Example

-- Basic keybinding setup
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>")

๐Ÿ“ธ Screenshots

See the Screenshots Wiki for visual examples of all features.

๐Ÿ—บ๏ธ Current Goals / Roadmap

You can see the current development goals and upcoming features here.

๐Ÿค Contributing

Contributions are welcome! Please feel free to submit pull requests or open issues for bugs, feature requests, or suggestions.

๐Ÿ“š Reference

This plugin was inspired by and references:

About

A modern and useful UI plugin that wraps lsp operations.

Topics

Resources

License

Stars

Watchers

Forks

Contributors 5

Languages