Skip to content

urizennnn/rescue-lsp.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rescue-Lsp.nvim

Lua License Neovim GitHub contributors

Overview

Rescue-Lsp.nvim provides an aesthetic, floating window replacement for the LspInfo command, minimizing extraneous details displayed by Neovim’s native :checkhealth output. The goal is a cleaner, focused presentation of LSP status while offering a user-friendly interface to manage LSP clients.

Preview

Rescue-Lsp Preview

Why Use Rescue-Lsp.nvim?

The native LspInfo command opens a new tab with verbose information that may be unnecessary for many users. Rescue-Lsp.nvim provides a minimal floating window that aligns better with streamlined workflows while giving a similar aesthetic to previous versions of lspconfig.

Requirements

  • Neovim: 0.10.2+

Installation

Using lazy.nvim

{
    "urizennnn/rescue-lsp.nvim",
    config = function()
        require("rescue-lsp").setup()
    end
}

Using vim-plug

Plug "urizennnn/rescue-lsp.nvim"

Using Packer

use {
    "urizennnn/rescue-lsp.nvim",
    config = function()
        require("rescue-lsp").setup()
    end
}

Configuration

Rescue-Lsp provides the following default configuration options:

require("rescue-lsp").setup({
    Lsp = {
        commands_override = false,
        find_lsp_servers = nil, -- Custom function for non-lspconfig/mason users to return a table of LSPs
    },
    window = {
        win_height = 30,
        win_width = 170,
        win_row = 10,
        win_col = 35,
        border = "rounded",
        relative = "editor",
    }
})

Example Custom Configuration

require("rescue-lsp").setup({
    Lsp = {
        commands_override = true,
        find_lsp_servers = function()
            -- Custom logic to return available LSPs
        end,
    },
    window = {
        win_height = 25,
        win_width = 150,
        border = "single",
    }
})

Commands

  • :Rescue - Opens the LSP status window in a floating format.
  • :RescueClose - Closes the floating LSP status window (can also use q key).
  • :RescueStart - Opens a selection UI to choose and start or restart an LSP.
  • RescueStop - Opens a selection UI to choose and stop an active LSP.
  • RescueRestart- Opens a selection UI to choose which LSP to restart

Known Issues

  • Text in floating windows may not fit perfectly yet.
  • Highlight groups might not apply to all custom strings.

Todo

  • Add customizable setup options.
  • Support text highlighting.
  • Implement text wrapping and formatting in the floating window.
  • Allow users to provide a custom function to fetch inactive LSP details if not using lspconfig.

License: MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages