nanotee/nvim-lsp-basics

github github
lspneovim-0.5
stars 31
issues 1
subscribers 3
forks 0
CREATED

2021-04-25

UPDATED

2 years ago


nvim-lsp-basics

The shiny new built-in LSP client is awesome, but a large portion of its features don't have any associated mappings or ex-commands, unlike the tags feature. This kind of configuration is instead left up to the user, which can result in a lot of boilerplate.

This plugin attempts to fix that by providing basic mappings and user-commands.

Installation

-- packer.nvim
use 'nanotee/nvim-lsp-basics'

-- paq-nvim
paq 'nanotee/nvim-lsp-basics'
" vim-plug
Plug 'nanotee/nvim-lsp-basics'

Usage

Setup the plugin with nvim-lspconfig

require'lspconfig'.<languageserver>.setup{
    on_attach = function(client, bufnr)
        local basics = require('lsp_basics')

        basics.make_lsp_commands(client, bufnr)
        basics.make_lsp_mappings(client, bufnr)
    end
}

User Commands

See the docs for a list of user commands

Commands are created per buffer and only if the server has the associated capability. This way it's easy to tell at a glance what the server does or doesn't support.

Tab-completion is provided for commands that accept arguments (when applicable).

Mappings

TODO!

Other cool LSP plugins