Andriamanitra / mlsp

Language Server Protocol plugin for micro-editor
MIT License
7 stars 2 forks source link

µlsp

LSP client for micro-editor. Note that this is a work in progress and has not yet been tested extensively – expect there to be some bugs. Please open an issue if you run into any!

Demo

https://asciinema.org/a/610761

Installation

Simply clone the repository to your micro plugins directory:

git clone https://github.com/Andriamanitra/mlsp ~/.config/micro/plug/mlsp

You will also need to install language servers for the programming languages you want to use.

The plugin currently provides following commands:

You can type the commands on micro command prompt or bind them to keys by adding something like this to your bindings.json:

{
  "F7": "command:lsp",
  "F8": "command:format",
  "Alt-h": "command:hover",
  "Alt-d": "command:goto-definition",
  "Alt-r": "command:find-references"
}

Supported features

Showing LSP information on statusline

The plugin provides a function mlsp.status that can be used in the status line format. Here is an example configuration (~/.config/micro/settings.json) that uses it:

{
    "statusformatl": "$(filename) $(modified)($(line),$(col)) | ft:$(opt:filetype) | µlsp:$(mlsp.status)"
}

See micro documentation and the built-in status plugin for more information on customizing the statusline.

Known issues

Other similar projects