From 1d16d64e814196c3cc845ae3ec7c15dc0ba34d9f Mon Sep 17 00:00:00 2001 From: rebuilt Date: Tue, 6 Jul 2021 13:02:38 +0200 Subject: [PATCH] Updated Home (markdown) --- Home.md | 112 +------------------------------------------------------- 1 file changed, 1 insertion(+), 111 deletions(-) diff --git a/Home.md b/Home.md index 08a6f13..20d16cb 100644 --- a/Home.md +++ b/Home.md @@ -7,7 +7,7 @@ - [Installing Plugins](https://github.com/ChristianChiarulli/LunarVim/wiki/Installing-Plugins) - [Removing Plugins](https://github.com/ChristianChiarulli/LunarVim/wiki/Removing-Plugins) - [Using Packer](https://github.com/ChristianChiarulli/LunarVim/wiki/Using-Packer) -- [Clipboard Support](#clipboard-support) +- [Clipboard Support](https://github.com/ChristianChiarulli/LunarVim/wiki/Clipboard-Support) - [LSP](#lsp) * [Lsp errors](#lsp-errors) + [Understanding LspInfo](#understanding-lspinfo) @@ -30,116 +30,6 @@ -# LSP - -Neovim comes bundled with a language client but not a language server. -To install a supported language server: - -``` md - :LspInstall -``` - -See [LspInstall](https://github.com/kabouzeid/nvim-lspinstall) for more -info. - -In order for Java LSP to work, edit `~/.local/share/nvim/lspinstall/java/jdtls.sh` and replace `WORKSPACE="$1"` with `WORKSPACE="$HOME/workspace"` - -Most common languages should be supported out of the box, if yours is -not I would welcome a PR - -## Lsp errors - -LunarVim lists the attached lsp server in the bottom status bar. If it -says ‘No client connected’ use :LspInfo to troubleshoot. - -### Understanding LspInfo - -1. Make sure there is a client attached to the buffer. 0 attached - clients means lsp is not running -2. Active clients are clients in other files you have open -3. Clients that match the filetype will be listed. If installed with - :LspInstall the language servers will be installed. -4. ‘cmd’ must be populated. This is the language server executable. If - the ‘cmd’ isn’t set or if it’s not executable you won’t be able to - run the language server. - * In the example below ‘efm-langserver’ is the name of the binary - that acts as the langserver. If we run ‘which efm-langserver’ and we - get a location to the executable, it means the langauge server is - installed and available globally. - * If you know the command is installed AND you don’t want to install - it globally you’ll need to manually set 'cmd' in the language server - settings. - * Configurations are stored in ~/.config/nvim/lua/lsp/ - The settings will be stored in a file that matches the name of the language. - e.g. python-ls.lua - * ‘identified root’ must also be populated. Most - language servers require you be inside a git repository for the root - to be detected. If you don’t want to initialize the directory as a - git repository, an empty .git/ folder will also work. -5. Some language servers get set up on a per project basis so you may - have to reinstall the language server when you move to a different - project. - -### Example configurations - -[ ======== LSP NOT running ======== ] - -``` md -0 client(s) attached to this buffer: - -0 active client(s): - -Clients that match the filetype python: - - Config: efm - cmd: /Users/my-user/.local/share/nvim/lspinstall/efm/efm-langserver - cmd is executable: True - identified root: None - custom handlers: - - Config: pyright - cmd: /Users/my-user/.local/share/nvim/lspinstall/python/node_modules/.bin/pyright-langserver --stdio - cmd is executable: True - identified root: None - custom handlers: textDocument/publishDiagnostics -``` - ---- - -[ ======== LSP IS running ======== ] - -``` md -2 client(s) attached to this buffer: pyright, efm - - Client: pyright (id 1) - root: /home/my-user/workspace/canary - filetypes: python - cmd: /home/my-user/.local/share/nvim/lspinstall/python/node_modules/.bin/pyright-langserver --stdio - - - Client: efm (id 2) - root: /home/my-user/workspace/canary - filetypes: lua, python, javascriptreact, javascript, typescript, typescriptreact, sh, html, css, json, yaml, markdown, vue - cmd: /home/my-user/.local/share/nvim/lspinstall/efm/efm-langserver -``` - -### Last resort - -If you still have problems after implementing the above measures, rule -out plugin problems with the following. This reinstalls your plugins and -language servers. - -``` md -rm -rf ~/.local/share/nvim/site -:PackerCompile -:PackerInstall -:LspInstall python <-- REPLACE WITH YOUR OWN LANGUAGE -:LspInstall efm <-- REPLACE WITH YOUR OWN LANGUAGE -``` - -For a more in depth LSP support: -[link](https://github.com/neovim/nvim-lspconfig/blob/master/CONFIG.md) - # Useful Programs LunarVim depends on the following: