GithubHelp home page GithubHelp logo

isabella232 / vim-lsp-settings Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lumakernel/vim-lsp-settings

0.0 0.0 0.0 907 KB

Auto configurations for Language Server for vim-lsp

License: MIT License

Batchfile 12.43% Shell 14.63% Vim Script 72.70% Makefile 0.23%

vim-lsp-settings's Introduction

vim-lsp-settings

Actions Status Actions Status

Auto configurations for Language Servers for vim-lsp.

Introduction

Language Servers are not easy to install. Visual Studio Code provides easy ways to install and update Language Servers and Language Server Client. This plugin provides the same feature for Vim.

Installation

Using the vim-plug plugin manager:

Plug 'prabirshrestha/vim-lsp'
Plug 'mattn/vim-lsp-settings'

You need to install both vim-lsp and vim-lsp-settings.

If you want to use auto-completion, you can use one of the following.

asyncomplete.vim

Plug 'prabirshrestha/asyncomplete.vim'
Plug 'prabirshrestha/asyncomplete-lsp.vim'

deoplete.nvim

Plug 'Shougo/deoplete.nvim'
Plug 'lighttiger2505/deoplete-vim-lsp'

server store directory

Windows

%LOCALAPPDATA%\vim-lsp-settings\servers

MacOS/Linux

$HOME/.local/share/vim-lsp-settings/servers

If you define $XDG_DATA_HOME:

$XDG_DATA_HOME/vim-lsp-settings/servers

You can change the directory to install servers by set g:lsp_settings_servers_dir option in full path.

Usage

While editing a file with a supported filetype:

:LspInstallServer

To uninstall server:

:LspUninstallServer server-name

Because there is no way to update a server, please run :LspInstallServer again, the newer version will be installed.

Supported Languages

Language Language Server Installer Local Install
Apex/VisualForce apex-jorje-lsp Yes Yes
Bash bash-language-server Yes Yes
C# omnisharp Yes Yes
C/C++ clangd Yes Yes
COBOL cobol-language-support Yes Yes
CSS css-languageserver Yes Yes
Clojure clojure-lsp Yes Yes
Clojure clj-kondo-lsp Yes Yes
Cmake cmake-language-server Yes Yes
D dls Yes No
D serve-d Yes No
Dart analysis-server-dart-snapshot Yes Yes
Dockerfile dockerfile-language-server-nodejs Yes Yes
Elixir elixir-ls Yes Yes
Elm elm-language-server Yes Yes
Erlang erlang-ls Yes Yes
F# fsharp-language-server Yes Yes
Fortran fortls Yes Yes
Go gopls Yes Yes
Go golangci-lint-langserver Yes Yes
GraphQL gql-language-server Yes Yes
Groovy groovy-language-server Yes Yes
Haskell haskell-ide-engine No No
Haskell haskell-language-server No No
HTML html-languageserver Yes Yes
HTML angular-language-server Yes Yes
HTML tailwindcss-intellisense Yes Yes
JSON json-languageserver Yes Yes
JSON rome Yes Yes
Java eclipse-jdt-ls Yes Yes
Java java-language-server No Yes
JavaScript typescript-language-server Yes Yes
JavaScript javascript-typescript-stdio Yes Yes
JavaScript rome Yes Yes
JavaScript eslint-language-server Yes Yes
Julia LanguageServer.jl Yes No
Java java-language-server No No
Kotlin kotlin-language-server Yes Yes
Lisp cl-lsp Yes No
Lua emmylua-ls Yes Yes
Lua sumneko-lua-language-server Yes Yes
Nim nimls No No
PHP intelephense Yes Yes
OCaml ocaml-lsp UNIX Only Yes
Python pyls-all (pyls with dependencies) Yes Yes
Python pyls (pyls without dependencies) Yes Yes
Python pyls-ms (Microsoft Version) Yes Yes
Python jedi-language-server Yes Yes
Python pyright-langserver Yes Yes
Prisma prisma-language-server Yes Yes
R languageserver Yes No
Reason reason-language-server Yes Yes
Ruby solargraph Yes Yes
Rust rls Yes No
Rust rust-analyzer Yes Yes
SQL sql-language-server Yes Yes
SQL sqls Yes Yes
Scala Metals Yes Yes
Svelte svelte-language-server Yes Yes
Swift sourcekit-lsp Yes No
SystemVerilog svls Yes Yes
TeX texlab Yes Yes
TeX digestif Yes No
Terraform terraform-lsp Yes Yes
Terraform terraform-ls Yes Yes
TTCN-3 ntt Yes Yes
TypeScript typescript-language-server Yes Yes
TypeScript rome Yes Yes
TypeScript eslint-language-server Yes Yes
Vim vim-language-server Yes Yes
Vala vala-language-server No No
Vue vue-language-server Yes Yes
V vls Yes Yes
XML lemminx Yes Yes
YAML yaml-language-server Yes Yes
ZIG zls No No
* efm-langserver Yes Yes

Notes

clangd (C/C++)

There is a Linux OS/version that does not run the locally installed clangd due to zlib version mismatch. If you want to use clangd, please install clangd on your system.

rls (Rust)

If you installed rls already, you can use rls without configurations. But if you have not installed rls yet, you can install it by following these instructions.

gql-language-server (GraphQL)

To use gql-language-server, the .gqlconfig has to be located on the top of project directory. The schema must be pointed to the schema file correctly.

{
  schema: {
    files: 'path/to/schema.graphql'
  }
}

Finally, you have to install @playlyfe/gql into your project.

$ npm install @playlyfe/gql --save-dev

If you have a separate existing installation of the dart analysis server and want it to be used, it must either exist in your path, or you must specify its location. See 'Configurations' below.

If you installed hie with stack, you can use hie without configurations. But if you have not installed hie yet, you can install it by following these steps.

Configurations

Most of the configurations are not required.

If you installed clangd already, you can use clangd for C/C++ without any configuration. But if you installed clang with named clangd-6.0, you can replace executable like below:

let g:lsp_settings = {
\  'clangd': {'cmd': ['clangd-6.0']},
\  'efm-langserver': {'disabled': v:false}
\}

Or put .vim-lsp-settings/settings.json in your project root directory.

{
  "clangd": {
    "cmd": ["clangd-6.0"]
  },
  "efm-langserver": {
    "disabled": false
  }
}

If you already have the dart analysis server installed but it is not in your path, you can still configure the settings to use it. Use the vimscript below to change the command to start the server. Note the command has three parts: the path to your 'dart' executable, the path to your 'analysis_server.dart.snapshot', and the '--lsp' flag.

let g:lsp_settings = {
    \ 'analysis-server-dart-snapshot': {
    \     'cmd': [
    \         '/path/to/your/dart-sdk/bin/dart',
    \         '/path/to/your/dart-sdk/bin/bin/snapshots/analysis_server.dart.snapshot',
    \         '--lsp'
    \     ],
    \ },
\ }

To edit the project local settings.json, do :LspSettingsLocalEdit.

Overridable keys are:

  • cmd (List ex: ['clangd-6.0', '-enable-snippets'])
  • initialization_options (Dictionary)
  • allowlist (List)
  • blocklist (List)
  • config (Dictionary)
  • workspace_config (Dictionary)
  • disabled (Boolean)
  • root_uri (String)
  • root_uri_patterns (List)
  • semantic_highlight (Dictionary)

If you have some Language Servers and want to use specified the server:

let g:lsp_settings_filetype_perl = 'slp'
let g:lsp_settings_filetype_html = ['html-languageserver', 'angular-language-server']
let g:lsp_settings_filetype_typescript = ['typescript-language-server', 'eslint-language-server']

When the servers are specified in a list, these will all be started.

If you want to configure Language Server to use flake8 rather than pycodestyle, the following can be added to your ~/.vimrc file. Note that pyls-all was the automatically registered server name. Check with :LspStatus.

let g:lsp_settings = {
\   'pyls-all': {
\     'workspace_config': {
\       'pyls': {
\         'configurationSources': ['flake8']
\       }
\     }
\   },
\}

If you want to disable a Language Server:

let g:lsp_settings = {
\  'perl-languageserver': {
\    'disabled': 1,
\   }
\}

When resolving the root directory for a language server, this plugin will look for directories containing special root markers defined in g:lsp_settings_root_markers.

By default, this is set to:

let g:lsp_settings_root_markers = [
\   '.git',
\   '.git/',
\   '.svn',
\   '.hg',
\   '.bzr'
\ ]

If you need to specify alternative root markers:

let g:lsp_settings_root_markers = ['.projections.json', '.git', '.git/']

This would look for a custom .projections.json, a git submodule .git or a git root .git/ starting from the current directory upwards.

License

MIT

Author

Yasuhiro Matsumoto (a.k.a. mattn)

vim-lsp-settings's People

Contributors

mattn avatar johejo avatar prabirshrestha avatar tsuyoshicho avatar yaegassy avatar tyru avatar heavenshell avatar thomasfaingnaert avatar wingyplus avatar milly avatar lumakernel avatar kjuq avatar wordijp avatar xuanduc987 avatar tksgi avatar thinca avatar quietsato avatar itchyny avatar idbrii avatar sgur avatar supermomonga avatar kuro46 avatar pojiro avatar get-me-power avatar ippachi avatar hrsh7th avatar dalance avatar bo5o avatar logston avatar jmdevin avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.