From 50949088826979a289850fd809d5e87a6b341527 Mon Sep 17 00:00:00 2001 From: steven-na Date: Mon, 1 Jun 2026 21:52:03 -0700 Subject: lightvim --- arch/fish/.config/fish/conf.d/edit-configs.fish | 1 + arch/fish/.config/fish/fish_variables | 1 + arch/fish/.config/fish/functions/vims.fish | 44 ++ arch/lightvim/.config/lightvim/init.lua | 59 +++ arch/lightvim/.config/lightvim/lsp/ada_ls.lua | 31 ++ arch/lightvim/.config/lightvim/lsp/agda_ls.lua | 17 + arch/lightvim/.config/lightvim/lsp/aiken.lua | 15 + arch/lightvim/.config/lightvim/lsp/air.lua | 14 + arch/lightvim/.config/lightvim/lsp/alloy_ls.lua | 30 ++ .../lightvim/lsp/anakin_language_server.lua | 71 +++ arch/lightvim/.config/lightvim/lsp/angularls.lua | 123 +++++ arch/lightvim/.config/lightvim/lsp/ansiblels.lua | 38 ++ arch/lightvim/.config/lightvim/lsp/antlersls.lua | 15 + arch/lightvim/.config/lightvim/lsp/apex_ls.lua | 61 +++ .../lightvim/lsp/arduino_language_server.lua | 93 ++++ arch/lightvim/.config/lightvim/lsp/asm_lsp.lua | 15 + arch/lightvim/.config/lightvim/lsp/ast_grep.lua | 48 ++ arch/lightvim/.config/lightvim/lsp/astro.lua | 70 +++ arch/lightvim/.config/lightvim/lsp/atlas.lua | 66 +++ arch/lightvim/.config/lightvim/lsp/atopile.lua | 14 + .../.config/lightvim/lsp/autohotkey_lsp.lua | 52 +++ .../lightvim/.config/lightvim/lsp/autotools_ls.lua | 24 + arch/lightvim/.config/lightvim/lsp/awk_ls.lua | 14 + .../.config/lightvim/lsp/azure_pipelines_ls.lua | 39 ++ arch/lightvim/.config/lightvim/lsp/bacon_ls.lua | 47 ++ arch/lightvim/.config/lightvim/lsp/ballerina.lua | 13 + .../lightvim/.config/lightvim/lsp/basedpyright.lua | 72 +++ arch/lightvim/.config/lightvim/lsp/bashls.lua | 30 ++ arch/lightvim/.config/lightvim/lsp/basics_ls.lua | 27 ++ arch/lightvim/.config/lightvim/lsp/bazelrc_lsp.lua | 22 + arch/lightvim/.config/lightvim/lsp/beancount.lua | 13 + arch/lightvim/.config/lightvim/lsp/bicep.lua | 40 ++ arch/lightvim/.config/lightvim/lsp/biome.lua | 82 ++++ .../lightvim/lsp/bitbake_language_server.lua | 17 + .../lightvim/.config/lightvim/lsp/blueprint_ls.lua | 22 + arch/lightvim/.config/lightvim/lsp/bqls.lua | 17 + .../.config/lightvim/lsp/bright_script.lua | 15 + arch/lightvim/.config/lightvim/lsp/brioche.lua | 12 + arch/lightvim/.config/lightvim/lsp/bsl_ls.lua | 11 + arch/lightvim/.config/lightvim/lsp/buck2.lua | 18 + arch/lightvim/.config/lightvim/lsp/buddy_ls.lua | 13 + arch/lightvim/.config/lightvim/lsp/buf_ls.lua | 37 ++ arch/lightvim/.config/lightvim/lsp/bzl.lua | 15 + arch/lightvim/.config/lightvim/lsp/c3_lsp.lua | 12 + arch/lightvim/.config/lightvim/lsp/cairo_ls.lua | 20 + arch/lightvim/.config/lightvim/lsp/ccls.lua | 53 +++ arch/lightvim/.config/lightvim/lsp/cds_lsp.lua | 20 + .../.config/lightvim/lsp/cir_lsp_server.lua | 14 + arch/lightvim/.config/lightvim/lsp/circom-lsp.lua | 12 + arch/lightvim/.config/lightvim/lsp/clangd.lua | 104 +++++ arch/lightvim/.config/lightvim/lsp/clarinet.lua | 11 + arch/lightvim/.config/lightvim/lsp/clojure_lsp.lua | 12 + arch/lightvim/.config/lightvim/lsp/cmake.lua | 15 + arch/lightvim/.config/lightvim/lsp/cobol_ls.lua | 10 + arch/lightvim/.config/lightvim/lsp/codebook.lua | 39 ++ arch/lightvim/.config/lightvim/lsp/coffeesense.lua | 16 + arch/lightvim/.config/lightvim/lsp/contextive.lua | 17 + arch/lightvim/.config/lightvim/lsp/copilot.lua | 135 ++++++ arch/lightvim/.config/lightvim/lsp/coq_lsp.lua | 10 + arch/lightvim/.config/lightvim/lsp/crystalline.lua | 12 + arch/lightvim/.config/lightvim/lsp/csharp_ls.lua | 38 ++ arch/lightvim/.config/lightvim/lsp/cspell_ls.lua | 24 + .../.config/lightvim/lsp/css_variables.lua | 51 ++ arch/lightvim/.config/lightvim/lsp/csskit.lua | 18 + arch/lightvim/.config/lightvim/lsp/cssls.lua | 44 ++ .../.config/lightvim/lsp/cssmodules_ls.lua | 17 + arch/lightvim/.config/lightvim/lsp/ctags_lsp.lua | 28 ++ .../lightvim/lsp/cucumber_language_server.lua | 19 + arch/lightvim/.config/lightvim/lsp/cue.lua | 12 + .../.config/lightvim/lsp/custom_elements_ls.lua | 32 ++ arch/lightvim/.config/lightvim/lsp/cypher_ls.lua | 18 + arch/lightvim/.config/lightvim/lsp/daedalus_ls.lua | 27 ++ arch/lightvim/.config/lightvim/lsp/dafny.lua | 15 + arch/lightvim/.config/lightvim/lsp/dagger.lua | 12 + arch/lightvim/.config/lightvim/lsp/dartls.lua | 26 ++ arch/lightvim/.config/lightvim/lsp/dcmls.lua | 12 + arch/lightvim/.config/lightvim/lsp/debputy.lua | 12 + arch/lightvim/.config/lightvim/lsp/denols.lua | 161 +++++++ .../.config/lightvim/lsp/dhall_lsp_server.lua | 18 + .../lightvim/.config/lightvim/lsp/diagnosticls.lua | 14 + arch/lightvim/.config/lightvim/lsp/digestif.lua | 16 + arch/lightvim/.config/lightvim/lsp/djls.lua | 12 + arch/lightvim/.config/lightvim/lsp/djlsp.lua | 13 + .../lsp/docker_compose_language_service.lua | 19 + .../lightvim/lsp/docker_language_server.lua | 32 ++ arch/lightvim/.config/lightvim/lsp/dockerls.lua | 30 ++ arch/lightvim/.config/lightvim/lsp/dolmenls.lua | 15 + arch/lightvim/.config/lightvim/lsp/dotls.lua | 15 + arch/lightvim/.config/lightvim/lsp/dprint.lua | 26 ++ .../.config/lightvim/lsp/ds_pinyin_lsp.lua | 69 +++ arch/lightvim/.config/lightvim/lsp/dts_lsp.lua | 22 + arch/lightvim/.config/lightvim/lsp/earthlyls.lua | 12 + arch/lightvim/.config/lightvim/lsp/ecsact.lua | 15 + arch/lightvim/.config/lightvim/lsp/efm.lua | 25 + arch/lightvim/.config/lightvim/lsp/elixirls.lua | 47 ++ arch/lightvim/.config/lightvim/lsp/elmls.lua | 35 ++ arch/lightvim/.config/lightvim/lsp/elp.lua | 13 + arch/lightvim/.config/lightvim/lsp/ember.lua | 16 + .../.config/lightvim/lsp/emmet_language_server.lua | 29 ++ arch/lightvim/.config/lightvim/lsp/emmet_ls.lua | 31 ++ arch/lightvim/.config/lightvim/lsp/emmylua_ls.lua | 24 + .../.config/lightvim/lsp/erg_language_server.lua | 19 + arch/lightvim/.config/lightvim/lsp/esbonio.lua | 51 ++ arch/lightvim/.config/lightvim/lsp/eslint.lua | 231 +++++++++ arch/lightvim/.config/lightvim/lsp/expert.lua | 26 ++ .../lightvim/lsp/facility_language_server.lua | 12 + .../lightvim/lsp/fennel_language_server.lua | 13 + arch/lightvim/.config/lightvim/lsp/fennel_ls.lua | 26 ++ arch/lightvim/.config/lightvim/lsp/fish_lsp.lua | 17 + arch/lightvim/.config/lightvim/lsp/flow.lua | 29 ++ arch/lightvim/.config/lightvim/lsp/flux_lsp.lua | 14 + arch/lightvim/.config/lightvim/lsp/foam_ls.lua | 29 ++ arch/lightvim/.config/lightvim/lsp/fortitude.lua | 30 ++ arch/lightvim/.config/lightvim/lsp/fortls.lua | 27 ++ .../.config/lightvim/lsp/fsautocomplete.lua | 55 +++ .../lightvim/lsp/fsharp_language_server.lua | 30 ++ arch/lightvim/.config/lightvim/lsp/fstar.lua | 12 + arch/lightvim/.config/lightvim/lsp/futhark_lsp.lua | 17 + arch/lightvim/.config/lightvim/lsp/gdscript.lua | 15 + .../lightvim/.config/lightvim/lsp/gdshader_lsp.lua | 12 + .../.config/lightvim/lsp/gh_actions_ls.lua | 57 +++ arch/lightvim/.config/lightvim/lsp/ghcide.lua | 13 + arch/lightvim/.config/lightvim/lsp/ghdl_ls.lua | 15 + arch/lightvim/.config/lightvim/lsp/ginko_ls.lua | 17 + .../lightvim/.config/lightvim/lsp/gitlab_ci_ls.lua | 26 ++ arch/lightvim/.config/lightvim/lsp/gitlab_duo.lua | 446 ++++++++++++++++++ arch/lightvim/.config/lightvim/lsp/glasgow.lua | 30 ++ arch/lightvim/.config/lightvim/lsp/gleam.lua | 14 + arch/lightvim/.config/lightvim/lsp/glint.lua | 60 +++ .../.config/lightvim/lsp/glsl_analyzer.lua | 13 + arch/lightvim/.config/lightvim/lsp/glslls.lua | 23 + .../.config/lightvim/lsp/gn_language_server.lua | 13 + arch/lightvim/.config/lightvim/lsp/gnls.lua | 21 + .../.config/lightvim/lsp/golangci_lint_ls.lua | 72 +++ arch/lightvim/.config/lightvim/lsp/gopls.lua | 99 ++++ arch/lightvim/.config/lightvim/lsp/gradle_ls.lua | 28 ++ arch/lightvim/.config/lightvim/lsp/grammarly.lua | 26 ++ arch/lightvim/.config/lightvim/lsp/graphql.lua | 23 + arch/lightvim/.config/lightvim/lsp/groovyls.lua | 33 ++ arch/lightvim/.config/lightvim/lsp/guile_ls.lua | 21 + arch/lightvim/.config/lightvim/lsp/harper_ls.lua | 52 +++ arch/lightvim/.config/lightvim/lsp/hdl_checker.lua | 12 + arch/lightvim/.config/lightvim/lsp/helm_ls.lua | 25 + arch/lightvim/.config/lightvim/lsp/herb_ls.lua | 29 ++ arch/lightvim/.config/lightvim/lsp/hhvm.lua | 14 + arch/lightvim/.config/lightvim/lsp/hie.lua | 25 + arch/lightvim/.config/lightvim/lsp/hlasm.lua | 12 + arch/lightvim/.config/lightvim/lsp/hls.lua | 31 ++ .../.config/lightvim/lsp/home_assistant.lua | 18 + arch/lightvim/.config/lightvim/lsp/hoon_ls.lua | 17 + arch/lightvim/.config/lightvim/lsp/html.lua | 46 ++ arch/lightvim/.config/lightvim/lsp/htmx.lua | 64 +++ arch/lightvim/.config/lightvim/lsp/hydra_lsp.lua | 12 + arch/lightvim/.config/lightvim/lsp/hylo_ls.lua | 13 + arch/lightvim/.config/lightvim/lsp/hyprls.lua | 15 + arch/lightvim/.config/lightvim/lsp/idris2_lsp.lua | 42 ++ .../lightvim/.config/lightvim/lsp/intelephense.lua | 41 ++ arch/lightvim/.config/lightvim/lsp/janet_lsp.lua | 15 + .../.config/lightvim/lsp/java_language_server.lua | 16 + arch/lightvim/.config/lightvim/lsp/jdtls.lua | 102 ++++ .../.config/lightvim/lsp/jedi_language_server.lua | 19 + arch/lightvim/.config/lightvim/lsp/jinja_lsp.lua | 23 + arch/lightvim/.config/lightvim/lsp/jqls.lua | 24 + arch/lightvim/.config/lightvim/lsp/jsonls.lua | 41 ++ arch/lightvim/.config/lightvim/lsp/jsonnet_ls.lua | 20 + arch/lightvim/.config/lightvim/lsp/julials.lua | 138 ++++++ arch/lightvim/.config/lightvim/lsp/just.lua | 12 + arch/lightvim/.config/lightvim/lsp/kakehashi.lua | 41 ++ arch/lightvim/.config/lightvim/lsp/kcl.lua | 13 + arch/lightvim/.config/lightvim/lsp/koka.lua | 11 + .../lightvim/lsp/kotlin_language_server.lua | 42 ++ arch/lightvim/.config/lightvim/lsp/kotlin_lsp.lua | 23 + arch/lightvim/.config/lightvim/lsp/kulala_ls.lua | 12 + arch/lightvim/.config/lightvim/lsp/laravel_ls.lua | 14 + arch/lightvim/.config/lightvim/lsp/lean3ls.lua | 40 ++ arch/lightvim/.config/lightvim/lsp/lelwel_ls.lua | 17 + arch/lightvim/.config/lightvim/lsp/lemminx.lua | 14 + arch/lightvim/.config/lightvim/lsp/lexical.lua | 15 + arch/lightvim/.config/lightvim/lsp/lsp_ai.lua | 24 + arch/lightvim/.config/lightvim/lsp/ltex.lua | 86 ++++ arch/lightvim/.config/lightvim/lsp/ltex_plus.lua | 89 ++++ arch/lightvim/.config/lightvim/lsp/lua_ls.lua | 97 ++++ arch/lightvim/.config/lightvim/lsp/luau_lsp.lua | 20 + arch/lightvim/.config/lightvim/lsp/lwc_ls.lua | 30 ++ arch/lightvim/.config/lightvim/lsp/m68k.lua | 24 + .../.config/lightvim/lsp/markdown_oxide.lua | 37 ++ arch/lightvim/.config/lightvim/lsp/marko-js.lua | 17 + arch/lightvim/.config/lightvim/lsp/marksman.lua | 16 + arch/lightvim/.config/lightvim/lsp/matlab_ls.lua | 34 ++ .../lightvim/.config/lightvim/lsp/mdx_analyzer.lua | 22 + arch/lightvim/.config/lightvim/lsp/mesonlsp.lua | 38 ++ arch/lightvim/.config/lightvim/lsp/metals.lua | 32 ++ arch/lightvim/.config/lightvim/lsp/millet.lua | 19 + arch/lightvim/.config/lightvim/lsp/mint.lua | 13 + .../.config/lightvim/lsp/mlir_lsp_server.lua | 14 + .../.config/lightvim/lsp/mlir_pdll_lsp_server.lua | 14 + arch/lightvim/.config/lightvim/lsp/mm0_ls.lua | 15 + arch/lightvim/.config/lightvim/lsp/mojo.lua | 14 + arch/lightvim/.config/lightvim/lsp/motoko_lsp.lua | 15 + .../.config/lightvim/lsp/move_analyzer.lua | 20 + arch/lightvim/.config/lightvim/lsp/mpls.lua | 36 ++ .../lightvim/lsp/msbuild_project_tools_server.lua | 47 ++ arch/lightvim/.config/lightvim/lsp/muon.lua | 25 + arch/lightvim/.config/lightvim/lsp/mutt_ls.lua | 17 + arch/lightvim/.config/lightvim/lsp/nelua_lsp.lua | 31 ++ arch/lightvim/.config/lightvim/lsp/neocmake.lua | 24 + arch/lightvim/.config/lightvim/lsp/nextflow_ls.lua | 38 ++ arch/lightvim/.config/lightvim/lsp/nextls.lua | 12 + .../.config/lightvim/lsp/nginx_language_server.lua | 16 + arch/lightvim/.config/lightvim/lsp/nickel_ls.lua | 32 ++ arch/lightvim/.config/lightvim/lsp/nil_ls.lua | 17 + .../.config/lightvim/lsp/nim_langserver.lua | 23 + arch/lightvim/.config/lightvim/lsp/nimls.lua | 23 + arch/lightvim/.config/lightvim/lsp/nixd.lua | 15 + arch/lightvim/.config/lightvim/lsp/nomad_lsp.lua | 34 ++ arch/lightvim/.config/lightvim/lsp/ntt.lua | 20 + arch/lightvim/.config/lightvim/lsp/nushell.lua | 14 + arch/lightvim/.config/lightvim/lsp/nxls.lua | 17 + arch/lightvim/.config/lightvim/lsp/ocamllsp.lua | 88 ++++ arch/lightvim/.config/lightvim/lsp/ols.lua | 17 + arch/lightvim/.config/lightvim/lsp/omnisharp.lua | 92 ++++ arch/lightvim/.config/lightvim/lsp/opencl_ls.lua | 14 + arch/lightvim/.config/lightvim/lsp/openscad_ls.lua | 27 ++ .../lightvim/.config/lightvim/lsp/openscad_lsp.lua | 17 + arch/lightvim/.config/lightvim/lsp/oso.lua | 32 ++ arch/lightvim/.config/lightvim/lsp/oxfmt.lua | 58 +++ arch/lightvim/.config/lightvim/lsp/oxlint.lua | 87 ++++ arch/lightvim/.config/lightvim/lsp/pact_ls.lua | 12 + arch/lightvim/.config/lightvim/lsp/pasls.lua | 28 ++ arch/lightvim/.config/lightvim/lsp/pbls.lua | 19 + arch/lightvim/.config/lightvim/lsp/perlls.lua | 31 ++ .../.config/lightvim/lsp/perlnavigator.lua | 28 ++ arch/lightvim/.config/lightvim/lsp/perlpls.lua | 22 + arch/lightvim/.config/lightvim/lsp/pest_ls.lua | 12 + arch/lightvim/.config/lightvim/lsp/phan.lua | 32 ++ arch/lightvim/.config/lightvim/lsp/phpactor.lua | 13 + .../lightvim/.config/lightvim/lsp/phpantom_lsp.lua | 12 + arch/lightvim/.config/lightvim/lsp/phptools.lua | 36 ++ arch/lightvim/.config/lightvim/lsp/pico8_ls.lua | 18 + arch/lightvim/.config/lightvim/lsp/please.lua | 14 + arch/lightvim/.config/lightvim/lsp/pli.lua | 12 + .../.config/lightvim/lsp/pony_language_server.lua | 13 + arch/lightvim/.config/lightvim/lsp/pony_lsp.lua | 24 + .../.config/lightvim/lsp/poryscript_pls.lua | 12 + .../lightvim/.config/lightvim/lsp/postgres_lsp.lua | 15 + .../.config/lightvim/lsp/powershell_es.lua | 56 +++ arch/lightvim/.config/lightvim/lsp/prismals.lua | 20 + arch/lightvim/.config/lightvim/lsp/prolog_ls.lua | 22 + arch/lightvim/.config/lightvim/lsp/prosemd_lsp.lua | 14 + arch/lightvim/.config/lightvim/lsp/protols.lua | 17 + arch/lightvim/.config/lightvim/lsp/psalm.lua | 15 + arch/lightvim/.config/lightvim/lsp/pug.lua | 14 + arch/lightvim/.config/lightvim/lsp/puppet.lua | 28 ++ .../lightvim/.config/lightvim/lsp/purescriptls.lua | 15 + arch/lightvim/.config/lightvim/lsp/pylsp.lua | 41 ++ arch/lightvim/.config/lightvim/lsp/pylyzer.lua | 35 ++ arch/lightvim/.config/lightvim/lsp/pyre.lua | 17 + arch/lightvim/.config/lightvim/lsp/pyrefly.lua | 28 ++ arch/lightvim/.config/lightvim/lsp/pyright.lua | 68 +++ arch/lightvim/.config/lightvim/lsp/qmlls.lua | 14 + .../.config/lightvim/lsp/quick_lint_js.lua | 14 + .../.config/lightvim/lsp/r_language_server.lua | 20 + .../.config/lightvim/lsp/racket_langserver.lua | 16 + .../.config/lightvim/lsp/raku_navigator.lua | 28 ++ arch/lightvim/.config/lightvim/lsp/reason_ls.lua | 12 + arch/lightvim/.config/lightvim/lsp/regal.lua | 22 + arch/lightvim/.config/lightvim/lsp/regols.lua | 22 + arch/lightvim/.config/lightvim/lsp/remark_ls.lua | 46 ++ arch/lightvim/.config/lightvim/lsp/rescriptls.lua | 59 +++ arch/lightvim/.config/lightvim/lsp/rls.lua | 35 ++ arch/lightvim/.config/lightvim/lsp/rnix.lua | 20 + arch/lightvim/.config/lightvim/lsp/robotcode.lua | 18 + .../.config/lightvim/lsp/robotframework_ls.lua | 12 + arch/lightvim/.config/lightvim/lsp/roc_ls.lua | 13 + arch/lightvim/.config/lightvim/lsp/rome.lua | 33 ++ arch/lightvim/.config/lightvim/lsp/roslyn_ls.lua | 377 +++++++++++++++ arch/lightvim/.config/lightvim/lsp/rpmspec.lua | 19 + arch/lightvim/.config/lightvim/lsp/rubocop.lua | 10 + arch/lightvim/.config/lightvim/lsp/ruby_lsp.lua | 33 ++ arch/lightvim/.config/lightvim/lsp/ruff.lua | 35 ++ arch/lightvim/.config/lightvim/lsp/ruff_lsp.lua | 31 ++ arch/lightvim/.config/lightvim/lsp/rumdl.lua | 12 + .../.config/lightvim/lsp/rune_languageserver.lua | 13 + .../.config/lightvim/lsp/rust_analyzer.lua | 193 ++++++++ arch/lightvim/.config/lightvim/lsp/salt_ls.lua | 16 + .../.config/lightvim/lsp/scheme_langserver.lua | 15 + arch/lightvim/.config/lightvim/lsp/scry.lua | 12 + arch/lightvim/.config/lightvim/lsp/selene3p_ls.lua | 12 + arch/lightvim/.config/lightvim/lsp/serve_d.lua | 13 + .../.config/lightvim/lsp/shopify_theme_ls.lua | 26 ++ arch/lightvim/.config/lightvim/lsp/sixtyfps.lua | 25 + arch/lightvim/.config/lightvim/lsp/slangd.lua | 31 ++ arch/lightvim/.config/lightvim/lsp/slint_lsp.lua | 24 + arch/lightvim/.config/lightvim/lsp/smarty_ls.lua | 36 ++ arch/lightvim/.config/lightvim/lsp/smithy_ls.lua | 41 ++ .../lightvim/.config/lightvim/lsp/snakeskin_ls.lua | 15 + arch/lightvim/.config/lightvim/lsp/snyk_ls.lua | 99 ++++ arch/lightvim/.config/lightvim/lsp/solang.lua | 19 + arch/lightvim/.config/lightvim/lsp/solargraph.lua | 25 + arch/lightvim/.config/lightvim/lsp/solc.lua | 17 + arch/lightvim/.config/lightvim/lsp/solidity.lua | 42 ++ arch/lightvim/.config/lightvim/lsp/solidity_ls.lua | 28 ++ .../lightvim/lsp/solidity_ls_nomicfoundation.lua | 28 ++ arch/lightvim/.config/lightvim/lsp/somesass_ls.lua | 30 ++ arch/lightvim/.config/lightvim/lsp/sorbet.lua | 19 + arch/lightvim/.config/lightvim/lsp/sourcekit.lua | 40 ++ arch/lightvim/.config/lightvim/lsp/spade_ls.lua | 18 + arch/lightvim/.config/lightvim/lsp/spectral.lua | 23 + .../lightvim/lsp/spyglassmc_language_server.lua | 24 + arch/lightvim/.config/lightvim/lsp/sqlls.lua | 13 + arch/lightvim/.config/lightvim/lsp/sqls.lua | 19 + arch/lightvim/.config/lightvim/lsp/sqruff.lua | 13 + arch/lightvim/.config/lightvim/lsp/stan_ls.lua | 13 + arch/lightvim/.config/lightvim/lsp/standardrb.lua | 12 + .../.config/lightvim/lsp/starlark_rust.lua | 16 + arch/lightvim/.config/lightvim/lsp/starpls.lua | 12 + arch/lightvim/.config/lightvim/lsp/statix.lua | 12 + arch/lightvim/.config/lightvim/lsp/steep.lua | 14 + arch/lightvim/.config/lightvim/lsp/stimulus_ls.lua | 22 + .../.config/lightvim/lsp/stylelint_lsp.lua | 94 ++++ arch/lightvim/.config/lightvim/lsp/stylua.lua | 12 + arch/lightvim/.config/lightvim/lsp/stylua3p_ls.lua | 12 + arch/lightvim/.config/lightvim/lsp/superhtml.lua | 24 + arch/lightvim/.config/lightvim/lsp/svelte.lua | 63 +++ .../lightvim/.config/lightvim/lsp/svlangserver.lua | 43 ++ arch/lightvim/.config/lightvim/lsp/svls.lua | 17 + .../.config/lightvim/lsp/swift_mesonls.lua | 12 + arch/lightvim/.config/lightvim/lsp/syntax_tree.lua | 21 + arch/lightvim/.config/lightvim/lsp/systemd_ls.lua | 13 + arch/lightvim/.config/lightvim/lsp/systemd_lsp.lua | 20 + arch/lightvim/.config/lightvim/lsp/tabby_ml.lua | 18 + arch/lightvim/.config/lightvim/lsp/tailwindcss.lua | 150 ++++++ arch/lightvim/.config/lightvim/lsp/taplo.lua | 17 + .../.config/lightvim/lsp/tblgen_lsp_server.lua | 28 ++ arch/lightvim/.config/lightvim/lsp/tclsp.lua | 22 + arch/lightvim/.config/lightvim/lsp/teal_ls.lua | 24 + arch/lightvim/.config/lightvim/lsp/templ.lua | 12 + .../lightvim/lsp/termux_language_server.lua | 33 ++ .../.config/lightvim/lsp/terraform_lsp.lua | 36 ++ arch/lightvim/.config/lightvim/lsp/terraformls.lua | 40 ++ arch/lightvim/.config/lightvim/lsp/texlab.lua | 181 +++++++ arch/lightvim/.config/lightvim/lsp/textlsp.lua | 45 ++ arch/lightvim/.config/lightvim/lsp/tflint.lua | 13 + arch/lightvim/.config/lightvim/lsp/theme_check.lua | 24 + arch/lightvim/.config/lightvim/lsp/thriftls.lua | 12 + arch/lightvim/.config/lightvim/lsp/tilt_ls.lua | 18 + arch/lightvim/.config/lightvim/lsp/tinymist.lua | 69 +++ arch/lightvim/.config/lightvim/lsp/tofu_ls.lua | 11 + arch/lightvim/.config/lightvim/lsp/tombi.lua | 13 + arch/lightvim/.config/lightvim/lsp/ts_ls.lua | 199 ++++++++ arch/lightvim/.config/lightvim/lsp/ts_query_ls.lua | 43 ++ arch/lightvim/.config/lightvim/lsp/tsgo.lua | 105 +++++ arch/lightvim/.config/lightvim/lsp/tsp_server.lua | 17 + arch/lightvim/.config/lightvim/lsp/ttags.lua | 10 + arch/lightvim/.config/lightvim/lsp/turbo_ls.lua | 22 + arch/lightvim/.config/lightvim/lsp/turtle_ls.lua | 39 ++ .../.config/lightvim/lsp/tvm_ffi_navigator.lua | 15 + .../lightvim/lsp/twiggy_language_server.lua | 15 + arch/lightvim/.config/lightvim/lsp/ty.lua | 14 + arch/lightvim/.config/lightvim/lsp/typeprof.lua | 12 + arch/lightvim/.config/lightvim/lsp/typos_lsp.lua | 15 + arch/lightvim/.config/lightvim/lsp/typst_lsp.lua | 12 + arch/lightvim/.config/lightvim/lsp/uiua.lua | 14 + .../lightvim/lsp/ungrammar_languageserver.lua | 26 ++ arch/lightvim/.config/lightvim/lsp/unison.lua | 16 + arch/lightvim/.config/lightvim/lsp/unocss.lua | 41 ++ arch/lightvim/.config/lightvim/lsp/uvls.lua | 23 + arch/lightvim/.config/lightvim/lsp/v_analyzer.lua | 14 + arch/lightvim/.config/lightvim/lsp/vacuum.lua | 23 + arch/lightvim/.config/lightvim/lsp/vala_ls.lua | 35 ++ arch/lightvim/.config/lightvim/lsp/vale_ls.lua | 12 + .../.config/lightvim/lsp/vectorcode_server.lua | 11 + arch/lightvim/.config/lightvim/lsp/verible.lua | 17 + arch/lightvim/.config/lightvim/lsp/veridian.lua | 24 + arch/lightvim/.config/lightvim/lsp/veryl_ls.lua | 17 + arch/lightvim/.config/lightvim/lsp/vespa_ls.lua | 38 ++ arch/lightvim/.config/lightvim/lsp/vhdl_ls.lua | 38 ++ arch/lightvim/.config/lightvim/lsp/vimdoc_ls.lua | 18 + arch/lightvim/.config/lightvim/lsp/vimls.lua | 29 ++ .../.config/lightvim/lsp/visualforce_ls.lua | 31 ++ arch/lightvim/.config/lightvim/lsp/vls.lua | 14 + arch/lightvim/.config/lightvim/lsp/volar.lua | 13 + arch/lightvim/.config/lightvim/lsp/vscoqtop.lua | 13 + arch/lightvim/.config/lightvim/lsp/vsrocq.lua | 10 + arch/lightvim/.config/lightvim/lsp/vtsls.lua | 107 +++++ arch/lightvim/.config/lightvim/lsp/vue_ls.lua | 71 +++ .../.config/lightvim/lsp/wasm_language_tools.lua | 12 + .../.config/lightvim/lsp/wc_language_server.lua | 85 ++++ .../.config/lightvim/lsp/wgsl_analyzer.lua | 16 + arch/lightvim/.config/lightvim/lsp/yamlls.lua | 90 ++++ arch/lightvim/.config/lightvim/lsp/yang_lsp.lua | 12 + arch/lightvim/.config/lightvim/lsp/yls.lua | 16 + arch/lightvim/.config/lightvim/lsp/ziggy.lua | 12 + .../lightvim/.config/lightvim/lsp/ziggy_schema.lua | 12 + arch/lightvim/.config/lightvim/lsp/zizmor.lua | 40 ++ arch/lightvim/.config/lightvim/lsp/zk.lua | 116 +++++ arch/lightvim/.config/lightvim/lsp/zls.lua | 12 + arch/lightvim/.config/lightvim/lsp/zuban.lua | 19 + arch/lightvim/.config/lightvim/lua/keymaps.lua | 29 ++ arch/lightvim/.config/lightvim/lua/plugins.lua | 519 +++++++++++++++++++++ 400 files changed, 13436 insertions(+) create mode 100644 arch/fish/.config/fish/functions/vims.fish create mode 100644 arch/lightvim/.config/lightvim/init.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/ada_ls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/agda_ls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/aiken.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/air.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/alloy_ls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/anakin_language_server.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/angularls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/ansiblels.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/antlersls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/apex_ls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/arduino_language_server.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/asm_lsp.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/ast_grep.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/astro.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/atlas.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/atopile.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/autohotkey_lsp.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/autotools_ls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/awk_ls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/azure_pipelines_ls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/bacon_ls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/ballerina.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/basedpyright.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/bashls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/basics_ls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/bazelrc_lsp.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/beancount.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/bicep.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/biome.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/bitbake_language_server.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/blueprint_ls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/bqls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/bright_script.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/brioche.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/bsl_ls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/buck2.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/buddy_ls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/buf_ls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/bzl.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/c3_lsp.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/cairo_ls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/ccls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/cds_lsp.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/cir_lsp_server.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/circom-lsp.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/clangd.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/clarinet.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/clojure_lsp.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/cmake.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/cobol_ls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/codebook.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/coffeesense.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/contextive.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/copilot.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/coq_lsp.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/crystalline.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/csharp_ls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/cspell_ls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/css_variables.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/csskit.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/cssls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/cssmodules_ls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/ctags_lsp.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/cucumber_language_server.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/cue.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/custom_elements_ls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/cypher_ls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/daedalus_ls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/dafny.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/dagger.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/dartls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/dcmls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/debputy.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/denols.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/dhall_lsp_server.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/diagnosticls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/digestif.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/djls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/djlsp.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/docker_compose_language_service.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/docker_language_server.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/dockerls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/dolmenls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/dotls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/dprint.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/ds_pinyin_lsp.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/dts_lsp.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/earthlyls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/ecsact.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/efm.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/elixirls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/elmls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/elp.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/ember.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/emmet_language_server.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/emmet_ls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/emmylua_ls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/erg_language_server.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/esbonio.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/eslint.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/expert.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/facility_language_server.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/fennel_language_server.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/fennel_ls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/fish_lsp.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/flow.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/flux_lsp.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/foam_ls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/fortitude.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/fortls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/fsautocomplete.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/fsharp_language_server.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/fstar.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/futhark_lsp.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/gdscript.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/gdshader_lsp.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/gh_actions_ls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/ghcide.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/ghdl_ls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/ginko_ls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/gitlab_ci_ls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/gitlab_duo.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/glasgow.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/gleam.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/glint.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/glsl_analyzer.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/glslls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/gn_language_server.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/gnls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/golangci_lint_ls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/gopls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/gradle_ls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/grammarly.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/graphql.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/groovyls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/guile_ls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/harper_ls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/hdl_checker.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/helm_ls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/herb_ls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/hhvm.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/hie.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/hlasm.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/hls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/home_assistant.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/hoon_ls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/html.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/htmx.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/hydra_lsp.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/hylo_ls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/hyprls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/idris2_lsp.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/intelephense.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/janet_lsp.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/java_language_server.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/jdtls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/jedi_language_server.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/jinja_lsp.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/jqls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/jsonls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/jsonnet_ls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/julials.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/just.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/kakehashi.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/kcl.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/koka.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/kotlin_language_server.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/kotlin_lsp.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/kulala_ls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/laravel_ls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/lean3ls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/lelwel_ls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/lemminx.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/lexical.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/lsp_ai.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/ltex.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/ltex_plus.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/lua_ls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/luau_lsp.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/lwc_ls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/m68k.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/markdown_oxide.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/marko-js.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/marksman.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/matlab_ls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/mdx_analyzer.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/mesonlsp.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/metals.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/millet.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/mint.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/mlir_lsp_server.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/mlir_pdll_lsp_server.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/mm0_ls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/mojo.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/motoko_lsp.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/move_analyzer.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/mpls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/msbuild_project_tools_server.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/muon.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/mutt_ls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/nelua_lsp.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/neocmake.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/nextflow_ls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/nextls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/nginx_language_server.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/nickel_ls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/nil_ls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/nim_langserver.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/nimls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/nixd.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/nomad_lsp.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/ntt.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/nushell.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/nxls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/ocamllsp.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/ols.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/omnisharp.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/opencl_ls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/openscad_ls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/openscad_lsp.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/oso.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/oxfmt.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/oxlint.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/pact_ls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/pasls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/pbls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/perlls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/perlnavigator.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/perlpls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/pest_ls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/phan.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/phpactor.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/phpantom_lsp.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/phptools.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/pico8_ls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/please.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/pli.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/pony_language_server.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/pony_lsp.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/poryscript_pls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/postgres_lsp.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/powershell_es.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/prismals.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/prolog_ls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/prosemd_lsp.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/protols.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/psalm.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/pug.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/puppet.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/purescriptls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/pylsp.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/pylyzer.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/pyre.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/pyrefly.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/pyright.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/qmlls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/quick_lint_js.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/r_language_server.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/racket_langserver.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/raku_navigator.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/reason_ls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/regal.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/regols.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/remark_ls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/rescriptls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/rls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/rnix.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/robotcode.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/robotframework_ls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/roc_ls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/rome.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/roslyn_ls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/rpmspec.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/rubocop.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/ruby_lsp.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/ruff.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/ruff_lsp.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/rumdl.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/rune_languageserver.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/rust_analyzer.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/salt_ls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/scheme_langserver.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/scry.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/selene3p_ls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/serve_d.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/shopify_theme_ls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/sixtyfps.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/slangd.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/slint_lsp.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/smarty_ls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/smithy_ls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/snakeskin_ls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/snyk_ls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/solang.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/solargraph.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/solc.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/solidity.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/solidity_ls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/solidity_ls_nomicfoundation.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/somesass_ls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/sorbet.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/sourcekit.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/spade_ls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/spectral.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/spyglassmc_language_server.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/sqlls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/sqls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/sqruff.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/stan_ls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/standardrb.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/starlark_rust.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/starpls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/statix.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/steep.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/stimulus_ls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/stylelint_lsp.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/stylua.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/stylua3p_ls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/superhtml.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/svelte.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/svlangserver.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/svls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/swift_mesonls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/syntax_tree.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/systemd_ls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/systemd_lsp.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/tabby_ml.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/tailwindcss.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/taplo.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/tblgen_lsp_server.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/tclsp.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/teal_ls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/templ.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/termux_language_server.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/terraform_lsp.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/terraformls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/texlab.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/textlsp.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/tflint.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/theme_check.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/thriftls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/tilt_ls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/tinymist.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/tofu_ls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/tombi.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/ts_ls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/ts_query_ls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/tsgo.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/tsp_server.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/ttags.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/turbo_ls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/turtle_ls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/tvm_ffi_navigator.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/twiggy_language_server.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/ty.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/typeprof.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/typos_lsp.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/typst_lsp.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/uiua.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/ungrammar_languageserver.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/unison.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/unocss.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/uvls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/v_analyzer.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/vacuum.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/vala_ls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/vale_ls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/vectorcode_server.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/verible.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/veridian.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/veryl_ls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/vespa_ls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/vhdl_ls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/vimdoc_ls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/vimls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/visualforce_ls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/vls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/volar.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/vscoqtop.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/vsrocq.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/vtsls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/vue_ls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/wasm_language_tools.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/wc_language_server.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/wgsl_analyzer.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/yamlls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/yang_lsp.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/yls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/ziggy.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/ziggy_schema.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/zizmor.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/zk.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/zls.lua create mode 100644 arch/lightvim/.config/lightvim/lsp/zuban.lua create mode 100644 arch/lightvim/.config/lightvim/lua/keymaps.lua create mode 100644 arch/lightvim/.config/lightvim/lua/plugins.lua (limited to 'arch') diff --git a/arch/fish/.config/fish/conf.d/edit-configs.fish b/arch/fish/.config/fish/conf.d/edit-configs.fish index c085a41..792bc7f 100644 --- a/arch/fish/.config/fish/conf.d/edit-configs.fish +++ b/arch/fish/.config/fish/conf.d/edit-configs.fish @@ -2,6 +2,7 @@ set -l dots ~/dotfiles/arch alias envim "nvim $dots/nvim/.config/nvim/" +alias elvim "nvim $dots/lightvim/.config/lightvim/" alias etmux "nvim $dots/tmux/.config/tmux/tmux.conf" alias ehypr "nvim $dots/hyprland/.config/hypr/" alias efish "nvim $dots/fish/.config/fish/config.fish" diff --git a/arch/fish/.config/fish/fish_variables b/arch/fish/.config/fish/fish_variables index 4de5e9a..0a0f533 100644 --- a/arch/fish/.config/fish/fish_variables +++ b/arch/fish/.config/fish/fish_variables @@ -1,4 +1,5 @@ # This file contains fish universal variable definitions. # VERSION: 3.0 +SETUVAR NV_LAST_CONFIG:lightvim SETUVAR __fish_initialized:4300 SETUVAR fish_user_paths:/home/blake/\x2ecargo/bin\x1e/home/blake/\x2elocal/bin diff --git a/arch/fish/.config/fish/functions/vims.fish b/arch/fish/.config/fish/functions/vims.fish new file mode 100644 index 0000000..237b1ea --- /dev/null +++ b/arch/fish/.config/fish/functions/vims.fish @@ -0,0 +1,44 @@ +function vims --description 'Pick or launch an nvim config via NVIM_APPNAME' + set -l configs nvim lightvim + + set -l repick 0 + set -l args + for a in $argv + switch $a + case -r --repick + set repick 1 + case '*' + set -a args $a + end + end + + set -l choice + if test (count $args) -gt 0; and contains -- $args[1] $configs + set choice $args[1] + set -e args[1] + end + + if test -z "$choice"; and test $repick -eq 0; and set -q NV_LAST_CONFIG + if contains -- $NV_LAST_CONFIG $configs + set choice $NV_LAST_CONFIG + end + end + + if test -z "$choice" + set choice (printf '%s\n' $configs | fzf \ + --height=~40% --layout=reverse --border \ + --prompt='nvim config> ') + if test -z "$choice" + return 1 + end + end + + set -U NV_LAST_CONFIG $choice + + if test "$choice" = nvim + set -e NVIM_APPNAME + command nvim $args + else + NVIM_APPNAME=$choice command nvim $args + end +end diff --git a/arch/lightvim/.config/lightvim/init.lua b/arch/lightvim/.config/lightvim/init.lua new file mode 100644 index 0000000..0138cd6 --- /dev/null +++ b/arch/lightvim/.config/lightvim/init.lua @@ -0,0 +1,59 @@ +vim.g.mapleader = " " +vim.g.maplocalleader = " " + +local opt = vim.opt +opt.number = true +opt.relativenumber = true +opt.expandtab = true +opt.tabstop = 4 +opt.shiftwidth = 4 +opt.softtabstop = 4 +opt.cursorline = true +opt.scrolloff = 20 +opt.signcolumn = "yes" +opt.list = true +opt.listchars = { tab = " ", trail = "·", nbsp = "␣" } +opt.termguicolors = true +opt.swapfile = false +opt.undofile = true +opt.updatetime = 250 +opt.timeoutlen = 300 +opt.splitbelow = true +opt.splitright = true +opt.ignorecase = true +opt.smartcase = true +opt.inccommand = "split" +opt.hlsearch = true +opt.breakindent = true +opt.foldcolumn = "0" +opt.foldlevel = 99 +opt.foldlevelstart = 99 +opt.foldenable = true + +local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" +if not vim.uv.fs_stat(lazypath) then + vim.fn.system({ + "git", "clone", "--filter=blob:none", + "https://github.com/folke/lazy.nvim.git", + "--branch=stable", lazypath, + }) +end +vim.opt.rtp:prepend(lazypath) + +require("keymaps") + +require("lazy").setup(require("plugins"), { + install = { colorscheme = { "habamax" } }, + checker = { enabled = false }, + change_detection = { notify = false }, + performance = { + rtp = { + disabled_plugins = { + "gzip", "matchit", "matchparen", "netrwPlugin", + "tarPlugin", "tohtml", "tutor", "zipPlugin", + }, + }, + }, +}) + +vim.cmd.colorscheme("habamax") diff --git a/arch/lightvim/.config/lightvim/lsp/ada_ls.lua b/arch/lightvim/.config/lightvim/lsp/ada_ls.lua new file mode 100644 index 0000000..eae327a --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/ada_ls.lua @@ -0,0 +1,31 @@ +---@brief +--- +--- https://github.com/AdaCore/ada_language_server +--- +--- Installation instructions can be found [here](https://github.com/AdaCore/ada_language_server#Install). +--- +--- Workspace-specific [settings](https://github.com/AdaCore/ada_language_server/blob/master/doc/settings.md) such as `projectFile` can be provided in a `.als.json` file at the root of the workspace. +--- Alternatively, configuration may be passed as a "settings" object to `vim.lsp.config('ada_ls', {})`: +--- +--- ```lua +--- vim.lsp.config('ada_ls', { +--- settings = { +--- ada = { +--- projectFile = "project.gpr"; +--- scenarioVariables = { ... }; +--- } +--- } +--- }) +--- ``` + +local util = require 'lspconfig.util' + +---@type vim.lsp.Config +return { + cmd = { 'ada_language_server' }, + filetypes = { 'ada' }, + root_dir = function(bufnr, on_dir) + local fname = vim.api.nvim_buf_get_name(bufnr) + on_dir(util.root_pattern('Makefile', '.git', 'alire.toml', '*.gpr', '*.adc')(fname)) + end, +} diff --git a/arch/lightvim/.config/lightvim/lsp/agda_ls.lua b/arch/lightvim/.config/lightvim/lsp/agda_ls.lua new file mode 100644 index 0000000..64ca652 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/agda_ls.lua @@ -0,0 +1,17 @@ +---@brief +--- +--- https://github.com/agda/agda-language-server +--- +--- Language Server for Agda. + +local util = require 'lspconfig.util' + +---@type vim.lsp.Config +return { + cmd = { 'als' }, + filetypes = { 'agda' }, + root_dir = function(bufnr, on_dir) + local fname = vim.api.nvim_buf_get_name(bufnr) + on_dir(util.root_pattern('.git', '*.agda-lib')(fname)) + end, +} diff --git a/arch/lightvim/.config/lightvim/lsp/aiken.lua b/arch/lightvim/.config/lightvim/lsp/aiken.lua new file mode 100644 index 0000000..8fb57b2 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/aiken.lua @@ -0,0 +1,15 @@ +---@brief +--- +--- https://github.com/aiken-lang/aiken +--- +--- A language server for Aiken Programming Language. +--- [Installation](https://aiken-lang.org/installation-instructions) +--- +--- It can be i + +---@type vim.lsp.Config +return { + cmd = { 'aiken', 'lsp' }, + filetypes = { 'aiken' }, + root_markers = { 'aiken.toml', '.git' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/air.lua b/arch/lightvim/.config/lightvim/lsp/air.lua new file mode 100644 index 0000000..47dbfc1 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/air.lua @@ -0,0 +1,14 @@ +---@brief +--- +--- https://github.com/posit-dev/air +--- +--- Air is an R formatter and language server, written in Rust. +--- +--- Refer to the [documentation](https://posit-dev.github.io/air/editors.html) for more details. + +---@type vim.lsp.Config +return { + cmd = { 'air', 'language-server' }, + filetypes = { 'r' }, + root_markers = { 'air.toml', '.air.toml', '.git' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/alloy_ls.lua b/arch/lightvim/.config/lightvim/lsp/alloy_ls.lua new file mode 100644 index 0000000..9fdf6da --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/alloy_ls.lua @@ -0,0 +1,30 @@ +---@brief +--- +--- https://github.com/AlloyTools/org.alloytools.alloy +--- +--- Alloy is a formal specification language for describing structures and a tool for exploring them. +--- +--- You may also need to configure the filetype for Alloy (*.als) files: +--- +--- ``` +--- autocmd BufNewFile,BufRead *.als set filetype=alloy +--- ``` +--- +--- or +--- +--- ```lua +--- vim.filetype.add({ +--- pattern = { +--- ['.*/*.als'] = 'alloy', +--- }, +--- }) +--- ``` +--- +--- Alternatively, you may use a syntax plugin like https://github.com/runoshun/vim-alloy. + +---@type vim.lsp.Config +return { + cmd = { 'alloy', 'lsp' }, + filetypes = { 'alloy' }, + root_markers = { '.git' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/anakin_language_server.lua b/arch/lightvim/.config/lightvim/lsp/anakin_language_server.lua new file mode 100644 index 0000000..6673683 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/anakin_language_server.lua @@ -0,0 +1,71 @@ +---@brief +--- +--- https://pypi.org/project/anakin-language-server/ +--- +--- `anakin-language-server` is yet another Jedi Python language server. +--- +--- Available options: +--- +--- * Initialization: https://github.com/muffinmad/anakin-language-server#initialization-option +--- * Configuration: https://github.com/muffinmad/anakin-language-server#configuration-options + +---@type vim.lsp.Config +return { + cmd = { 'anakinls' }, + filetypes = { 'python' }, + root_markers = { + 'pyproject.toml', + 'setup.py', + 'setup.cfg', + 'requirements.txt', + 'Pipfile', + '.git', + }, + settings = { + anakinls = { + pyflakes_errors = { + -- Full list: https://github.com/PyCQA/pyflakes/blob/master/pyflakes/messages.py + + 'ImportStarNotPermitted', + + 'UndefinedExport', + 'UndefinedLocal', + 'UndefinedName', + + 'DuplicateArgument', + 'MultiValueRepeatedKeyLiteral', + 'MultiValueRepeatedKeyVariable', + + 'FutureFeatureNotDefined', + 'LateFutureImport', + + 'ReturnOutsideFunction', + 'YieldOutsideFunction', + 'ContinueOutsideLoop', + 'BreakOutsideLoop', + + 'TwoStarredExpressions', + 'TooManyExpressionsInStarredAssignment', + + 'ForwardAnnotationSyntaxError', + 'RaiseNotImplemented', + + 'StringDotFormatExtraPositionalArguments', + 'StringDotFormatExtraNamedArguments', + 'StringDotFormatMissingArgument', + 'StringDotFormatMixingAutomatic', + 'StringDotFormatInvalidFormat', + + 'PercentFormatInvalidFormat', + 'PercentFormatMixedPositionalAndNamed', + 'PercentFormatUnsupportedFormat', + 'PercentFormatPositionalCountMismatch', + 'PercentFormatExtraNamedArguments', + 'PercentFormatMissingArgument', + 'PercentFormatExpectedMapping', + 'PercentFormatExpectedSequence', + 'PercentFormatStarRequiresSequence', + }, + }, + }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/angularls.lua b/arch/lightvim/.config/lightvim/lsp/angularls.lua new file mode 100644 index 0000000..6d51cd1 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/angularls.lua @@ -0,0 +1,123 @@ +---@brief +--- +--- https://github.com/angular/vscode-ng-language-service +--- `angular-language-server` can be installed via npm `npm install -g @angular/language-server`. +--- +--- ```lua +--- local project_library_path = "/path/to/project/lib" +--- local cmd = {"ngserver", "--stdio", "--tsProbeLocations", project_library_path , "--ngProbeLocations", project_library_path} +--- +--- vim.lsp.config('angularls', { +--- cmd = cmd, +--- }) +--- ``` + +-- Angular requires a node_modules directory to probe for @angular/language-service and typescript +-- in order to use your projects configured versions. +local fs, fn, uv = vim.fs, vim.fn, vim.uv + +--- Recursively solve for the original ngserver path on Windows +-- For a given ngserver path: +-- - If it is not a CMD wrapper, return the path; +-- - Or else, extract the path from the CMD wrapper. +-- +-- @param cmd_path (string) path for the ngserver executable or its CMD wrapper. +-- @return (string) the original executable path for ngserver +-- @usage +-- -- Base case: cmd_path already points to ngserver (expected behavior on Linux) +-- resolve_cmd_shim('/home/user/project/node_modules/@angular/language-server/bin/ngserver') +-- => '/home/user/project/node_modules/@angular/language-server/bin/ngserver' +-- +-- -- Recursive case: cmd_path points to a CMD wrapper (Windows) +-- resolve_cmd_shim('C:/Users/user/project/node_modules/.bin/ngserver.cmd') +-- => 'C:/Users/user/project/node_modules/@angular/language-server/bin/ngserver' +local function resolve_cmd_shim(cmd_path) + if not cmd_path:lower():match('%ngserver.cmd$') then + return cmd_path + end + + local ok, content = pcall(fn.readblob, cmd_path) + if not ok or not content then + return cmd_path + end + + local target = content:match('%s%"%%dp0%%\\([^\r\n]-ngserver[^\r\n]-)%"') + if not target then + return cmd_path + end + + local full = fs.normalize(fs.joinpath(fs.dirname(cmd_path), target)) + + return resolve_cmd_shim(full) +end + +local function collect_node_modules(root_dir) + local results = {} + + local project_node = fs.joinpath(root_dir, 'node_modules') + if uv.fs_stat(project_node) then + table.insert(results, project_node) + end + + local ngserver_exe = fn.exepath('ngserver') + if ngserver_exe and #ngserver_exe > 0 then + local realpath = uv.fs_realpath(ngserver_exe) or ngserver_exe + realpath = resolve_cmd_shim(realpath) + local candidate = fs.normalize(fs.joinpath(fs.dirname(realpath), '../../..')) + if uv.fs_stat(candidate) then + table.insert(results, candidate) + end + end + + return results +end + +local function get_angular_core_version(root_dir) + local package_json = fs.joinpath(root_dir, 'package.json') + if not uv.fs_stat(package_json) then + return '' + end + + local ok, content = pcall(fn.readblob, package_json) + if not ok or not content then + return '' + end + + local json = vim.json.decode(content) or {} + + local version = (json.dependencies or {})['@angular/core'] or (json.devDependencies or {})['@angular/core'] or '' + return version:match('%d+%.%d+%.%d+') or '' +end + +---@type vim.lsp.Config +return { + cmd = function(dispatchers, config) + local root_dir = (config and config.root_dir) or fn.getcwd() + local node_paths = collect_node_modules(root_dir) + + local ts_probe = table.concat(node_paths, ',') + local ng_probe = table.concat( + vim + .iter(node_paths) + :map(function(p) + return fs.joinpath(p, '@angular/language-server/node_modules') + end) + :totable(), + ',' + ) + local cmd = { + 'ngserver', + '--stdio', + '--tsProbeLocations', + ts_probe, + '--ngProbeLocations', + ng_probe, + '--angularCoreVersion', + get_angular_core_version(root_dir), + } + return vim.lsp.rpc.start(cmd, dispatchers) + end, + + filetypes = { 'typescript', 'html', 'typescriptreact', 'htmlangular' }, + root_markers = { 'angular.json', 'nx.json' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/ansiblels.lua b/arch/lightvim/.config/lightvim/lsp/ansiblels.lua new file mode 100644 index 0000000..db292c3 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/ansiblels.lua @@ -0,0 +1,38 @@ +---@brief +--- +--- https://github.com/ansible/vscode-ansible +--- +--- Language server for the ansible configuration management tool. +--- +--- `ansible-language-server` can be installed via `npm`: +--- +--- ```sh +--- npm install -g @ansible/ansible-language-server +--- ``` + +---@type vim.lsp.Config +return { + cmd = { 'ansible-language-server', '--stdio' }, + settings = { + ansible = { + python = { + interpreterPath = 'python', + }, + ansible = { + path = 'ansible', + }, + executionEnvironment = { + enabled = false, + }, + validation = { + enabled = true, + lint = { + enabled = true, + path = 'ansible-lint', + }, + }, + }, + }, + filetypes = { 'yaml.ansible' }, + root_markers = { 'ansible.cfg', '.ansible-lint' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/antlersls.lua b/arch/lightvim/.config/lightvim/lsp/antlersls.lua new file mode 100644 index 0000000..28777bf --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/antlersls.lua @@ -0,0 +1,15 @@ +---@brief +--- +--- https://www.npmjs.com/package/antlers-language-server +--- +--- `antlersls` can be installed via `npm`: +--- ```sh +--- npm install -g antlers-language-server +--- ``` + +---@type vim.lsp.Config +return { + cmd = { 'antlersls', '--stdio' }, + filetypes = { 'html', 'antlers' }, + root_markers = { 'composer.json' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/apex_ls.lua b/arch/lightvim/.config/lightvim/lsp/apex_ls.lua new file mode 100644 index 0000000..7052c19 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/apex_ls.lua @@ -0,0 +1,61 @@ +--- @brief +--- +--- https://github.com/forcedotcom/salesforcedx-vscode +--- +--- Language server for Apex. +--- +--- For manual installation, download the JAR file from the [VSCode +--- extension](https://github.com/forcedotcom/salesforcedx-vscode/tree/develop/packages/salesforcedx-vscode-apex) and adjust the `apex_jar_path` appropriately. +--- +--- ```lua +--- vim.lsp.config('apex_ls', { +--- apex_jar_path = '/path/to/apex-jorje-lsp.jar', +--- apex_enable_semantic_errors = false, -- Whether to allow Apex Language Server to surface semantic errors +--- apex_enable_completion_statistics = false, -- Whether to allow Apex Language Server to collect telemetry on code completion usage +--- } +---``` +--- +--- Example configuration using Mason: +--- +---```lua +--- vim.lsp.config('apex_ls', { +--- apex_jar_path = vim.fn.stdpath('data') .. '/mason/share/apex-language-server/apex-jorje-lsp.jar', +--- } +---``` +--- +--- For a complete experience, you may need to ensure the treesitter parsers for 'apex' are installed (:TSInstall apex) as well as configure the filetype for apex (*.cls) files: +--- +--- ```lua +--- vim.filetype.add({ +--- pattern = { +--- ['.*/*.cls'] = 'apex', +--- }, +--- }) +--- ``` + +---@type vim.lsp.Config +return { + cmd = function(dispatchers, config) + ---@diagnostic disable: undefined-field + local local_cmd = { + vim.env.JAVA_HOME and (vim.env.JAVA_HOME .. '/bin/java') or 'java', + '-cp', + config.apex_jar_path, + '-Ddebug.internal.errors=true', + '-Ddebug.semantic.errors=' .. tostring(config.apex_enable_semantic_errors or false), + '-Ddebug.completion.statistics=' .. tostring(config.apex_enable_completion_statistics or false), + '-Dlwc.typegeneration.disabled=true', + } + if config.apex_jvm_max_heap then + table.insert(local_cmd, '-Xmx' .. config.apex_jvm_max_heap) + end + ---@diagnostic enable: undefined-field + table.insert(local_cmd, 'apex.jorje.lsp.ApexLanguageServerLauncher') + + return vim.lsp.rpc.start(local_cmd, dispatchers) + end, + filetypes = { 'apex', 'apexcode' }, + root_markers = { + 'sfdx-project.json', + }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/arduino_language_server.lua b/arch/lightvim/.config/lightvim/lsp/arduino_language_server.lua new file mode 100644 index 0000000..769a917 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/arduino_language_server.lua @@ -0,0 +1,93 @@ +---@brief +--- +--- https://github.com/arduino/arduino-language-server +--- +--- Language server for Arduino +--- +--- The `arduino-language-server` can be installed by running: +--- +--- ``` +--- go install github.com/arduino/arduino-language-server@latest +--- ``` +--- +--- The `arduino-cli` tool must also be installed. Follow [these +--- installation instructions](https://arduino.github.io/arduino-cli/latest/installation/) for +--- your platform. +--- +--- After installing `arduino-cli`, follow [these +--- instructions](https://arduino.github.io/arduino-cli/latest/getting-started/#create-a-configuration-file) +--- for generating a configuration file if you haven't done so already, and make +--- sure you [install any relevant platforms +--- libraries](https://arduino.github.io/arduino-cli/latest/getting-started/#install-the-core-for-your-board). +--- +--- The language server also requires `clangd` to be installed. Follow [these +--- installation instructions](https://clangd.llvm.org/installation) for your +--- platform. +--- +--- If you don't have a sketch yet create one. +--- +--- ```sh +--- $ arduino-cli sketch new test +--- $ cd test +--- ``` +--- +--- You will need a `sketch.yaml` file in order for the language server to understand your project. It will also save you passing options to `arduino-cli` each time you compile or upload a file. You can generate the file by using the following commands. +--- +--- +--- First gather some information about your board. Make sure your board is connected and run the following: +--- +--- ```sh +--- $ arduino-cli board list +--- Port Protocol Type Board Name FQBN Core +--- /dev/ttyACM0 serial Serial Port (USB) Arduino Uno arduino:avr:uno arduino:avr +--- ``` +--- +--- Then generate the file: +--- +--- ```sh +--- arduino-cli board attach -p /dev/ttyACM0 -b arduino:avr:uno test.ino +--- ``` +--- +--- The resulting file should look like this: +--- +--- ```yaml +--- default_fqbn: arduino:avr:uno +--- default_port: /dev/ttyACM0 +--- ``` +--- +--- Your folder structure should look like this: +--- +--- ``` +--- . +--- ├── test.ino +--- └── sketch.yaml +--- ``` +--- +--- For further instructions about configuration options, run `arduino-language-server --help`. +--- +--- Note that an upstream bug makes keywords in some cases become undefined by the language server. +--- Ref: https://github.com/arduino/arduino-ide/issues/159 + +local util = require 'lspconfig.util' + +---@type vim.lsp.Config +return { + filetypes = { 'arduino' }, + root_dir = function(bufnr, on_dir) + local fname = vim.api.nvim_buf_get_name(bufnr) + on_dir(util.root_pattern('*.ino')(fname)) + end, + cmd = { + 'arduino-language-server', + }, + capabilities = { + textDocument = { + ---@diagnostic disable-next-line: assign-type-mismatch + semanticTokens = vim.NIL, + }, + workspace = { + ---@diagnostic disable-next-line: assign-type-mismatch + semanticTokens = vim.NIL, + }, + }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/asm_lsp.lua b/arch/lightvim/.config/lightvim/lsp/asm_lsp.lua new file mode 100644 index 0000000..28678c0 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/asm_lsp.lua @@ -0,0 +1,15 @@ +---@brief +--- +--- https://github.com/bergercookie/asm-lsp +--- +--- Language Server for NASM/GAS/GO Assembly +--- +--- `asm-lsp` can be installed via cargo: +--- cargo install asm-lsp + +---@type vim.lsp.Config +return { + cmd = { 'asm-lsp' }, + filetypes = { 'asm', 'vmasm' }, + root_markers = { '.asm-lsp.toml', '.git' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/ast_grep.lua b/arch/lightvim/.config/lightvim/lsp/ast_grep.lua new file mode 100644 index 0000000..d6f0ecf --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/ast_grep.lua @@ -0,0 +1,48 @@ +---@brief +--- +--- https://ast-grep.github.io/ +--- +--- ast-grep(sg) is a fast and polyglot tool for code structural search, lint, rewriting at large scale. +--- ast-grep LSP only works in projects that have `sgconfig.y[a]ml` in their root directories. +--- ```sh +--- npm install [-g] @ast-grep/cli +--- ``` + +---@type vim.lsp.Config +return { + cmd = { 'ast-grep', 'lsp' }, + workspace_required = true, + reuse_client = function(client, config) + config.cmd_cwd = config.root_dir + return client.name == config.name and client.config.cmd_cwd == config.cmd_cwd + end, + filetypes = { -- https://ast-grep.github.io/reference/languages.html + 'bash', + 'c', + 'cpp', + 'cs', + 'css', + 'elixir', + 'go', + 'haskell', + 'html', + 'java', + 'javascript', + 'javascriptreact', + 'json', + 'kotlin', + 'lua', + 'nix', + 'php', + 'python', + 'ruby', + 'rust', + 'scala', + 'solidity', + 'swift', + 'typescript', + 'typescriptreact', + 'yaml', + }, + root_markers = { 'sgconfig.yaml', 'sgconfig.yml' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/astro.lua b/arch/lightvim/.config/lightvim/lsp/astro.lua new file mode 100644 index 0000000..efb164a --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/astro.lua @@ -0,0 +1,70 @@ +---@brief +--- +--- https://github.com/withastro/language-tools/tree/main/packages/language-server +--- +--- `astro-ls` can be installed via `npm`: +--- ```sh +--- npm install -g @astrojs/language-server +--- ``` +--- +--- If typescript is installed globally, you might get the `\`typescript.tsdk\` init option is required` error. +--- You will need to manually pass the typescript SDK path. Here is an example of a Nix configuration where typescript is installed via Nix's Home-manager: +--- +--- ```nix +--- { config, pkgs, ... }: +--- +--- { +--- home.packages = with pkgs; [ +--- typescript +--- ]; +--- +--- programs.neovim = { +--- plugins = with pkgs.vimPlugins; [ +--- nvim-lspconfig +--- ]; +--- extraPackages = with pkgs; [ +--- astro-language-server +--- ]; +--- initLua = '' +--- vim.lsp.config['astro'] = { +--- init_options = { +--- typescript = { +--- tsdk = ${pkgs.typescript}/lib/node_modules/typescript/lib, +--- }, +--- }, +--- } +--- +--- vim.lsp.enable('astro') +--- +--- -- ... +--- ''; +--- }; +--- } +--- ``` +--- The path can also be passed via a variable, like `vim.g.tsdk = "${pkgs.typescript}/lib/node_modules/typescript/lib"` and then used in the Lua Neovim config. + +local util = require 'lspconfig.util' + +---@type vim.lsp.Config +return { + cmd = function(dispatchers, config) + local cmd = 'astro-ls' + if (config or {}).root_dir then + local local_cmd = vim.fs.joinpath(config.root_dir, 'node_modules/.bin', cmd) + if vim.fn.executable(local_cmd) == 1 then + cmd = local_cmd + end + end + return vim.lsp.rpc.start({ cmd, '--stdio' }, dispatchers) + end, + filetypes = { 'astro' }, + root_markers = { 'package.json', 'tsconfig.json', 'jsconfig.json', '.git' }, + init_options = { + typescript = {}, + }, + before_init = function(_, config) + if config.init_options and config.init_options.typescript and not config.init_options.typescript.tsdk then + config.init_options.typescript.tsdk = util.get_typescript_server_path(config.root_dir) + end + end, +} diff --git a/arch/lightvim/.config/lightvim/lsp/atlas.lua b/arch/lightvim/.config/lightvim/lsp/atlas.lua new file mode 100644 index 0000000..e54dbea --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/atlas.lua @@ -0,0 +1,66 @@ +---@brief +--- +--- https://github.com/ariga/atlas +--- +--- Language server for Atlas config and schema files. +--- +--- You may also need to configure the filetype for *.hcl files: +--- +--- ```vim +--- autocmd BufNewFile,BufRead atlas.hcl set filetype=atlas-config +--- autocmd BufNewFile,BufRead *.my.hcl set filetype=atlas-schema-mysql +--- autocmd BufNewFile,BufRead *.pg.hcl set filetype=atlas-schema-postgresql +--- autocmd BufNewFile,BufRead *.lt.hcl set filetype=atlas-schema-sqlite +--- autocmd BufNewFile,BufRead *.ch.hcl set filetype=atlas-schema-clickhouse +--- autocmd BufNewFile,BufRead *.ms.hcl set filetype=atlas-schema-mssql +--- autocmd BufNewFile,BufRead *.rs.hcl set filetype=atlas-schema-redshift +--- autocmd BufNewFile,BufRead *.test.hcl set filetype=atlas-test +--- autocmd BufNewFile,BufRead *.plan.hcl set filetype=atlas-plan +--- autocmd BufNewFile,BufRead *.rule.hcl set filetype=atlas-rule +--- ``` +--- +--- or +--- +--- ```lua +--- vim.filetype.add({ +--- filename = { +--- ['atlas.hcl'] = 'atlas-config', +--- }, +--- pattern = { +--- ['.*/*.my.hcl'] = 'atlas-schema-mysql', +--- ['.*/*.pg.hcl'] = 'atlas-schema-postgresql', +--- ['.*/*.lt.hcl'] = 'atlas-schema-sqlite', +--- ['.*/*.ch.hcl'] = 'atlas-schema-clickhouse', +--- ['.*/*.ms.hcl'] = 'atlas-schema-mssql', +--- ['.*/*.rs.hcl'] = 'atlas-schema-redshift', +--- ['.*/*.test.hcl'] = 'atlas-test', +--- ['.*/*.plan.hcl'] = 'atlas-plan', +--- ['.*/*.rule.hcl'] = 'atlas-rule', +--- }, +--- }) +--- ``` +--- +--- Optionally, tell treesitter to treat Atlas filetypes as HCL for better syntax highlighting: +--- +--- ```lua +--- vim.treesitter.language.register('hcl', 'atlas-config') +--- vim.treesitter.language.register('hcl', 'atlas-schema-mysql') +--- vim.treesitter.language.register('hcl', 'atlas-schema-postgresql') +--- vim.treesitter.language.register('hcl', 'atlas-schema-sqlite') +--- vim.treesitter.language.register('hcl', 'atlas-schema-clickhouse') +--- vim.treesitter.language.register('hcl', 'atlas-schema-mssql') +--- vim.treesitter.language.register('hcl', 'atlas-schema-redshift') +--- vim.treesitter.language.register('hcl', 'atlas-test') +--- vim.treesitter.language.register('hcl', 'atlas-plan') +--- vim.treesitter.language.register('hcl', 'atlas-rule') +--- ``` +--- + +---@type vim.lsp.Config +return { + cmd = { 'atlas', 'tool', 'lsp', '--stdio' }, + filetypes = { + 'atlas-*', + }, + root_markers = { 'atlas.hcl' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/atopile.lua b/arch/lightvim/.config/lightvim/lsp/atopile.lua new file mode 100644 index 0000000..6548b7e --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/atopile.lua @@ -0,0 +1,14 @@ +---@brief +--- +--- https://atopile.io/ +--- +--- A language server for atopile Programming Language. +--- +--- It comes with the atopile compiler, for installation see: [Installing atopile](https://docs.atopile.io/atopile/guides/install) + +---@type vim.lsp.Config +return { + cmd = { 'ato', 'lsp', 'start' }, + filetypes = { 'ato' }, + root_markers = { 'ato.yaml', '.ato', '.git' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/autohotkey_lsp.lua b/arch/lightvim/.config/lightvim/lsp/autohotkey_lsp.lua new file mode 100644 index 0000000..fe11d15 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/autohotkey_lsp.lua @@ -0,0 +1,52 @@ +---@brief +--- +--- https://github.com/thqby/vscode-autohotkey2-lsp +--- +--- AutoHotkey v2.0 LSP implementation +--- +--- NOTE: AutoHotkey is Windows-only. + +local function get_autohotkey_path() + local path = vim.fn.exepath('autohotkey.exe') + return #path > 0 and path or '' +end + +---@type vim.lsp.Config +return { + cmd = { 'autohotkey_lsp', '--stdio' }, + filetypes = { 'autohotkey' }, + root_markers = { 'package.json' }, + ---@diagnostic disable-next-line: missing-fields + flags = { debounce_text_changes = 500 }, + --capabilities = capabilities, + --on_attach = custom_attach, + init_options = { + locale = 'en-us', + InterpreterPath = get_autohotkey_path(), + AutoLibInclude = 'All', + CommentTags = '^;;\\s*(?.+)', + CompleteFunctionParens = false, + SymbolFoldinFromOpenBrace = false, + Diagnostics = { + ClassStaticMemberCheck = true, + ParamsCheck = true, + }, + ActionWhenV1IsDetected = 'Continue', + FormatOptions = { + array_style = 'expand', + break_chained_methods = false, + ignore_comment = false, + indent_string = '\t', + max_preserve_newlines = 2, + brace_style = 'One True Brace', + object_style = 'none', + preserve_newlines = true, + space_after_double_colon = true, + space_before_conditional = true, + space_in_empty_paren = false, + space_in_other = true, + space_in_paren = false, + wrap_line_length = 0, + }, + }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/autotools_ls.lua b/arch/lightvim/.config/lightvim/lsp/autotools_ls.lua new file mode 100644 index 0000000..721c24c --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/autotools_ls.lua @@ -0,0 +1,24 @@ +---@brief +--- +--- https://github.com/Freed-Wu/autotools-language-server +--- +--- `autotools-language-server` can be installed via `pip`: +--- ```sh +--- pip install autotools-language-server +--- ``` +--- +--- Language server for autoconf, automake and make using tree sitter in python. + +local util = require 'lspconfig.util' + +local root_files = { 'configure.ac', 'Makefile', 'Makefile.am', '*.mk' } + +---@type vim.lsp.Config +return { + cmd = { 'autotools-language-server' }, + filetypes = { 'config', 'automake', 'make' }, + root_dir = function(bufnr, on_dir) + local fname = vim.api.nvim_buf_get_name(bufnr) + on_dir(util.root_pattern(unpack(root_files))(fname)) + end, +} diff --git a/arch/lightvim/.config/lightvim/lsp/awk_ls.lua b/arch/lightvim/.config/lightvim/lsp/awk_ls.lua new file mode 100644 index 0000000..7932913 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/awk_ls.lua @@ -0,0 +1,14 @@ +---@brief +--- +--- https://github.com/Beaglefoot/awk-language-server/ +--- +--- `awk-language-server` can be installed via `npm`: +--- ```sh +--- npm install -g awk-language-server +--- ``` + +---@type vim.lsp.Config +return { + cmd = { 'awk-language-server' }, + filetypes = { 'awk' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/azure_pipelines_ls.lua b/arch/lightvim/.config/lightvim/lsp/azure_pipelines_ls.lua new file mode 100644 index 0000000..2313ca4 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/azure_pipelines_ls.lua @@ -0,0 +1,39 @@ +---@brief +--- +--- https://github.com/microsoft/azure-pipelines-language-server +--- +--- An Azure Pipelines language server +--- +--- `azure-pipelines-ls` can be installed via `npm`: +--- +--- ```sh +--- npm install -g azure-pipelines-language-server +--- ``` +--- +--- By default `azure-pipelines-ls` will only work in files named `azure-pipelines.yml`, this can be changed by providing additional settings like so: +--- ```lua +--- vim.lsp.config('azure_pipelines_ls', { +--- ... -- other configuration +--- settings = { +--- yaml = { +--- schemas = { +--- ["https://raw.githubusercontent.com/microsoft/azure-pipelines-vscode/master/service-schema.json"] = { +--- "/azure-pipeline*.y*l", +--- "/*.azure*", +--- "Azure-Pipelines/**/*.y*l", +--- "Pipelines/*.y*l", +--- }, +--- }, +--- }, +--- }, +--- }) +--- ``` +--- The Azure Pipelines LSP is a fork of `yaml-language-server` and as such the same settings can be passed to it as `yaml-language-server`. + +---@type vim.lsp.Config +return { + cmd = { 'azure-pipelines-language-server', '--stdio' }, + filetypes = { 'yaml' }, + root_markers = { 'azure-pipelines.yml' }, + settings = {}, +} diff --git a/arch/lightvim/.config/lightvim/lsp/bacon_ls.lua b/arch/lightvim/.config/lightvim/lsp/bacon_ls.lua new file mode 100644 index 0000000..44c5697 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/bacon_ls.lua @@ -0,0 +1,47 @@ +---@brief +--- +--- https://github.com/crisidev/bacon-ls +--- +--- A Language Server Protocol wrapper for [bacon](https://dystroy.org/bacon/). +--- It offers textDocument/diagnostic and workspace/diagnostic capabilities for Rust +--- workspaces using the Bacon export locations file. +--- +--- It requires `bacon` and `bacon-ls` to be installed on the system using +--- [mason.nvim](https://github.com/williamboman/mason.nvim) or manually +--- +--- ```sh +--- $ cargo install --locked bacon bacon-ls +--- ``` +--- +--- Settings can be changed using the `init_options` dictionary:util +--- +--- ```lua +--- init_options = { +--- -- Bacon export filename (default: .bacon-locations). +--- locationsFile = ".bacon-locations", +--- -- Try to update diagnostics every time the file is saved (default: true). +--- updateOnSave = true, +--- -- How many milliseconds to wait before updating diagnostics after a save (default: 1000). +--- updateOnSaveWaitMillis = 1000, +--- -- Try to update diagnostics every time the file changes (default: true). +--- updateOnChange = true, +--- -- Try to validate that bacon preferences are setup correctly to work with bacon-ls (default: true). +--- validateBaconPreferences = true, +--- -- f no bacon preferences file is found, create a new preferences file with the bacon-ls job definition (default: true). +--- createBaconPreferencesFile = true, +--- -- Run bacon in background for the bacon-ls job (default: true) +--- runBaconInBackground = true, +--- -- Command line arguments to pass to bacon running in background (default "--headless -j bacon-ls") +--- runBaconInBackgroundCommandArguments = "--headless -j bacon-ls", +--- -- How many milliseconds to wait between background diagnostics check to synchronize all open files (default: 2000). +--- synchronizeAllOpenFilesWaitMillis = 2000, +--- } +--- ``` + +---@type vim.lsp.Config +return { + cmd = { 'bacon-ls' }, + filetypes = { 'rust' }, + root_markers = { '.bacon-locations', 'Cargo.toml' }, + init_options = {}, +} diff --git a/arch/lightvim/.config/lightvim/lsp/ballerina.lua b/arch/lightvim/.config/lightvim/lsp/ballerina.lua new file mode 100644 index 0000000..dbe8a7e --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/ballerina.lua @@ -0,0 +1,13 @@ +---@brief +--- +--- Ballerina language server +--- +--- The Ballerina language's CLI tool comes with its own language server implementation. +--- The `bal` command line tool must be installed and available in your system's PATH. + +---@type vim.lsp.Config +return { + cmd = { 'bal', 'start-language-server' }, + filetypes = { 'ballerina' }, + root_markers = { 'Ballerina.toml' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/basedpyright.lua b/arch/lightvim/.config/lightvim/lsp/basedpyright.lua new file mode 100644 index 0000000..c0a99a2 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/basedpyright.lua @@ -0,0 +1,72 @@ +---@brief +--- +--- https://detachhead.github.io/basedpyright +--- +--- `basedpyright`, a static type checker and language server for python + +local function set_python_path(command) + local path = command.args + local clients = vim.lsp.get_clients { + bufnr = vim.api.nvim_get_current_buf(), + name = 'basedpyright', + } + for _, client in ipairs(clients) do + if client.settings then + ---@diagnostic disable-next-line: param-type-mismatch + client.settings.python = vim.tbl_deep_extend('force', client.settings.python or {}, { pythonPath = path }) + else + client.config.settings = vim.tbl_deep_extend('force', client.config.settings, { python = { pythonPath = path } }) + end + client:notify('workspace/didChangeConfiguration', { settings = nil }) + end +end + +---@type vim.lsp.Config +return { + cmd = { 'basedpyright-langserver', '--stdio' }, + filetypes = { 'python' }, + root_markers = { + 'pyrightconfig.json', + 'pyproject.toml', + 'setup.py', + 'setup.cfg', + 'requirements.txt', + 'Pipfile', + '.git', + }, + ---@type lspconfig.settings.basedpyright + settings = { + basedpyright = { + analysis = { + autoSearchPaths = true, + diagnosticMode = 'openFilesOnly', + -- https://docs.basedpyright.com/latest/configuration/language-server-settings/ + -- Explicitly setting `basedpyright.analysis.useLibraryCodeForTypes` is **discouraged** by the official docs. + -- Because it will override per-project configurations like `pyproject.toml`. + -- If left unset, its default value is `true`, and it can be correctly overridden by project config files. + }, + }, + }, + on_attach = function(client, bufnr) + vim.api.nvim_buf_create_user_command(bufnr, 'LspPyrightOrganizeImports', function() + local params = { + command = 'basedpyright.organizeimports', + arguments = { vim.uri_from_bufnr(bufnr) }, + } + + -- Using client.request() directly because "basedpyright.organizeimports" is private + -- (not advertised via capabilities), which client:exec_cmd() refuses to call. + -- https://github.com/neovim/neovim/blob/c333d64663d3b6e0dd9aa440e433d346af4a3d81/runtime/lua/vim/lsp/client.lua#L1024-L1030 + ---@diagnostic disable-next-line: param-type-mismatch + client.request('workspace/executeCommand', params, nil, bufnr) + end, { + desc = 'Organize Imports', + }) + + vim.api.nvim_buf_create_user_command(bufnr, 'LspPyrightSetPythonPath', set_python_path, { + desc = 'Reconfigure basedpyright with the provided python path', + nargs = 1, + complete = 'file', + }) + end, +} diff --git a/arch/lightvim/.config/lightvim/lsp/bashls.lua b/arch/lightvim/.config/lightvim/lsp/bashls.lua new file mode 100644 index 0000000..e3f6f37 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/bashls.lua @@ -0,0 +1,30 @@ +---@brief +--- +--- https://github.com/bash-lsp/bash-language-server +--- +--- `bash-language-server` can be installed via `npm`: +--- ```sh +--- npm i -g bash-language-server +--- ``` +--- +--- Language server for bash, written using tree sitter in typescript. + +---@type vim.lsp.Config +return { + cmd = { 'bash-language-server', 'start' }, + ---@type lspconfig.settings.bashls + settings = { + bashIde = { + -- Glob pattern for finding and parsing shell script files in the workspace. + -- Used by the background analysis features across files. + + -- Prevent recursive scanning which will cause issues when opening a file + -- directly in the home directory (e.g. ~/foo.sh). + -- + -- Default upstream pattern is "**/*@(.sh|.inc|.bash|.command)". + globPattern = vim.env.GLOB_PATTERN or '*@(.sh|.inc|.bash|.command)', + }, + }, + filetypes = { 'bash', 'sh' }, + root_markers = { '.git' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/basics_ls.lua b/arch/lightvim/.config/lightvim/lsp/basics_ls.lua new file mode 100644 index 0000000..1810a92 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/basics_ls.lua @@ -0,0 +1,27 @@ +---@brief +--- +--- https://github.com/antonk52/basics-language-server/ +--- +--- Buffer, path, and snippet completion +--- +--- ```sh +--- npm install -g basics-language-server +--- ``` + +---@type vim.lsp.Config +return { + cmd = { 'basics-language-server' }, + settings = { + buffer = { + enable = true, + minCompletionLength = 4, + }, + path = { + enable = true, + }, + snippet = { + enable = false, + sources = {}, + }, + }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/bazelrc_lsp.lua b/arch/lightvim/.config/lightvim/lsp/bazelrc_lsp.lua new file mode 100644 index 0000000..6e6b89f --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/bazelrc_lsp.lua @@ -0,0 +1,22 @@ +---@brief +--- +--- https://github.com/salesforce-misc/bazelrc-lsp +--- +--- `bazelrc-lsp` is a LSP for `.bazelrc` configuration files. +--- +--- The `.bazelrc` file type is not detected automatically, you can register it manually (see below) or override the filetypes: +--- +--- ```lua +--- vim.filetype.add { +--- pattern = { +--- ['.*.bazelrc'] = 'bazelrc', +--- }, +--- } +--- ``` + +---@type vim.lsp.Config +return { + cmd = { 'bazelrc-lsp', 'lsp' }, + filetypes = { 'bazelrc' }, + root_markers = { 'WORKSPACE', 'WORKSPACE.bazel', 'MODULE.bazel' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/beancount.lua b/arch/lightvim/.config/lightvim/lsp/beancount.lua new file mode 100644 index 0000000..bb53a76 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/beancount.lua @@ -0,0 +1,13 @@ +---@brief +--- +--- https://github.com/polarmutex/beancount-language-server#installation +--- +--- See https://github.com/polarmutex/beancount-language-server#configuration for configuration options + +---@type vim.lsp.Config +return { + cmd = { 'beancount-language-server', '--stdio' }, + filetypes = { 'beancount', 'bean' }, + root_markers = { '.git' }, + init_options = {}, +} diff --git a/arch/lightvim/.config/lightvim/lsp/bicep.lua b/arch/lightvim/.config/lightvim/lsp/bicep.lua new file mode 100644 index 0000000..4e6e215 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/bicep.lua @@ -0,0 +1,40 @@ +---@brief +--- +--- https://github.com/azure/bicep +--- Bicep language server +--- +--- Bicep language server can be installed by downloading and extracting a release of bicep-langserver.zip from [Bicep GitHub releases](https://github.com/Azure/bicep/releases). +--- +--- Bicep language server requires the [dotnet-sdk](https://dotnet.microsoft.com/download) to be installed. +--- +--- Neovim does not have built-in support for the bicep filetype which is required for lspconfig to automatically launch the language server. +--- +--- Filetype detection can be added via an autocmd: +--- ```lua +--- vim.cmd [[ autocmd BufNewFile,BufRead *.bicep set filetype=bicep ]] +--- ``` +--- +--- **By default, bicep language server does not have a `cmd` set.** This is because nvim-lspconfig does not make assumptions about your path. You must add the following to your init.vim or init.lua to set `cmd` to the absolute path ($HOME and ~ are not expanded) of the unzipped run script or binary. +--- +--- ```lua +--- local bicep_lsp_bin = "/path/to/bicep-langserver/Bicep.LangServer.dll" +--- vim.lsp.config('bicep', { +--- cmd = { "dotnet", bicep_lsp_bin }; +--- ... +--- }) +--- ``` +--- +--- To download the latest release and place in /usr/local/bin/bicep-langserver: +--- ```bash +--- (cd $(mktemp -d) \ +--- && curl -fLO https://github.com/Azure/bicep/releases/latest/download/bicep-langserver.zip \ +--- && rm -rf /usr/local/bin/bicep-langserver \ +--- && unzip -d /usr/local/bin/bicep-langserver bicep-langserver.zip) +--- ``` + +---@type vim.lsp.Config +return { + filetypes = { 'bicep', 'bicep-params' }, + root_markers = { '.git' }, + init_options = {}, +} diff --git a/arch/lightvim/.config/lightvim/lsp/biome.lua b/arch/lightvim/.config/lightvim/lsp/biome.lua new file mode 100644 index 0000000..89735af --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/biome.lua @@ -0,0 +1,82 @@ +---@brief +--- https://biomejs.dev +--- +--- Toolchain of the web. [Successor of Rome](https://biomejs.dev/blog/annoucing-biome). +--- +--- ```sh +--- npm install [-g] @biomejs/biome +--- ``` +--- +--- ### Monorepo support +--- +--- `biome` supports monorepos by default. It will automatically find the `biome.json` corresponding to the package you are working on, as described in the [documentation](https://biomejs.dev/guides/big-projects/#monorepo). This works without the need of spawning multiple instances of `biome`, saving memory. + +local util = require 'lspconfig.util' + +---@type vim.lsp.Config +return { + cmd = function(dispatchers, config) + local cmd = 'biome' + if (config or {}).root_dir then + local local_cmd = vim.fs.joinpath(config.root_dir, 'node_modules/.bin', cmd) + if vim.fn.executable(local_cmd) == 1 then + cmd = local_cmd + end + end + return vim.lsp.rpc.start({ cmd, 'lsp-proxy' }, dispatchers) + end, + filetypes = { + 'astro', + 'css', + 'graphql', + 'html', + 'javascript', + 'javascriptreact', + 'json', + 'jsonc', + 'svelte', + 'typescript', + 'typescriptreact', + 'vue', + }, + workspace_required = true, + root_dir = function(bufnr, on_dir) + -- The project root is where the LSP can be started from + -- As stated in the documentation above, this LSP supports monorepos and simple projects. + -- We select then from the project root, which is identified by the presence of a package + -- manager lock file. + local root_markers = { + 'package-lock.json', + 'yarn.lock', + 'pnpm-lock.yaml', + 'bun.lockb', + 'bun.lock', + 'deno.lock', + } + -- Set a lower priority to avoid spawning multiple servers on monorepos + local biome_config_files = { 'biome.json', 'biome.jsonc' } + -- Give the root markers equal priority by wrapping them in a table + root_markers = vim.fn.has('nvim-0.11.3') == 1 and { root_markers, biome_config_files, { '.git' } } + or vim.list_extend(root_markers, vim.list_extend(biome_config_files, { '.git' })) + + -- We fallback to the current working directory if no project root is found + local project_root = vim.fs.root(bufnr, root_markers) or vim.fn.getcwd() + + -- We know that the buffer is using Biome if it has a config file + -- in its directory tree. + local filename = vim.api.nvim_buf_get_name(bufnr) + biome_config_files = util.insert_package_json(biome_config_files, 'biomejs', filename) + local is_buffer_using_biome = vim.fs.find(biome_config_files, { + path = filename, + type = 'file', + limit = 1, + upward = true, + stop = vim.fs.dirname(project_root), + })[1] + if not is_buffer_using_biome then + return + end + + on_dir(project_root) + end, +} diff --git a/arch/lightvim/.config/lightvim/lsp/bitbake_language_server.lua b/arch/lightvim/.config/lightvim/lsp/bitbake_language_server.lua new file mode 100644 index 0000000..846db07 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/bitbake_language_server.lua @@ -0,0 +1,17 @@ +---@brief +--- +--- https://github.com/Freed-Wu/bitbake-language-server +--- +--- `bitbake-language-server` can be installed via `pip`: +--- ```sh +--- pip install bitbake-language-server +--- ``` +--- +--- Language server for bitbake. + +---@type vim.lsp.Config +return { + cmd = { 'bitbake-language-server' }, + filetypes = { 'bitbake' }, + root_markers = { '.git' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/blueprint_ls.lua b/arch/lightvim/.config/lightvim/lsp/blueprint_ls.lua new file mode 100644 index 0000000..3721f6a --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/blueprint_ls.lua @@ -0,0 +1,22 @@ +---@brief +--- +--- https://gitlab.gnome.org/jwestman/blueprint-compiler +--- +--- `blueprint-compiler` can be installed via your system package manager. +--- +--- Language server for the blueprint markup language, written in python and part +--- of the blueprint-compiler. + +---@type vim.lsp.Config +return { + cmd = { 'blueprint-compiler', 'lsp' }, + cmd_env = { + -- Prevent recursive scanning which will cause issues when opening a file + -- directly in the home directory (e.g. ~/foo.sh). + -- + -- Default upstream pattern is "**/*@(.sh|.inc|.bash|.command)". + GLOB_PATTERN = vim.env.GLOB_PATTERN or '*@(.blp)', + }, + filetypes = { 'blueprint' }, + root_markers = { '.git' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/bqls.lua b/arch/lightvim/.config/lightvim/lsp/bqls.lua new file mode 100644 index 0000000..cad3cd2 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/bqls.lua @@ -0,0 +1,17 @@ +---@brief +--- +--- https://github.com/kitagry/bqls +--- +--- The `bqls` BigQuery language server can be installed by running: +--- +--- ```sh +--- $ go install github.com/kitagry/bqls@latest +--- ``` + +---@type vim.lsp.Config +return { + cmd = { 'bqls' }, + filetypes = { 'sql' }, + root_markers = { '.git' }, + settings = {}, +} diff --git a/arch/lightvim/.config/lightvim/lsp/bright_script.lua b/arch/lightvim/.config/lightvim/lsp/bright_script.lua new file mode 100644 index 0000000..0f56417 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/bright_script.lua @@ -0,0 +1,15 @@ +---@brief +--- +--- https://github.com/RokuCommunity/brighterscript +--- +--- `brightscript` can be installed via `npm`: +--- ```sh +--- npm install -g brighterscript +--- ``` + +---@type vim.lsp.Config +return { + cmd = { 'bsc', '--lsp', '--stdio' }, + filetypes = { 'brs' }, + root_markers = { 'makefile', 'Makefile', '.git' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/brioche.lua b/arch/lightvim/.config/lightvim/lsp/brioche.lua new file mode 100644 index 0000000..24bf7e1 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/brioche.lua @@ -0,0 +1,12 @@ +---@brief +--- +--- https://github.com/brioche-dev/brioche +--- +--- `Brioche Language Server`. + +---@type vim.lsp.Config +return { + cmd = { 'brioche', 'lsp' }, + filetypes = { 'brioche' }, + root_markers = { 'project.bri' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/bsl_ls.lua b/arch/lightvim/.config/lightvim/lsp/bsl_ls.lua new file mode 100644 index 0000000..1ab35f5 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/bsl_ls.lua @@ -0,0 +1,11 @@ +---@brief +--- +--- https://github.com/1c-syntax/bsl-language-server +--- +--- Language Server Protocol implementation for 1C (BSL) - 1C:Enterprise 8 and OneScript languages. + +---@type vim.lsp.Config +return { + filetypes = { 'bsl', 'os' }, + root_markers = { '.git' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/buck2.lua b/arch/lightvim/.config/lightvim/lsp/buck2.lua new file mode 100644 index 0000000..7bc5d25 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/buck2.lua @@ -0,0 +1,18 @@ +---@brief +--- +--- https://github.com/facebook/buck2 +--- +--- Build system, successor to Buck +--- +--- To better detect Buck2 project files, the following can be added: +--- +--- ``` +--- vim.cmd [[ autocmd BufRead,BufNewFile *.bxl,BUCK,TARGETS set filetype=bzl ]] +--- ``` + +---@type vim.lsp.Config +return { + cmd = { 'buck2', 'lsp' }, + filetypes = { 'bzl' }, + root_markers = { '.buckconfig' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/buddy_ls.lua b/arch/lightvim/.config/lightvim/lsp/buddy_ls.lua new file mode 100644 index 0000000..dc82439 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/buddy_ls.lua @@ -0,0 +1,13 @@ +---@brief +--- +--- https://github.com/buddy-compiler/buddy-mlir#buddy-lsp-server +--- The Language Server for the buddy-mlir, a drop-in replacement for mlir-lsp-server, +--- supporting new dialects defined in buddy-mlir. +--- `buddy-lsp-server` can be installed at the buddy-mlir repository (buddy-compiler/buddy-mlir) + +---@type vim.lsp.Config +return { + cmd = { 'buddy-lsp-server' }, + filetypes = { 'mlir' }, + root_markers = { '.git' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/buf_ls.lua b/arch/lightvim/.config/lightvim/lsp/buf_ls.lua new file mode 100644 index 0000000..a06ff0b --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/buf_ls.lua @@ -0,0 +1,37 @@ +--- @brief +--- https://github.com/bufbuild/buf +--- +--- buf lsp included in the cli itself +--- +--- buf lsp is a Protobuf language server compatible with Buf modules and workspaces +--- +--- buf lsp also supports Buf configuration files. The `buf-config` filetype is not +--- detected automatically; register it manually (see below) or override the filetypes: +--- +--- ```lua +--- vim.filetype.add({ +--- filename = { +--- ['buf.yaml'] = 'buf-config', +--- ['buf.gen.yaml'] = 'buf-config', +--- ['buf.policy.yaml'] = 'buf-config', +--- ['buf.lock'] = 'buf-config', +--- }, +--- }) +--- ``` +--- +--- Optionally, tell treesitter to treat buf config files as YAML for syntax highlighting: +--- +--- ```lua +--- vim.treesitter.language.register('yaml', 'buf-config') +--- ``` + +---@type vim.lsp.Config +return { + cmd = { 'buf', 'lsp', 'serve', '--log-format=text' }, + filetypes = { 'proto', 'buf-config' }, + root_markers = { 'buf.yaml', '.git' }, + reuse_client = function(client, config) + -- `buf lsp serve` is meant to be used with multiple workspaces. + return client.name == config.name + end, +} diff --git a/arch/lightvim/.config/lightvim/lsp/bzl.lua b/arch/lightvim/.config/lightvim/lsp/bzl.lua new file mode 100644 index 0000000..7dc1dfe --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/bzl.lua @@ -0,0 +1,15 @@ +---@brief +--- +--- https://bzl.io/ +--- +--- https://docs.stack.build/docs/cli/installation +--- +--- https://docs.stack.build/docs/vscode/starlark-language-server + +---@type vim.lsp.Config +return { + cmd = { 'bzl', 'lsp', 'serve' }, + filetypes = { 'bzl' }, + -- https://docs.bazel.build/versions/5.4.1/build-ref.html#workspace + root_markers = { 'WORKSPACE', 'WORKSPACE.bazel' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/c3_lsp.lua b/arch/lightvim/.config/lightvim/lsp/c3_lsp.lua new file mode 100644 index 0000000..0ea9522 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/c3_lsp.lua @@ -0,0 +1,12 @@ +---@brief +--- +--- https://github.com/pherrymason/c3-lsp +--- +--- Language Server for c3. + +---@type vim.lsp.Config +return { + cmd = { 'c3lsp' }, + root_markers = { 'project.json', 'manifest.json', '.git' }, + filetypes = { 'c3', 'c3i' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/cairo_ls.lua b/arch/lightvim/.config/lightvim/lsp/cairo_ls.lua new file mode 100644 index 0000000..7489245 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/cairo_ls.lua @@ -0,0 +1,20 @@ +---@brief +--- +--- [Cairo Language Server](https://github.com/starkware-libs/cairo/tree/main/crates/cairo-lang-language-server) +--- +--- First, install Cairo following [this tutorial](https://book.cairo-lang.org/ch01-01-installation.html) +--- +--- Then enable Cairo Language Server in your Lua configuration. +--- ```lua +--- vim.lsp.enable('cairo_ls') +--- ``` +--- +--- *cairo-language-server is still under active development, some features might not work yet !* + +---@type vim.lsp.Config +return { + init_options = { hostInfo = 'neovim' }, + cmd = { 'scarb', 'cairo-language-server', '/C', '--node-ipc' }, + filetypes = { 'cairo' }, + root_markers = { 'Scarb.toml', 'cairo_project.toml', '.git' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/ccls.lua b/arch/lightvim/.config/lightvim/lsp/ccls.lua new file mode 100644 index 0000000..44268df --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/ccls.lua @@ -0,0 +1,53 @@ +---@brief +--- +--- https://github.com/MaskRay/ccls/wiki +--- +--- ccls relies on a [JSON compilation database](https://clang.llvm.org/docs/JSONCompilationDatabase.html) specified +--- as compile_commands.json or, for simpler projects, a .ccls. +--- For details on how to automatically generate one using CMake look [here](https://cmake.org/cmake/help/latest/variable/CMAKE_EXPORT_COMPILE_COMMANDS.html). Alternatively, you can use [Bear](https://github.com/rizsotto/Bear). +--- +--- Customization options are passed to ccls at initialization time via init_options, a list of available options can be found [here](https://github.com/MaskRay/ccls/wiki/Customization#initialization-options). For example: +--- +--- ```lua +--- vim.lsp.config("ccls", { +--- init_options = { +--- compilationDatabaseDirectory = "build"; +--- index = { +--- threads = 0; +--- }; +--- clang = { +--- excludeArgs = { "-frounding-math"} ; +--- }; +--- } +--- }) +--- ``` + +local function switch_source_header(client, bufnr) + local method_name = 'textDocument/switchSourceHeader' + local params = vim.lsp.util.make_text_document_params(bufnr) + client:request(method_name, params, function(err, result) + if err then + error(tostring(err)) + end + if not result then + vim.notify('corresponding file cannot be determined') + return + end + vim.cmd.edit(vim.uri_to_fname(result)) + end, bufnr) +end + +---@type vim.lsp.Config +return { + cmd = { 'ccls' }, + filetypes = { 'c', 'cpp', 'objc', 'objcpp', 'cuda' }, + root_markers = { 'compile_commands.json', '.ccls', '.git' }, + offset_encoding = 'utf-32', + -- ccls does not support sending a null root directory + workspace_required = true, + on_attach = function(client, bufnr) + vim.api.nvim_buf_create_user_command(bufnr, 'LspCclsSwitchSourceHeader', function() + switch_source_header(client, bufnr) + end, { desc = 'Switch between source/header' }) + end, +} diff --git a/arch/lightvim/.config/lightvim/lsp/cds_lsp.lua b/arch/lightvim/.config/lightvim/lsp/cds_lsp.lua new file mode 100644 index 0000000..12bfab7 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/cds_lsp.lua @@ -0,0 +1,20 @@ +---@brief +--- +--- https://cap.cloud.sap/docs/ +--- +--- `cds-lsp` can be installed via `npm`: +--- +--- ```sh +--- npm i -g @sap/cds-lsp +--- ``` + +---@type vim.lsp.Config +return { + cmd = { 'cds-lsp', '--stdio' }, + filetypes = { 'cds' }, + -- init_options = { provideFormatter = true }, -- needed to enable formatting capabilities + root_markers = { 'package.json', 'db', 'srv' }, + settings = { + cds = { validate = true }, + }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/cir_lsp_server.lua b/arch/lightvim/.config/lightvim/lsp/cir_lsp_server.lua new file mode 100644 index 0000000..15b887f --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/cir_lsp_server.lua @@ -0,0 +1,14 @@ +---@brief +--- +--- https://llvm.github.io/clangir +--- +--- The Language Server for the LLVM ClangIR language +--- +--- `cir-lsp-server` can be installed at the llvm-project repository (https://github.com/llvm/llvm-project) + +---@type vim.lsp.Config +return { + cmd = { 'cir-lsp-server' }, + filetypes = { 'cir' }, + root_markers = { '.git' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/circom-lsp.lua b/arch/lightvim/.config/lightvim/lsp/circom-lsp.lua new file mode 100644 index 0000000..c3bb8a4 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/circom-lsp.lua @@ -0,0 +1,12 @@ +---@brief +--- +--- [Circom Language Server](https://github.com/rubydusa/circom-lsp) +--- +--- `circom-lsp`, the language server for the Circom language. + +---@type vim.lsp.Config +return { + cmd = { 'circom-lsp' }, + filetypes = { 'circom' }, + root_markers = { '.git' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/clangd.lua b/arch/lightvim/.config/lightvim/lsp/clangd.lua new file mode 100644 index 0000000..c1abda4 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/clangd.lua @@ -0,0 +1,104 @@ +---@brief +--- +--- https://clangd.llvm.org/installation.html +--- +--- - **NOTE:** Clang >= 11 is recommended! See [#23](https://github.com/neovim/nvim-lspconfig/issues/23). +--- - If `compile_commands.json` lives in a build directory, you should +--- symlink it to the root of your source tree. +--- ``` +--- ln -s /path/to/myproject/build/compile_commands.json /path/to/myproject/ +--- ``` +--- - clangd relies on a [JSON compilation database](https://clang.llvm.org/docs/JSONCompilationDatabase.html) +--- specified as compile_commands.json, see https://clangd.llvm.org/installation#compile_commandsjson + +-- https://clangd.llvm.org/extensions.html#switch-between-sourceheader +local function switch_source_header(bufnr, client) + local method_name = 'textDocument/switchSourceHeader' + ---@diagnostic disable-next-line:param-type-mismatch + if not client or not client:supports_method(method_name) then + return vim.notify(('method %s is not supported by any servers active on the current buffer'):format(method_name)) + end + local params = vim.lsp.util.make_text_document_params(bufnr) + ---@diagnostic disable-next-line:param-type-mismatch + client:request(method_name, params, function(err, result) + if err then + error(tostring(err)) + end + if not result then + vim.notify('corresponding file cannot be determined') + return + end + vim.cmd.edit(vim.uri_to_fname(result)) + end, bufnr) +end + +local function symbol_info(bufnr, client) + local method_name = 'textDocument/symbolInfo' + ---@diagnostic disable-next-line:param-type-mismatch + if not client or not client:supports_method(method_name) then + return vim.notify('Clangd client not found', vim.log.levels.ERROR) + end + local win = vim.api.nvim_get_current_win() + local params = vim.lsp.util.make_position_params(win, client.offset_encoding) + ---@diagnostic disable-next-line:param-type-mismatch + client:request(method_name, params, function(err, res) + if err or #res == 0 then + -- Clangd always returns an error, there is no reason to parse it + return + end + local container = string.format('container: %s', res[1].containerName) ---@type string + local name = string.format('name: %s', res[1].name) ---@type string + vim.lsp.util.open_floating_preview({ name, container }, '', { + height = 2, + width = math.max(string.len(name), string.len(container)), + focusable = false, + focus = false, + title = 'Symbol Info', + }) + end, bufnr) +end + +---@class ClangdInitializeResult: lsp.InitializeResult +---@field offsetEncoding? string + +---@type vim.lsp.Config +return { + cmd = { 'clangd' }, + filetypes = { 'c', 'cpp', 'objc', 'objcpp', 'cuda' }, + root_markers = { + '.clangd', + '.clang-tidy', + '.clang-format', + 'compile_commands.json', + 'compile_flags.txt', + 'configure.ac', -- AutoTools + '.git', + }, + get_language_id = function(_, ftype) + local t = { objc = 'objective-c', objcpp = 'objective-cpp', cuda = 'cuda-cpp' } + return t[ftype] or ftype + end, + capabilities = { + textDocument = { + completion = { + editsNearCursor = true, + }, + }, + offsetEncoding = { 'utf-8', 'utf-16' }, + }, + ---@param init_result ClangdInitializeResult + on_init = function(client, init_result) + if init_result.offsetEncoding then + client.offset_encoding = init_result.offsetEncoding + end + end, + on_attach = function(client, bufnr) + vim.api.nvim_buf_create_user_command(bufnr, 'LspClangdSwitchSourceHeader', function() + switch_source_header(bufnr, client) + end, { desc = 'Switch between source/header' }) + + vim.api.nvim_buf_create_user_command(bufnr, 'LspClangdShowSymbolInfo', function() + symbol_info(bufnr, client) + end, { desc = 'Show symbol info' }) + end, +} diff --git a/arch/lightvim/.config/lightvim/lsp/clarinet.lua b/arch/lightvim/.config/lightvim/lsp/clarinet.lua new file mode 100644 index 0000000..be93d8a --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/clarinet.lua @@ -0,0 +1,11 @@ +---@brief +--- https://github.com/hirosystems/clarinet +--- +--- Clarinet is the fastest way to build, test, and deploy smart contracts on the Stacks blockchain. + +---@type vim.lsp.Config +return { + cmd = { 'clarinet', 'lsp' }, + filetypes = { 'clar', 'clarity' }, + root_markers = { 'Clarinet.toml' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/clojure_lsp.lua b/arch/lightvim/.config/lightvim/lsp/clojure_lsp.lua new file mode 100644 index 0000000..f60ee38 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/clojure_lsp.lua @@ -0,0 +1,12 @@ +---@brief +--- +--- https://github.com/clojure-lsp/clojure-lsp +--- +--- Clojure Language Server + +---@type vim.lsp.Config +return { + cmd = { 'clojure-lsp' }, + filetypes = { 'clojure', 'edn' }, + root_markers = { 'project.clj', 'deps.edn', 'build.boot', 'shadow-cljs.edn', '.git', 'bb.edn' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/cmake.lua b/arch/lightvim/.config/lightvim/lsp/cmake.lua new file mode 100644 index 0000000..38fa06a --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/cmake.lua @@ -0,0 +1,15 @@ +---@brief +--- +--- https://github.com/regen100/cmake-language-server +--- +--- CMake LSP Implementation + +---@type vim.lsp.Config +return { + cmd = { 'cmake-language-server' }, + filetypes = { 'cmake' }, + root_markers = { 'CMakePresets.json', 'CTestConfig.cmake', '.git', 'build', 'cmake' }, + init_options = { + buildDirectory = 'build', + }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/cobol_ls.lua b/arch/lightvim/.config/lightvim/lsp/cobol_ls.lua new file mode 100644 index 0000000..a763ed6 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/cobol_ls.lua @@ -0,0 +1,10 @@ +---@brief +--- +--- Cobol language support + +---@type vim.lsp.Config +return { + cmd = { 'cobol-language-support' }, + filetypes = { 'cobol' }, + root_markers = { '.git' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/codebook.lua b/arch/lightvim/.config/lightvim/lsp/codebook.lua new file mode 100644 index 0000000..ec8931f --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/codebook.lua @@ -0,0 +1,39 @@ +---@brief +--- +--- https://github.com/blopker/codebook +--- +--- An unholy spell checker for code. +--- +--- `codebook-lsp` can be installed by following the instructions [here](https://github.com/blopker/codebook/blob/main/README.md#installation). +--- +--- The default `cmd` assumes that the `codebook-lsp` binary can be found in `$PATH`. +--- + +---@type vim.lsp.Config +return { + cmd = { 'codebook-lsp', 'serve' }, + filetypes = { + 'c', + 'css', + 'gitcommit', + 'go', + 'haskell', + 'html', + 'java', + 'javascript', + 'javascriptreact', + 'lua', + 'markdown', + 'php', + 'python', + 'ruby', + 'rust', + 'swift', + 'toml', + 'text', + 'typescript', + 'typescriptreact', + 'zig', + }, + root_markers = { '.git', 'codebook.toml', '.codebook.toml' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/coffeesense.lua b/arch/lightvim/.config/lightvim/lsp/coffeesense.lua new file mode 100644 index 0000000..aeaa2c2 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/coffeesense.lua @@ -0,0 +1,16 @@ +---@brief +--- +--- https://github.com/phil294/coffeesense +--- +--- CoffeeSense Language Server +--- `coffeesense-language-server` can be installed via `npm`: +--- ```sh +--- npm install -g coffeesense-language-server +--- ``` + +---@type vim.lsp.Config +return { + cmd = { 'coffeesense-language-server', '--stdio' }, + filetypes = { 'coffee' }, + root_markers = { 'package.json' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/contextive.lua b/arch/lightvim/.config/lightvim/lsp/contextive.lua new file mode 100644 index 0000000..3cca333 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/contextive.lua @@ -0,0 +1,17 @@ +---@brief +--- +--- https://github.com/dev-cycles/contextive +--- +--- Language Server for Contextive. +--- +--- Contextive allows you to define terms in a central file and provides auto-completion suggestions and hover panels for these terms wherever they're used. +--- +--- To install the language server, you need to download the appropriate [GitHub release asset](https://github.com/dev-cycles/contextive/releases/) for your operating system and architecture. +--- +--- After the download unzip the Contextive.LanguageServer binary and copy the file into a folder that is included in your system's PATH. + +---@type vim.lsp.Config +return { + cmd = { 'Contextive.LanguageServer' }, + root_markers = { '.contextive', '.git' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/copilot.lua b/arch/lightvim/.config/lightvim/lsp/copilot.lua new file mode 100644 index 0000000..4aa37f4 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/copilot.lua @@ -0,0 +1,135 @@ +---@brief +--- +--- https://www.npmjs.com/package/@github/copilot-language-server +--- +--- The Copilot Language Server enables any editor or IDE +--- to integrate with GitHub Copilot via +--- [the language server protocol](https://microsoft.github.io/language-server-protocol/). +--- +--- **[GitHub Copilot](https://github.com/features/copilot)** +--- is an AI pair programmer tool that helps you write code faster and smarter. +--- +--- **Sign up for [GitHub Copilot Free](https://github.com/settings/copilot)!** +--- +--- Please see [terms of use for GitHub Copilot](https://docs.github.com/en/site-policy/github-terms/github-terms-for-additional-products-and-features#github-copilot) +--- +--- You need to enable `:help lsp-inline-completion` to receive suggestions. For example, you can enable it in the LspAttach event: +--- +--- ```lua +--- vim.api.nvim_create_autocmd('LspAttach', { +--- callback = function(args) +--- local bufnr = args.buf +--- local client = assert(vim.lsp.get_client_by_id(args.data.client_id)) +--- +--- if client:supports_method(vim.lsp.protocol.Methods.textDocument_inlineCompletion, bufnr) then +--- vim.lsp.inline_completion.enable(true, { bufnr = bufnr }) +--- +--- vim.keymap.set( +--- 'i', +--- '', +--- vim.lsp.inline_completion.get, +--- { desc = 'LSP: accept inline completion', buffer = bufnr } +--- ) +--- vim.keymap.set( +--- 'i', +--- '', +--- vim.lsp.inline_completion.select, +--- { desc = 'LSP: switch inline completion', buffer = bufnr } +--- ) +--- end +--- end +--- }) +--- ``` + +---@param bufnr integer, +---@param client vim.lsp.Client +local function sign_in(bufnr, client) + client:request( + ---@diagnostic disable-next-line: param-type-mismatch + 'signIn', + vim.empty_dict(), + function(err, result) + if err then + vim.notify(err.message, vim.log.levels.ERROR) + return + end + if result.command then + local code = result.userCode + local command = result.command + vim.fn.setreg('+', code) + vim.fn.setreg('*', code) + local continue = vim.fn.confirm( + 'Copied your one-time code to clipboard.\n' .. 'Open the browser to complete the sign-in process?', + '&Yes\n&No' + ) + if continue == 1 then + client:exec_cmd(command, { bufnr = bufnr }, function(cmd_err, cmd_result) + if cmd_err then + vim.notify(cmd_err.message, vim.log.levels.ERROR) + return + end + if cmd_result.status == 'OK' then + vim.notify('Signed in as ' .. cmd_result.user .. '.') + end + end) + end + end + + if result.status == 'PromptUserDeviceFlow' then + vim.notify('Enter your one-time code ' .. result.userCode .. ' in ' .. result.verificationUri) + elseif result.status == 'AlreadySignedIn' then + vim.notify('Already signed in as ' .. result.user .. '.') + end + end + ) +end + +---@param client vim.lsp.Client +local function sign_out(_, client) + client:request( + ---@diagnostic disable-next-line: param-type-mismatch + 'signOut', + vim.empty_dict(), + function(err, result) + if err then + vim.notify(err.message, vim.log.levels.ERROR) + return + end + if result.status == 'NotSignedIn' then + vim.notify('Not signed in.') + end + end + ) +end + +---@type vim.lsp.Config +return { + cmd = { + 'copilot-language-server', + '--stdio', + }, + root_markers = { '.git' }, + init_options = { + editorInfo = { + name = 'Neovim', + version = tostring(vim.version()), + }, + editorPluginInfo = { + name = 'Neovim', + version = tostring(vim.version()), + }, + }, + settings = { + telemetry = { + telemetryLevel = 'all', + }, + }, + on_attach = function(client, bufnr) + vim.api.nvim_buf_create_user_command(bufnr, 'LspCopilotSignIn', function() + sign_in(bufnr, client) + end, { desc = 'Sign in Copilot with GitHub' }) + vim.api.nvim_buf_create_user_command(bufnr, 'LspCopilotSignOut', function() + sign_out(bufnr, client) + end, { desc = 'Sign out Copilot with GitHub' }) + end, +} diff --git a/arch/lightvim/.config/lightvim/lsp/coq_lsp.lua b/arch/lightvim/.config/lightvim/lsp/coq_lsp.lua new file mode 100644 index 0000000..e8dc76f --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/coq_lsp.lua @@ -0,0 +1,10 @@ +---@brief +--- +--- https://github.com/ejgallego/coq-lsp/ + +---@type vim.lsp.Config +return { + cmd = { 'coq-lsp' }, + filetypes = { 'coq' }, + root_markers = { '_CoqProject', '.git' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/crystalline.lua b/arch/lightvim/.config/lightvim/lsp/crystalline.lua new file mode 100644 index 0000000..f682f7d --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/crystalline.lua @@ -0,0 +1,12 @@ +---@brief +--- +--- https://github.com/elbywan/crystalline +--- +--- Crystal language server. + +---@type vim.lsp.Config +return { + cmd = { 'crystalline' }, + filetypes = { 'crystal' }, + root_markers = { 'shard.yml', '.git' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/csharp_ls.lua b/arch/lightvim/.config/lightvim/lsp/csharp_ls.lua new file mode 100644 index 0000000..e284090 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/csharp_ls.lua @@ -0,0 +1,38 @@ +---@brief +--- +--- https://github.com/razzmatazz/csharp-language-server +--- +--- Language Server for C#. +--- +--- csharp-ls requires the [dotnet-sdk](https://dotnet.microsoft.com/download) to be installed. +--- +--- The preferred way to install csharp-ls is with `dotnet tool install --global csharp-ls`. + +local util = require 'lspconfig.util' + +---@type vim.lsp.Config +return { + cmd = function(dispatchers, config) + return vim.lsp.rpc.start({ 'csharp-ls' }, dispatchers, { + -- csharp-ls attempt to locate sln, slnx or csproj files from cwd, so set cwd to root directory. + -- If cmd_cwd is provided, use it instead. + cwd = config.cmd_cwd or config.root_dir, + env = config.cmd_env, + detached = config.detached, + }) + end, + root_dir = function(bufnr, on_dir) + local fname = vim.api.nvim_buf_get_name(bufnr) + on_dir(util.root_pattern '*.sln'(fname) or util.root_pattern '*.slnx'(fname) or util.root_pattern '*.csproj'(fname)) + end, + filetypes = { 'cs' }, + init_options = { + AutomaticWorkspaceInit = true, + }, + get_language_id = function(_, ft) + if ft == 'cs' then + return 'csharp' + end + return ft + end, +} diff --git a/arch/lightvim/.config/lightvim/lsp/cspell_ls.lua b/arch/lightvim/.config/lightvim/lsp/cspell_ls.lua new file mode 100644 index 0000000..d1598dd --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/cspell_ls.lua @@ -0,0 +1,24 @@ +---@brief +--- +--- [cspell language server](https://github.com/vlabo/cspell-lsp) +--- + +---@type vim.lsp.Config +return { + cmd = { 'cspell-lsp', '--stdio' }, + root_markers = { + '.git', + 'cspell.json', + '.cspell.json', + 'cspell.json', + '.cSpell.json', + 'cSpell.json', + 'cspell.config.js', + 'cspell.config.cjs', + 'cspell.config.json', + 'cspell.config.yaml', + 'cspell.config.yml', + 'cspell.yaml', + 'cspell.yml', + }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/css_variables.lua b/arch/lightvim/.config/lightvim/lsp/css_variables.lua new file mode 100644 index 0000000..ce63617 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/css_variables.lua @@ -0,0 +1,51 @@ +---@brief +--- +--- https://github.com/vunguyentuan/vscode-css-variables/tree/master/packages/css-variables-language-server +--- +--- CSS variables autocompletion and go-to-definition +--- +--- `css-variables-language-server` can be installed via `npm`: +--- +--- ```sh +--- npm i -g css-variables-language-server +--- ``` + +---@type vim.lsp.Config +return { + cmd = { 'css-variables-language-server', '--stdio' }, + filetypes = { 'css', 'scss', 'less' }, + + -- Taken from lsp/ts_ls.lua to handle simple projects and monorepos. + root_dir = function(bufnr, on_dir) + local root_markers = { 'package-lock.json', 'yarn.lock', 'pnpm-lock.yaml', 'bun.lockb', 'bun.lock' } + -- Give the root markers equal priority by wrapping them in a table + root_markers = vim.fn.has 'nvim-0.11.3' == 1 and { root_markers, { '.git' } } + or vim.list_extend(root_markers, { '.git' }) + -- We fallback to the current working directory if no project root is found + local project_root = vim.fs.root(bufnr, root_markers) or vim.fn.getcwd() + + on_dir(project_root) + end, + + -- Same as inlined defaults that don't seem to work without hardcoding them in the lua config + -- https://github.com/vunguyentuan/vscode-css-variables/blob/763a564df763f17aceb5f3d6070e0b444a2f47ff/packages/css-variables-language-server/src/CSSVariableManager.ts#L31-L50 + settings = { + cssVariables = { + lookupFiles = { '**/*.less', '**/*.scss', '**/*.sass', '**/*.css' }, + blacklistFolders = { + '**/.cache', + '**/.DS_Store', + '**/.git', + '**/.hg', + '**/.next', + '**/.svn', + '**/bower_components', + '**/CVS', + '**/dist', + '**/node_modules', + '**/tests', + '**/tmp', + }, + }, + }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/csskit.lua b/arch/lightvim/.config/lightvim/lsp/csskit.lua new file mode 100644 index 0000000..c221853 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/csskit.lua @@ -0,0 +1,18 @@ +---@brief +--- +--- https://github.com/csskit/csskit +--- +--- Beautiful, fast, and powerful CSS tooling with zero configuration +--- +--- `csskit` can be installed via `npm`: +--- +--- ```sh +--- npm i -g csskit +--- ``` + +---@type vim.lsp.Config +return { + cmd = { 'csskit', 'lsp' }, + filetypes = { 'css' }, + root_markers = { 'package.json', '.git' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/cssls.lua b/arch/lightvim/.config/lightvim/lsp/cssls.lua new file mode 100644 index 0000000..8333628 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/cssls.lua @@ -0,0 +1,44 @@ +---@brief +--- +--- https://github.com/hrsh7th/vscode-langservers-extracted +--- +--- `css-languageserver` can be installed via `npm`: +--- +--- ```sh +--- npm i -g vscode-langservers-extracted +--- ``` +--- +--- Neovim does not currently include built-in snippets. `vscode-css-language-server` only provides completions when snippet support is enabled. To enable completion, install a snippet plugin and add the following override to your language client capabilities during setup. +--- +--- ```lua +--- --Enable (broadcasting) snippet capability for completion +--- local capabilities = vim.lsp.protocol.make_client_capabilities() +--- capabilities.textDocument.completion.completionItem.snippetSupport = true +--- +--- vim.lsp.config('cssls', { +--- capabilities = capabilities, +--- }) +--- ``` + +---@type vim.lsp.Config +return { + cmd = function(dispatchers, config) + local cmd = 'vscode-css-language-server' + if (config or {}).root_dir then + local local_cmd = vim.fs.joinpath(config.root_dir, 'node_modules/.bin', cmd) + if vim.fn.executable(local_cmd) == 1 then + cmd = local_cmd + end + end + return vim.lsp.rpc.start({ cmd, '--stdio' }, dispatchers) + end, + filetypes = { 'css', 'scss', 'less' }, + init_options = { provideFormatter = true }, -- needed to enable formatting capabilities + root_markers = { 'package.json', '.git' }, + ---@type lspconfig.settings.cssls + settings = { + css = { validate = true }, + scss = { validate = true }, + less = { validate = true }, + }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/cssmodules_ls.lua b/arch/lightvim/.config/lightvim/lsp/cssmodules_ls.lua new file mode 100644 index 0000000..35a5c59 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/cssmodules_ls.lua @@ -0,0 +1,17 @@ +---@brief +--- +--- https://github.com/antonk52/cssmodules-language-server +--- +--- Language server for autocompletion and go-to-definition functionality for CSS modules. +--- +--- You can install cssmodules-language-server via npm: +--- ```sh +--- npm install -g cssmodules-language-server +--- ``` + +---@type vim.lsp.Config +return { + cmd = { 'cssmodules-language-server' }, + filetypes = { 'javascript', 'javascriptreact', 'typescript', 'typescriptreact' }, + root_markers = { 'package.json' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/ctags_lsp.lua b/arch/lightvim/.config/lightvim/lsp/ctags_lsp.lua new file mode 100644 index 0000000..07c65a6 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/ctags_lsp.lua @@ -0,0 +1,28 @@ +---@brief +--- +--- https://github.com/netmute/ctags-lsp +--- +--- A simple LSP server wrapping universal-ctags. Provides completion, +--- go-to-definition, and document/workspace symbols. Useful as a generic +--- symbol provider for languages without a dedicated language server, or +--- as a fallback alongside other LSPs. +--- +--- Requires `universal-ctags` to be installed and available in `$PATH`. +--- Pre-built binaries are at https://github.com/netmute/ctags-lsp/releases +--- (Homebrew: `brew install netmute/tap/ctags-lsp`). +--- +--- The server is generic and does not declare default `filetypes`. Configure +--- the languages you want it to attach to: +--- +--- ```lua +--- vim.lsp.config('ctags_lsp', { +--- filetypes = { 'lua', 'ruby', 'go' }, +--- }) +--- vim.lsp.enable('ctags_lsp') +--- ``` + +---@type vim.lsp.Config +return { + cmd = { 'ctags-lsp' }, + root_markers = { 'tags', '.tags', '.git' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/cucumber_language_server.lua b/arch/lightvim/.config/lightvim/lsp/cucumber_language_server.lua new file mode 100644 index 0000000..82bfcff --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/cucumber_language_server.lua @@ -0,0 +1,19 @@ +---@brief +--- +--- https://cucumber.io +--- https://github.com/cucumber/common +--- https://www.npmjs.com/package/@cucumber/language-server +--- +--- Language server for Cucumber. +--- +--- `cucumber-language-server` can be installed via `npm`: +--- ```sh +--- npm install -g @cucumber/language-server +--- ``` + +---@type vim.lsp.Config +return { + cmd = { 'cucumber-language-server', '--stdio' }, + filetypes = { 'cucumber' }, + root_markers = { '.git' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/cue.lua b/arch/lightvim/.config/lightvim/lsp/cue.lua new file mode 100644 index 0000000..22941a0 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/cue.lua @@ -0,0 +1,12 @@ +---@brief +--- +--- https://github.com/cue-lang/cue +--- +--- CUE makes it easy to validate data, write schemas, and ensure configurations align with policies. + +---@type vim.lsp.Config +return { + cmd = { 'cue', 'lsp' }, + filetypes = { 'cue' }, + root_markers = { 'cue.mod', '.git' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/custom_elements_ls.lua b/arch/lightvim/.config/lightvim/lsp/custom_elements_ls.lua new file mode 100644 index 0000000..684786b --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/custom_elements_ls.lua @@ -0,0 +1,32 @@ +---@brief +--- +--- https://github.com/Matsuuu/custom-elements-language-server +--- +--- `custom-elements-languageserver` depends on `typescript`. Both packages can be installed via `npm`: +--- ```sh +--- npm install -g typescript custom-elements-languageserver +--- ``` +--- To configure typescript language server, add a +--- [`tsconfig.json`](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html) or +--- [`jsconfig.json`](https://code.visualstudio.com/docs/languages/jsconfig) to the root of your +--- project. +--- Here's an example that disables type checking in JavaScript files. +--- ```json +--- { +--- "compilerOptions": { +--- "module": "commonjs", +--- "target": "es6", +--- "checkJs": false +--- }, +--- "exclude": [ +--- "node_modules" +--- ] +--- } +--- ``` + +---@type vim.lsp.Config +return { + init_options = { hostInfo = 'neovim' }, + cmd = { 'custom-elements-languageserver', '--stdio' }, + root_markers = { 'tsconfig.json', 'package.json', 'jsconfig.json', '.git' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/cypher_ls.lua b/arch/lightvim/.config/lightvim/lsp/cypher_ls.lua new file mode 100644 index 0000000..8058b1c --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/cypher_ls.lua @@ -0,0 +1,18 @@ +---@brief +--- +--- https://github.com/neo4j/cypher-language-support/tree/main/packages/language-server +--- +--- `cypher-language-server`, language server for Cypher query language. +--- Part of the umbrella project cypher-language-support: https://github.com/neo4j/cypher-language-support +--- +--- `cypher-language-server` can be installed via `npm`: +--- ```sh +--- npm i -g @neo4j-cypher/language-server +--- ``` + +---@type vim.lsp.Config +return { + cmd = { 'cypher-language-server', '--stdio' }, + filetypes = { 'cypher' }, + root_markers = { '.git' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/daedalus_ls.lua b/arch/lightvim/.config/lightvim/lsp/daedalus_ls.lua new file mode 100644 index 0000000..b3adef8 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/daedalus_ls.lua @@ -0,0 +1,27 @@ +--- @brief +--- +--- DaedalusLanguageServer + +---@type vim.lsp.Config +return { + cmd = { 'DaedalusLanguageServer' }, + filetypes = { 'd' }, + root_markers = { + 'Gothic.src', + 'Camera.src', + 'Menu.src', + 'Music.src', + 'ParticleFX.src', + 'SFX.src', + 'VisualFX.src', + }, + settings = { + DaedalusLanguageServer = { + loglevel = 'debug', + inlayHints = { constants = true }, + numParserThreads = 16, + fileEncoding = 'Windows-1252', + srcFileEncoding = 'Windows-1252', + }, + }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/dafny.lua b/arch/lightvim/.config/lightvim/lsp/dafny.lua new file mode 100644 index 0000000..39e65d9 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/dafny.lua @@ -0,0 +1,15 @@ +---@brief +--- +--- Support for the Dafny language server. + +-- The default `cmd` uses "dafny server", which works on Dafny 4.0.0+. For +-- older versions of Dafny, you can compile the language server from source at +-- [dafny-lang/language-server-csharp](https://github.com/dafny-lang/language-server-csharp) +-- and set `cmd = {"dotnet", ""}`. + +---@type vim.lsp.Config +return { + cmd = { 'dafny', 'server' }, + filetypes = { 'dfy', 'dafny' }, + root_markers = { '.git' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/dagger.lua b/arch/lightvim/.config/lightvim/lsp/dagger.lua new file mode 100644 index 0000000..714e79a --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/dagger.lua @@ -0,0 +1,12 @@ +---@brief +--- +--- https://github.com/dagger/cuelsp +--- +--- Dagger's lsp server for cuelang. + +---@type vim.lsp.Config +return { + cmd = { 'cuelsp' }, + filetypes = { 'cue' }, + root_markers = { 'cue.mod', '.git' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/dartls.lua b/arch/lightvim/.config/lightvim/lsp/dartls.lua new file mode 100644 index 0000000..393e4fb --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/dartls.lua @@ -0,0 +1,26 @@ +---@brief +--- +--- https://github.com/dart-lang/sdk/tree/master/pkg/analysis_server/tool/lsp_spec +--- +--- Language server for dart. + +---@type vim.lsp.Config +return { + cmd = { 'dart', 'language-server', '--protocol=lsp' }, + filetypes = { 'dart' }, + root_markers = { 'pubspec.yaml' }, + init_options = { + onlyAnalyzeProjectsWithOpenFiles = true, + suggestFromUnimportedLibraries = true, + closingLabels = true, + outline = true, + flutterOutline = true, + }, + ---@type lspconfig.settings.dartls + settings = { + dart = { + completeFunctionCalls = true, + showTodos = true, + }, + }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/dcmls.lua b/arch/lightvim/.config/lightvim/lsp/dcmls.lua new file mode 100644 index 0000000..90f98db --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/dcmls.lua @@ -0,0 +1,12 @@ +---@brief +--- +--- https://dcm.dev/ +--- +--- Language server for DCM analyzer. + +---@type vim.lsp.Config +return { + cmd = { 'dcm', 'start-server', '--client=neovim' }, + filetypes = { 'dart' }, + root_markers = { 'pubspec.yaml' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/debputy.lua b/arch/lightvim/.config/lightvim/lsp/debputy.lua new file mode 100644 index 0000000..6d7dce5 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/debputy.lua @@ -0,0 +1,12 @@ +---@brief +--- +--- https://salsa.debian.org/debian/debputy +--- +--- Language Server for Debian packages. + +---@type vim.lsp.Config +return { + cmd = { 'debputy', 'lsp', 'server' }, + filetypes = { 'debcontrol', 'debcopyright', 'debchangelog', 'autopkgtest', 'make', 'yaml' }, + root_markers = { 'debian' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/denols.lua b/arch/lightvim/.config/lightvim/lsp/denols.lua new file mode 100644 index 0000000..dc7761b --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/denols.lua @@ -0,0 +1,161 @@ +---@brief +--- +--- https://github.com/denoland/deno +--- +--- Deno's built-in language server +--- +--- To appropriately highlight codefences returned from denols, you will need to augment vim.g.markdown_fenced languages +--- in your init.lua. Example: +--- +--- ```lua +--- vim.g.markdown_fenced_languages = { +--- "ts=typescript" +--- } +--- ``` +--- +--- Some care must be taken here to correctly infer whether a file is part of a Deno program, or a TS program that +--- expects to run in Node or Web Browsers. This supports having a Deno module that is a part of a mostly-not-Deno +--- monorepo. We do this by finding the nearest package manager lock file, and the nearest deno.json or deno.jsonc. +--- Note that this means that without a deno.json, deno.jsonc, or deno.lock file, this LSP client will not attach. +--- +--- Example: +--- +--- ``` +--- project-root +--- +-- node_modules/... +--- +-- package-lock.json +--- +-- package.json +--- +-- packages +--- +-- deno-module +--- | +-- deno.json +--- | +-- package.json <-- It's normal for Deno projects to have package.json files! +--- | +-- src +--- | +-- index.ts <-- this is a Deno file +--- +-- node-module +--- +-- package.json +--- +-- src +--- +-- index.ts <-- a non-Deno file (ie, should use ts_ls or tsgo) +--- ``` +--- +--- From the file being edited, we walk up to find the nearest package manager lockfile. This is PROJECT ROOT. +--- From the file being edited, find the nearest deno.json or deno.jsonc. This is DENO ROOT. +--- From the file being edited, find the nearest deno.lock. This is DENO LOCK ROOT +--- If DENO LOCK ROOT is found, and PROJECT ROOT is missing or shorter, then this is a deno file, and we attach. +--- If DENO ROOT is found, and it's longer than or equal to PROJECT ROOT, then this is a Deno file, and we attach. +--- Otherwise, we abort, because this is a non-Deno TS file. + +local lsp = vim.lsp + +local function virtual_text_document_handler(uri, res, client) + if not res then + return nil + end + + local lines = vim.split(res.result, '\n') + local bufnr = vim.uri_to_bufnr(uri) + + local current_buf = vim.api.nvim_buf_get_lines(bufnr, 0, -1, false) + if #current_buf ~= 0 then + return nil + end + + vim.api.nvim_buf_set_lines(bufnr, 0, -1, false, lines) + vim.api.nvim_set_option_value('readonly', true, { buf = bufnr }) + vim.api.nvim_set_option_value('modified', false, { buf = bufnr }) + vim.api.nvim_set_option_value('modifiable', false, { buf = bufnr }) + lsp.buf_attach_client(bufnr, client.id) +end + +local function virtual_text_document(uri, client) + local params = { + textDocument = { + uri = uri, + }, + } + local result = client:request_sync('deno/virtualTextDocument', params) + virtual_text_document_handler(uri, result, client) +end + +local function denols_handler(err, result, ctx, config) + if not result or vim.tbl_isempty(result) then + return nil + end + + local client = vim.lsp.get_client_by_id(ctx.client_id) + for _, res in pairs(result) do + local uri = res.uri or res.targetUri + if uri:match '^deno:' then + virtual_text_document(uri, client) + res['uri'] = uri + res['targetUri'] = uri + end + end + + lsp.handlers[ctx.method](err, result, ctx, config) +end + +---@type vim.lsp.Config +return { + cmd = { 'deno', 'lsp' }, + cmd_env = { NO_COLOR = true }, + filetypes = { + 'javascript', + 'javascriptreact', + 'typescript', + 'typescriptreact', + }, + root_dir = function(bufnr, on_dir) + -- The project root is where the LSP can be started from + local root_markers = { 'deno.lock', 'deno.json', 'deno.jsonc' } + -- Give the root markers equal priority by wrapping them in a table + root_markers = vim.fn.has('nvim-0.11.3') == 1 and { root_markers, { '.git' } } + or vim.list_extend(root_markers, { '.git' }) + -- only include deno projects + local deno_root = vim.fs.root(bufnr, { 'deno.json', 'deno.jsonc' }) + local deno_lock_root = vim.fs.root(bufnr, { 'deno.lock' }) + local project_root = vim.fs.root(bufnr, root_markers) + if + (deno_lock_root and (not project_root or #deno_lock_root > #project_root)) + or (deno_root and (not project_root or #deno_root >= #project_root)) + then + -- deno config is closer than or equal to package manager lock, + -- or deno lock is closer than package manager lock. Attach at the project root, + -- or deno lock or deno config path. At least one of these is always set at this point. + on_dir(project_root or deno_lock_root or deno_root) + end + end, + ---@type lspconfig.settings.denols + settings = { + deno = { + enable = true, + suggest = { + imports = { + hosts = { + ['https://deno.land'] = true, + }, + }, + }, + }, + }, + handlers = { + ['textDocument/definition'] = denols_handler, + ['textDocument/typeDefinition'] = denols_handler, + ['textDocument/references'] = denols_handler, + }, + on_attach = function(client, bufnr) + vim.api.nvim_buf_create_user_command(bufnr, 'LspDenolsCache', function() + client:exec_cmd({ + title = 'DenolsCache', + command = 'deno.cache', + arguments = { {}, vim.uri_from_bufnr(bufnr) }, + }, { bufnr = bufnr }, function(err, _, ctx) + if err then + local uri = ctx.params.arguments[2] + vim.notify('cache command failed for' .. vim.uri_to_fname(uri), vim.log.levels.ERROR) + end + end) + end, { + desc = 'Cache a module and all of its dependencies.', + }) + end, +} diff --git a/arch/lightvim/.config/lightvim/lsp/dhall_lsp_server.lua b/arch/lightvim/.config/lightvim/lsp/dhall_lsp_server.lua new file mode 100644 index 0000000..4953fba --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/dhall_lsp_server.lua @@ -0,0 +1,18 @@ +---@brief +--- +--- https://github.com/dhall-lang/dhall-haskell/tree/master/dhall-lsp-server +--- +--- language server for dhall +--- +--- `dhall-lsp-server` can be installed via cabal: +--- ```sh +--- cabal install dhall-lsp-server +--- ``` +--- prebuilt binaries can be found [here](https://github.com/dhall-lang/dhall-haskell/releases). + +---@type vim.lsp.Config +return { + cmd = { 'dhall-lsp-server' }, + filetypes = { 'dhall' }, + root_markers = { '.git' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/diagnosticls.lua b/arch/lightvim/.config/lightvim/lsp/diagnosticls.lua new file mode 100644 index 0000000..8c717ea --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/diagnosticls.lua @@ -0,0 +1,14 @@ +---@brief +--- +--- https://github.com/iamcco/diagnostic-languageserver +--- +--- Diagnostic language server integrate with linters. + +---@type vim.lsp.Config +return { + -- Configuration from https://github.com/iamcco/diagnostic-languageserver#config--document + cmd = { 'diagnostic-languageserver', '--stdio' }, + root_markers = { '.git' }, + -- Empty by default, override to add filetypes. + filetypes = {}, +} diff --git a/arch/lightvim/.config/lightvim/lsp/digestif.lua b/arch/lightvim/.config/lightvim/lsp/digestif.lua new file mode 100644 index 0000000..863b772 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/digestif.lua @@ -0,0 +1,16 @@ +---@brief +--- +--- https://github.com/astoff/digestif +--- +--- Digestif is a code analyzer, and a language server, for LaTeX, ConTeXt et caterva. It provides +--- +--- context-sensitive completion, documentation, code navigation, and related functionality to any +--- +--- text editor that speaks the LSP protocol. + +---@type vim.lsp.Config +return { + cmd = { 'digestif' }, + filetypes = { 'tex', 'plaintex', 'context' }, + root_markers = { '.git' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/djls.lua b/arch/lightvim/.config/lightvim/lsp/djls.lua new file mode 100644 index 0000000..7ef8d5f --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/djls.lua @@ -0,0 +1,12 @@ +---@brief +--- +--- https://github.com/joshuadavidthomas/django-language-server +--- +--- `djls`, a language server for the Django web framework. + +---@type vim.lsp.Config +return { + cmd = { 'djls', 'serve' }, + filetypes = { 'htmldjango', 'html', 'python' }, + root_markers = { 'manage.py', 'pyproject.toml', '.git' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/djlsp.lua b/arch/lightvim/.config/lightvim/lsp/djlsp.lua new file mode 100644 index 0000000..120dbe4 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/djlsp.lua @@ -0,0 +1,13 @@ +---@brief +--- +--- https://github.com/fourdigits/django-template-lsp +--- +--- `djlsp`, a language server for Django templates. + +---@type vim.lsp.Config +return { + cmd = { 'djlsp' }, + filetypes = { 'html', 'htmldjango' }, + root_markers = { '.git' }, + settings = {}, +} diff --git a/arch/lightvim/.config/lightvim/lsp/docker_compose_language_service.lua b/arch/lightvim/.config/lightvim/lsp/docker_compose_language_service.lua new file mode 100644 index 0000000..f5bbf78 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/docker_compose_language_service.lua @@ -0,0 +1,19 @@ +---@brief +--- +--- https://github.com/microsoft/compose-language-service +--- This project contains a language service for Docker Compose. +--- +--- `compose-language-service` can be installed via `npm`: +--- +--- ```sh +--- npm install @microsoft/compose-language-service +--- ``` +--- +--- Note: If the docker-compose-langserver doesn't startup when entering a `docker-compose.yaml` file, make sure that the filetype is `yaml.docker-compose`. You can set with: `:set filetype=yaml.docker-compose`. + +---@type vim.lsp.Config +return { + cmd = { 'docker-compose-langserver', '--stdio' }, + filetypes = { 'yaml.docker-compose' }, + root_markers = { 'docker-compose.yaml', 'docker-compose.yml', 'compose.yaml', 'compose.yml' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/docker_language_server.lua b/arch/lightvim/.config/lightvim/lsp/docker_language_server.lua new file mode 100644 index 0000000..695d51a --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/docker_language_server.lua @@ -0,0 +1,32 @@ +---@brief +--- +--- https://github.com/docker/docker-language-server +--- +--- `docker-langserver-server` can be installed via `go`: +--- ```sh +--- go install github.com/docker/docker-language-server/cmd/docker-language-server@latest +--- ``` + +---@type vim.lsp.Config +return { + cmd = { 'docker-language-server', 'start', '--stdio' }, + filetypes = { 'dockerfile', 'yaml.docker-compose' }, + get_language_id = function(_, ftype) + if ftype == 'yaml.docker-compose' or ftype:lower():find('ya?ml') then + return 'dockercompose' + else + return ftype + end + end, + root_markers = { + 'Dockerfile', + 'docker-compose.yaml', + 'docker-compose.yml', + 'compose.yaml', + 'compose.yml', + 'docker-bake.json', + 'docker-bake.hcl', + 'docker-bake.override.json', + 'docker-bake.override.hcl', + }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/dockerls.lua b/arch/lightvim/.config/lightvim/lsp/dockerls.lua new file mode 100644 index 0000000..ee17ed1 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/dockerls.lua @@ -0,0 +1,30 @@ +---@brief +--- +--- https://github.com/rcjsuen/dockerfile-language-server-nodejs +--- +--- `docker-langserver` can be installed via `npm`: +--- ```sh +--- npm install -g dockerfile-language-server-nodejs +--- ``` +--- +--- Additional configuration can be applied in the following way: +--- ```lua +--- vim.lsp.config('dockerls', { +--- settings = { +--- docker = { +--- languageserver = { +--- formatter = { +--- ignoreMultilineInstructions = true, +--- }, +--- }, +--- } +--- } +--- }) +--- ``` + +---@type vim.lsp.Config +return { + cmd = { 'docker-langserver', '--stdio' }, + filetypes = { 'dockerfile' }, + root_markers = { 'Dockerfile' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/dolmenls.lua b/arch/lightvim/.config/lightvim/lsp/dolmenls.lua new file mode 100644 index 0000000..de240da --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/dolmenls.lua @@ -0,0 +1,15 @@ +---@brief +--- +--- https://github.com/Gbury/dolmen/blob/master/doc/lsp.md +--- +--- `dolmenls` can be installed via `opam` +--- ```sh +--- opam install dolmen_lsp +--- ``` + +---@type vim.lsp.Config +return { + cmd = { 'dolmenls' }, + filetypes = { 'smt2', 'tptp', 'p', 'cnf', 'icnf', 'zf' }, + root_markers = { '.git' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/dotls.lua b/arch/lightvim/.config/lightvim/lsp/dotls.lua new file mode 100644 index 0000000..51fca6e --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/dotls.lua @@ -0,0 +1,15 @@ +---@brief +--- +--- https://github.com/nikeee/dot-language-server +--- +--- `dot-language-server` can be installed via `npm`: +--- ```sh +--- npm install -g dot-language-server +--- ``` + +---@type vim.lsp.Config +return { + cmd = { 'dot-language-server', '--stdio' }, + filetypes = { 'dot' }, + root_markers = { '.git' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/dprint.lua b/arch/lightvim/.config/lightvim/lsp/dprint.lua new file mode 100644 index 0000000..31acacd --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/dprint.lua @@ -0,0 +1,26 @@ +---@brief +--- +--- https://github.com/dprint/dprint +--- +--- Pluggable and configurable code formatting platform written in Rust. + +---@type vim.lsp.Config +return { + cmd = { 'dprint', 'lsp' }, + filetypes = { + 'javascript', + 'javascriptreact', + 'typescript', + 'typescriptreact', + 'json', + 'jsonc', + 'markdown', + 'python', + 'toml', + 'rust', + 'roslyn', + 'graphql', + }, + root_markers = { 'dprint.json', '.dprint.json', 'dprint.jsonc', '.dprint.jsonc' }, + settings = {}, +} diff --git a/arch/lightvim/.config/lightvim/lsp/ds_pinyin_lsp.lua b/arch/lightvim/.config/lightvim/lsp/ds_pinyin_lsp.lua new file mode 100644 index 0000000..84bf67e --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/ds_pinyin_lsp.lua @@ -0,0 +1,69 @@ +---@brief +--- +--- https://github.com/iamcco/ds-pinyin-lsp +--- Dead simple Pinyin language server for input Chinese without IME(input method). +--- To install, download the latest [release](https://github.com/iamcco/ds-pinyin-lsp/releases) and ensure `ds-pinyin-lsp` is on your path. +--- And make ensure the database file `dict.db3` is also downloaded. And put the path to `dict.dbs` in the following code. +--- +--- ```lua +--- +--- vim.lsp.config('ds_pinyin_lsp', { +--- init_options = { +--- db_path = "your_path_to_database" +--- } +--- }) +--- +--- ``` + +local bin_name = 'ds-pinyin-lsp' +if vim.fn.has 'win32' == 1 then + bin_name = bin_name .. '.exe' +end + +local function ds_pinyin_lsp_off(bufnr) + local ds_pinyin_lsp_client = vim.lsp.get_clients({ bufnr = bufnr, name = 'ds_pinyin_lsp' })[1] + if ds_pinyin_lsp_client then + ---@diagnostic disable-next-line: param-type-mismatch + ds_pinyin_lsp_client:notify('$/turn/completion', { + ['completion_on'] = false, + }) + else + vim.notify 'notification $/turn/completion is not supported by any servers active on the current buffer' + end +end + +local function ds_pinyin_lsp_on(bufnr) + local ds_pinyin_lsp_client = vim.lsp.get_clients({ bufnr = bufnr, name = 'ds_pinyin_lsp' })[1] + if ds_pinyin_lsp_client then + ---@diagnostic disable-next-line: param-type-mismatch + ds_pinyin_lsp_client:notify('$/turn/completion', { + ['completion_on'] = true, + }) + else + vim.notify 'notification $/turn/completion is not supported by any servers active on the current buffer' + end +end + +---@type vim.lsp.Config +return { + cmd = { bin_name }, + filetypes = { 'markdown', 'org' }, + root_markers = { '.git' }, + init_options = { + completion_on = true, + show_symbols = true, + show_symbols_only_follow_by_hanzi = false, + show_symbols_by_n_times = 0, + match_as_same_as_input = true, + match_long_input = true, + max_suggest = 15, + }, + on_attach = function(_, bufnr) + vim.api.nvim_buf_create_user_command(bufnr, 'LspDsPinyinCompletionOff', function() + ds_pinyin_lsp_off(bufnr) + end, { desc = 'Turn off the ds-pinyin-lsp completion' }) + vim.api.nvim_buf_create_user_command(bufnr, 'LspDsPinyinCompletionOn', function() + ds_pinyin_lsp_on(bufnr) + end, { desc = 'Turn on the ds-pinyin-lsp completion' }) + end, +} diff --git a/arch/lightvim/.config/lightvim/lsp/dts_lsp.lua b/arch/lightvim/.config/lightvim/lsp/dts_lsp.lua new file mode 100644 index 0000000..dd9c4a8 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/dts_lsp.lua @@ -0,0 +1,22 @@ +---@brief +--- +--- `dts-lsp` is an LSP for Devicetree files built on top of tree-sitter-devicetree grammar. +--- Language servers can be used in many editors, such as Visual Studio Code, Emacs +--- or Vim +--- +--- Install `dts-lsp` from https://github.com/igor-prusov/dts-lsp and add it to path +--- +--- `dts-lsp` doesn't require any configuration. +--- +--- More about Devicetree: +--- https://www.devicetree.org/ +--- https://docs.zephyrproject.org/latest/build/dts/index.html + +---@type vim.lsp.Config +return { + name = 'dts_lsp', + cmd = { 'dts-lsp' }, + filetypes = { 'dts', 'dtsi', 'overlay' }, + root_markers = { '.git' }, + settings = {}, +} diff --git a/arch/lightvim/.config/lightvim/lsp/earthlyls.lua b/arch/lightvim/.config/lightvim/lsp/earthlyls.lua new file mode 100644 index 0000000..3beb399 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/earthlyls.lua @@ -0,0 +1,12 @@ +---@brief +--- +--- https://github.com/glehmann/earthlyls +--- +--- A fast language server for earthly. + +---@type vim.lsp.Config +return { + cmd = { 'earthlyls' }, + filetypes = { 'earthfile' }, + root_markers = { 'Earthfile' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/ecsact.lua b/arch/lightvim/.config/lightvim/lsp/ecsact.lua new file mode 100644 index 0000000..b59aad4 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/ecsact.lua @@ -0,0 +1,15 @@ +---@brief +--- +--- https://github.com/ecsact-dev/ecsact_lsp_server +--- +--- Language server for Ecsact. +--- +--- The default cmd assumes `ecsact_lsp_server` is in your PATH. Typically from the +--- Ecsact SDK: https://ecsact.dev/start + +---@type vim.lsp.Config +return { + cmd = { 'ecsact_lsp_server', '--stdio' }, + filetypes = { 'ecsact' }, + root_markers = { '.git' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/efm.lua b/arch/lightvim/.config/lightvim/lsp/efm.lua new file mode 100644 index 0000000..d421669 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/efm.lua @@ -0,0 +1,25 @@ +--- @brief +--- +--- https://github.com/mattn/efm-langserver +--- +--- General purpose Language Server that can use specified error message format generated from specified command. +--- +--- Requires at minimum EFM version [v0.0.38](https://github.com/mattn/efm-langserver/releases/tag/v0.0.38) to support +--- launching the language server on single files. +--- +--- Note: In order for neovim's built-in language server client to send the appropriate `languageId` to EFM, **you must +--- specify `filetypes` in your call to `vim.lsp.config`**. Otherwise the server will be launch on the `BufEnter` instead +--- of the `FileType` autocommand, and the `filetype` variable used to populate the `languageId` will not yet be set. +--- +--- ```lua +--- vim.lsp.config('efm', { +--- filetypes = { 'python','cpp','lua' } +--- settings = ..., -- You must populate this according to the EFM readme +--- }) +--- ``` + +---@type vim.lsp.Config +return { + cmd = { 'efm-langserver' }, + root_markers = { '.git' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/elixirls.lua b/arch/lightvim/.config/lightvim/lsp/elixirls.lua new file mode 100644 index 0000000..c5f21c0 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/elixirls.lua @@ -0,0 +1,47 @@ +---@brief +--- +--- https://github.com/elixir-lsp/elixir-ls +--- +--- `elixir-ls` can be installed by following the instructions [here](https://github.com/elixir-lsp/elixir-ls#building-and-running). +--- +--- 1. Download the zip from https://github.com/elixir-lsp/elixir-ls/releases/latest/ +--- 2. Unzip it and make it executable. +--- ```bash +--- unzip elixir-ls.zip -d /path/to/elixir-ls +--- # Unix +--- chmod +x /path/to/elixir-ls/language_server.sh +--- ``` +--- +--- **By default, elixir-ls doesn't have a `cmd` set.** This is because nvim-lspconfig does not make assumptions about +--- your path. You must add the following to your init.vim or init.lua to set `cmd` to the absolute path ($HOME and +--- ~ are not expanded) of your unzipped elixir-ls. +--- +--- ```lua +--- vim.lsp.config('elixirls', { +--- -- Unix +--- cmd = { "/path/to/elixir-ls/language_server.sh" }; +--- -- Windows +--- cmd = { "/path/to/elixir-ls/language_server.bat" }; +--- ... +--- }) +--- ``` +--- +--- 'root_dir' is chosen like this: if two or more directories containing `mix.exs` were found when searching +--- directories upward, the second one (higher up) is chosen, with the assumption that it is the root of an umbrella +--- app. Otherwise the directory containing the single mix.exs that was found is chosen. + +---@type vim.lsp.Config +return { + cmd = { 'elixir-ls' }, + filetypes = { 'elixir', 'eelixir', 'heex', 'surface' }, + root_dir = function(bufnr, on_dir) + local fname = vim.api.nvim_buf_get_name(bufnr) + --- Elixir workspaces may have multiple `mix.exs` files, for an "umbrella" layout or monorepo. + --- So we specify `limit=2` and treat the highest one (if any) as the root of an umbrella app. + local matches = vim.fs.find({ 'mix.exs' }, { upward = true, limit = 2, path = fname }) + local child_or_root_path, maybe_umbrella_path = unpack(matches) + local root_dir = vim.fs.dirname(maybe_umbrella_path or child_or_root_path) + + on_dir(root_dir) + end, +} diff --git a/arch/lightvim/.config/lightvim/lsp/elmls.lua b/arch/lightvim/.config/lightvim/lsp/elmls.lua new file mode 100644 index 0000000..8a76f81 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/elmls.lua @@ -0,0 +1,35 @@ +---@brief +--- +--- https://github.com/elm-tooling/elm-language-server#installation +--- +--- If you don't want to use Nvim to install it, then you can use: +--- ```sh +--- npm install -g elm elm-test elm-format @elm-tooling/elm-language-server +--- ``` + +local api = vim.api + +---@type vim.lsp.Config +return { + cmd = { 'elm-language-server' }, + -- TODO(ashkan) if we comment this out, it will allow elmls to operate on elm.json. It seems like it could do that, but no other editor allows it right now. + filetypes = { 'elm' }, + root_dir = function(bufnr, on_dir) + local fname = api.nvim_buf_get_name(bufnr) + local filetype = vim.bo[bufnr].filetype + if filetype == 'elm' or (filetype == 'json' and fname:match 'elm%.json$') then + on_dir(vim.fs.root(fname, 'elm.json')) + return + end + on_dir(nil) + end, + init_options = { + elmReviewDiagnostics = 'off', -- 'off' | 'warning' | 'error' + skipInstallPackageConfirmation = false, + disableElmLSDiagnostics = false, + onlyUpdateDiagnosticsOnSave = false, + }, + capabilities = { + offsetEncoding = { 'utf-8', 'utf-16' }, + }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/elp.lua b/arch/lightvim/.config/lightvim/lsp/elp.lua new file mode 100644 index 0000000..38c0716 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/elp.lua @@ -0,0 +1,13 @@ +---@brief +--- +--- https://whatsapp.github.io/erlang-language-platform +--- +--- ELP integrates Erlang into modern IDEs via the language server protocol and was +--- inspired by rust-analyzer. + +---@type vim.lsp.Config +return { + cmd = { 'elp', 'server' }, + filetypes = { 'erlang' }, + root_markers = { 'rebar.config', 'erlang.mk', '.git' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/ember.lua b/arch/lightvim/.config/lightvim/lsp/ember.lua new file mode 100644 index 0000000..9d1ec2a --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/ember.lua @@ -0,0 +1,16 @@ +---@brief +--- +--- https://github.com/ember-tooling/ember-language-server +--- +--- `ember-language-server` can be installed via `npm`: +--- +--- ```sh +--- npm install -g @ember-tooling/ember-language-server +--- ``` + +---@type vim.lsp.Config +return { + cmd = { 'ember-language-server', '--stdio' }, + filetypes = { 'handlebars', 'typescript', 'javascript', 'typescript.glimmer', 'javascript.glimmer' }, + root_markers = { 'ember-cli-build.js', '.git' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/emmet_language_server.lua b/arch/lightvim/.config/lightvim/lsp/emmet_language_server.lua new file mode 100644 index 0000000..d508a24 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/emmet_language_server.lua @@ -0,0 +1,29 @@ +---@brief +--- +--- https://github.com/olrtg/emmet-language-server +--- +--- Package can be installed via `npm`: +--- ```sh +--- npm install -g @olrtg/emmet-language-server +--- ``` + +---@type vim.lsp.Config +return { + cmd = { 'emmet-language-server', '--stdio' }, + filetypes = { + 'astro', + 'css', + 'eruby', + 'html', + 'htmlangular', + 'htmldjango', + 'javascriptreact', + 'less', + 'sass', + 'scss', + 'svelte', + 'typescriptreact', + 'vue', + }, + root_markers = { '.git' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/emmet_ls.lua b/arch/lightvim/.config/lightvim/lsp/emmet_ls.lua new file mode 100644 index 0000000..7bfede0 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/emmet_ls.lua @@ -0,0 +1,31 @@ +---@brief +--- +--- https://github.com/aca/emmet-ls +--- +--- Package can be installed via `npm`: +--- ```sh +--- npm install -g emmet-ls +--- ``` + +---@type vim.lsp.Config +return { + cmd = { 'emmet-ls', '--stdio' }, + filetypes = { + 'astro', + 'css', + 'eruby', + 'html', + 'htmlangular', + 'htmldjango', + 'javascriptreact', + 'less', + 'pug', + 'sass', + 'scss', + 'svelte', + 'templ', + 'typescriptreact', + 'vue', + }, + root_markers = { '.git' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/emmylua_ls.lua b/arch/lightvim/.config/lightvim/lsp/emmylua_ls.lua new file mode 100644 index 0000000..5621469 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/emmylua_ls.lua @@ -0,0 +1,24 @@ +---@brief +--- +--- https://github.com/EmmyLuaLs/emmylua-analyzer-rust +--- +--- Emmylua Analyzer Rust. Language Server for Lua. +--- +--- `emmylua_ls` can be installed using `cargo` by following the instructions[here] +--- (https://github.com/EmmyLuaLs/emmylua-analyzer-rust?tab=readme-ov-file#install). +--- +--- The default `cmd` assumes that the `emmylua_ls` binary can be found in `$PATH`. +--- It might require you to provide cargo binaries installation path in it. + +---@type vim.lsp.Config +return { + cmd = { 'emmylua_ls' }, + filetypes = { 'lua' }, + root_markers = { + '.luarc.json', + '.emmyrc.json', + '.luacheckrc', + '.git', + }, + workspace_required = false, +} diff --git a/arch/lightvim/.config/lightvim/lsp/erg_language_server.lua b/arch/lightvim/.config/lightvim/lsp/erg_language_server.lua new file mode 100644 index 0000000..4537072 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/erg_language_server.lua @@ -0,0 +1,19 @@ +---@brief +--- +--- https://github.com/erg-lang/erg#flags ELS +--- +--- ELS (erg-language-server) is a language server for the Erg programming language. +--- +--- erg-language-server can be installed via `cargo` and used as follows: +--- +--- ```sh +--- cargo install erg --features els +--- erg --language-server +--- ``` + +---@type vim.lsp.Config +return { + cmd = { 'erg', '--language-server' }, + filetypes = { 'erg' }, + root_markers = { 'package.er', '.git' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/esbonio.lua b/arch/lightvim/.config/lightvim/lsp/esbonio.lua new file mode 100644 index 0000000..0f1a49c --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/esbonio.lua @@ -0,0 +1,51 @@ +---@brief +--- +--- https://github.com/swyddfa/esbonio +--- +--- Esbonio is a language server for [Sphinx](https://www.sphinx-doc.org/en/master/) documentation projects. +--- The language server can be installed via pip +--- +--- ``` +--- pip install esbonio +--- ``` +--- +--- Since Sphinx is highly extensible you will get best results if you install the language server in the same +--- Python environment as the one used to build your documentation. To ensure that the correct Python environment +--- is picked up, you can either launch `nvim` with the correct environment activated. +--- +--- ``` +--- source env/bin/activate +--- nvim +--- ``` +--- +--- Or you can modify the default `cmd` to include the full path to the Python interpreter. +--- +--- ```lua +--- vim.lsp.config('esbonio', { +--- cmd = { '/path/to/virtualenv/bin/python', '-m', 'esbonio.server' } +--- }) +--- ``` +--- +--- Esbonio supports a number of config values passed as `init_options` on startup, for example. +--- +--- ```lua +--- vim.lsp.config('esbonio', { +--- init_options = { +--- server = { +--- logLevel = "debug" +--- }, +--- sphinx = { +--- confDir = "/path/to/docs", +--- srcDir = "${confDir}/../docs-src" +--- } +--- }) +--- ``` +--- +--- A full list and explanation of the available options can be found [here](https://docs.esbon.io/en/esbonio-language-server-v0.16.4/lsp/getting-started.html?editor=neovim-lspconfig#configuration) + +---@type vim.lsp.Config +return { + cmd = { 'python3', '-m', 'esbonio.server' }, + filetypes = { 'rst' }, + root_markers = { '.git' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/eslint.lua b/arch/lightvim/.config/lightvim/lsp/eslint.lua new file mode 100644 index 0000000..d18b2ca --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/eslint.lua @@ -0,0 +1,231 @@ +--- @brief +--- +--- https://github.com/hrsh7th/vscode-langservers-extracted +--- +--- `vscode-eslint-language-server` is a linting engine for JavaScript / Typescript. +--- It can be installed via `npm`: +--- +--- ```sh +--- npm i -g vscode-langservers-extracted +--- ``` +--- +--- The default `on_attach` config provides the `LspEslintFixAll` command that can be used to format a document on save: +--- ```lua +--- local base_on_attach = vim.lsp.config.eslint.on_attach +--- vim.lsp.config("eslint", { +--- on_attach = function(client, bufnr) +--- if not base_on_attach then return end +--- +--- base_on_attach(client, bufnr) +--- vim.api.nvim_create_autocmd("BufWritePre", { +--- buffer = bufnr, +--- command = "LspEslintFixAll", +--- }) +--- end, +--- }) +--- ``` +--- +--- See [vscode-eslint](https://github.com/microsoft/vscode-eslint/blob/55871979d7af184bf09af491b6ea35ebd56822cf/server/src/eslintServer.ts#L216-L229) for configuration options. +--- +--- Messages handled in lspconfig: `eslint/openDoc`, `eslint/confirmESLintExecution`, `eslint/probeFailed`, `eslint/noLibrary` +--- +--- Additional messages you can handle: `eslint/noConfig` +--- +--- ### Monorepo support +--- +--- `vscode-eslint-language-server` supports monorepos by default. It will automatically find the config file corresponding to the package you are working on. You can use different configs in different packages. +--- This works without the need of spawning multiple instances of `vscode-eslint-language-server`. +--- You can use a different version of ESLint in each package, but it is recommended to use the same version of ESLint in all packages. The location of the ESLint binary will be determined automatically. +--- +--- /!\ When using flat config files, you need to use them across all your packages in your monorepo, as it's a global setting for the server. +--- +--- ### Flat config in ESLint versions prior to 10.0 +--- +--- If you're using a ESLint version that supports both flat config and eslintrc (>= 8.21, < 10.0) and want to change +--- the [default behavior](https://eslint.org/blog/2023/10/flat-config-rollout-plans/), you'll need to set +--- `experimental.useFlatConfig` accordingly: +--- ```lua +--- vim.lsp.config("eslint", { +--- settings = { +--- experimental = { +--- -- If you want to use flat config on >= 8.21, < 9.0 +--- useFlatConfig = true, +--- -- Or if you want to use eslintrc on 9.* +--- -- useFlatConfig = false, +--- } +--- } +--- }) +--- ``` + +local util = require 'lspconfig.util' +local lsp = vim.lsp + +local eslint_config_files = { + '.eslintrc', + '.eslintrc.js', + '.eslintrc.cjs', + '.eslintrc.yaml', + '.eslintrc.yml', + '.eslintrc.json', + 'eslint.config.js', + 'eslint.config.mjs', + 'eslint.config.cjs', + 'eslint.config.ts', + 'eslint.config.mts', + 'eslint.config.cts', +} + +---@type vim.lsp.Config +return { + cmd = function(dispatchers, config) + local cmd = 'vscode-eslint-language-server' + if (config or {}).root_dir then + local local_cmd = vim.fs.joinpath(config.root_dir, 'node_modules/.bin', cmd) + if vim.fn.executable(local_cmd) == 1 then + cmd = local_cmd + end + end + return vim.lsp.rpc.start({ cmd, '--stdio' }, dispatchers) + end, + filetypes = { + 'javascript', + 'javascriptreact', + 'typescript', + 'typescriptreact', + 'vue', + 'svelte', + 'astro', + 'htmlangular', + }, + workspace_required = true, + on_attach = function(client, bufnr) + vim.api.nvim_buf_create_user_command(bufnr, 'LspEslintFixAll', function() + client:request_sync('workspace/executeCommand', { + command = 'eslint.applyAllFixes', + arguments = { + { + uri = vim.uri_from_bufnr(bufnr), + version = lsp.util.buf_versions[bufnr], + }, + }, + }, nil, bufnr) + end, {}) + end, + root_dir = function(bufnr, on_dir) + -- The project root is where the LSP can be started from + -- As stated in the documentation above, this LSP supports monorepos and simple projects. + -- We select then from the project root, which is identified by the presence of a package + -- manager lock file. + local root_markers = { 'package-lock.json', 'yarn.lock', 'pnpm-lock.yaml', 'bun.lockb', 'bun.lock' } + -- Give the root markers equal priority by wrapping them in a table + root_markers = vim.fn.has('nvim-0.11.3') == 1 and { root_markers, { '.git' } } + or vim.list_extend(root_markers, { '.git' }) + + -- exclude deno + if vim.fs.root(bufnr, { 'deno.json', 'deno.jsonc', 'deno.lock' }) then + return + end + + -- We fallback to the current working directory if no project root is found + local project_root = vim.fs.root(bufnr, root_markers) or vim.fn.getcwd() + + -- We know that the buffer is using ESLint if it has a config file + -- in its directory tree. + -- + -- Eslint used to support package.json files as config files, but it doesn't anymore. + -- We keep this for backward compatibility. + local filename = vim.api.nvim_buf_get_name(bufnr) + local eslint_config_files_with_package_json = + util.insert_package_json(eslint_config_files, 'eslintConfig', filename) + local is_buffer_using_eslint = vim.fs.find(eslint_config_files_with_package_json, { + path = filename, + type = 'file', + limit = 1, + upward = true, + stop = vim.fs.dirname(project_root), + })[1] + if not is_buffer_using_eslint then + return + end + + on_dir(project_root) + end, + -- Refer to https://github.com/Microsoft/vscode-eslint#settings-options for documentation. + ---@type lspconfig.settings.eslint + settings = { + validate = 'on', + ---@diagnostic disable-next-line: assign-type-mismatch + packageManager = nil, + useESLintClass = false, + experimental = {}, + codeActionOnSave = { + enable = false, + mode = 'all', + }, + format = true, + quiet = false, + onIgnoredFiles = 'off', + rulesCustomizations = {}, + run = 'onType', + problems = { + shortenToSingleLine = false, + }, + -- nodePath configures the directory in which the eslint server should start its node_modules resolution. + -- This path is relative to the workspace folder (root dir) of the server instance. + nodePath = '', + -- use the workspace folder location or the file location (if no workspace folder is open) as the working directory + workingDirectory = { mode = 'auto' }, + codeAction = { + disableRuleComment = { + enable = true, + location = 'separateLine', + }, + showDocumentation = { + enable = true, + }, + }, + }, + before_init = function(_, config) + -- The "workspaceFolder" is a VSCode concept. It limits how far the + -- server will traverse the file system when locating the ESLint config + -- file (e.g., .eslintrc). + local root_dir = config.root_dir + + if root_dir then + config.settings = config.settings or {} + config.settings.workspaceFolder = { + uri = root_dir, + name = vim.fn.fnamemodify(root_dir, ':t'), + } + + -- Support Yarn2 (PnP) projects + local pnp_cjs = root_dir .. '/.pnp.cjs' + local pnp_js = root_dir .. '/.pnp.js' + if type(config.cmd) == 'table' and (vim.uv.fs_stat(pnp_cjs) or vim.uv.fs_stat(pnp_js)) then + config.cmd = vim.list_extend({ 'yarn', 'exec' }, config.cmd --[[@as table]]) + end + end + end, + handlers = { + ['eslint/openDoc'] = function(_, result) + if result then + vim.ui.open(result.url) + end + return {} + end, + ['eslint/confirmESLintExecution'] = function(_, result) + if not result then + return + end + return 4 -- approved + end, + ['eslint/probeFailed'] = function() + vim.notify('[lspconfig] ESLint probe failed.', vim.log.levels.WARN) + return {} + end, + ['eslint/noLibrary'] = function() + vim.notify('[lspconfig] Unable to find ESLint library.', vim.log.levels.WARN) + return {} + end, + }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/expert.lua b/arch/lightvim/.config/lightvim/lsp/expert.lua new file mode 100644 index 0000000..2386e2d --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/expert.lua @@ -0,0 +1,26 @@ +---@brief +--- +--- https://github.com/expert-lsp/expert +--- +--- Expert is the official language server implementation for the Elixir programming language. +--- +--- 'root_dir' is chosen like this: if two or more directories containing `mix.exs` were found when +--- searching directories upward, the second one (higher up) is chosen, with the assumption that it +--- is the root of an umbrella app. Otherwise the directory containing the single mix.exs that was +--- found is chosen. + +---@type vim.lsp.Config +return { + filetypes = { 'elixir', 'eelixir', 'heex', 'surface' }, + cmd = { 'expert', '--stdio' }, + root_dir = function(bufnr, on_dir) + local fname = vim.api.nvim_buf_get_name(bufnr) + --- Elixir workspaces may have multiple `mix.exs` files, for an "umbrella" layout or monorepo. + --- So we specify `limit=2` and treat the highest one (if any) as the root of an umbrella app. + local matches = vim.fs.find({ 'mix.exs' }, { upward = true, limit = 2, path = fname }) + local child_or_root_path, maybe_umbrella_path = unpack(matches) + local root_dir = vim.fs.dirname(maybe_umbrella_path or child_or_root_path) + + on_dir(root_dir) + end, +} diff --git a/arch/lightvim/.config/lightvim/lsp/facility_language_server.lua b/arch/lightvim/.config/lightvim/lsp/facility_language_server.lua new file mode 100644 index 0000000..7a03b87 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/facility_language_server.lua @@ -0,0 +1,12 @@ +---@brief +--- +--- https://github.com/FacilityApi/FacilityLanguageServer +--- +--- Facility language server protocol (LSP) support. + +---@type vim.lsp.Config +return { + cmd = { 'facility-language-server' }, + filetypes = { 'fsd' }, + root_markers = { '.git' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/fennel_language_server.lua b/arch/lightvim/.config/lightvim/lsp/fennel_language_server.lua new file mode 100644 index 0000000..8ddf799 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/fennel_language_server.lua @@ -0,0 +1,13 @@ +---@brief +--- +--- https://github.com/rydesun/fennel-language-server +--- +--- Fennel language server protocol (LSP) support. + +---@type vim.lsp.Config +return { + cmd = { 'fennel-language-server' }, + filetypes = { 'fennel' }, + root_markers = { '.git' }, + settings = {}, +} diff --git a/arch/lightvim/.config/lightvim/lsp/fennel_ls.lua b/arch/lightvim/.config/lightvim/lsp/fennel_ls.lua new file mode 100644 index 0000000..acd9341 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/fennel_ls.lua @@ -0,0 +1,26 @@ +---@brief +--- +--- https://sr.ht/~xerool/fennel-ls/ +--- +--- A language server for fennel. +--- +--- fennel-ls is configured using the closest file to your working directory named `flsproject.fnl`. +--- All fennel-ls configuration options [can be found here](https://git.sr.ht/~xerool/fennel-ls/tree/HEAD/docs/manual.md#configuration). + +---@type vim.lsp.Config +return { + cmd = { 'fennel-ls' }, + filetypes = { 'fennel' }, + root_dir = function(bufnr, on_dir) + local fname = vim.api.nvim_buf_get_name(bufnr) + local has_fls_project_cfg = function(path) + local fnlpath = vim.fs.joinpath(path, 'flsproject.fnl') + return (vim.uv.fs_stat(fnlpath) or {}).type == 'file' + end + on_dir(vim.iter(vim.fs.parents(fname)):find(has_fls_project_cfg) or vim.fs.root(0, '.git')) + end, + settings = {}, + capabilities = { + offsetEncoding = { 'utf-8', 'utf-16' }, + }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/fish_lsp.lua b/arch/lightvim/.config/lightvim/lsp/fish_lsp.lua new file mode 100644 index 0000000..05d5cf9 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/fish_lsp.lua @@ -0,0 +1,17 @@ +---@brief +--- +--- https://github.com/ndonfris/fish-lsp +--- +--- A Language Server Protocol (LSP) tailored for the fish shell. +--- This project aims to enhance the coding experience for fish, +--- by introducing a suite of intelligent features like auto-completion, +--- scope aware symbol analysis, per-token hover generation, and many others. +--- +--- [homepage](https://www.fish-lsp.dev/) + +---@type vim.lsp.Config +return { + cmd = { 'fish-lsp', 'start' }, + filetypes = { 'fish' }, + root_markers = { 'config.fish', '.git' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/flow.lua b/arch/lightvim/.config/lightvim/lsp/flow.lua new file mode 100644 index 0000000..183606d --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/flow.lua @@ -0,0 +1,29 @@ +---@brief +--- +--- https://flow.org/ +--- https://github.com/facebook/flow +--- +--- See below for how to setup Flow itself. +--- https://flow.org/en/docs/install/ +--- +--- See below for lsp command options. +--- +--- ```sh +--- npx flow lsp --help +--- ``` + +---@type vim.lsp.Config +return { + cmd = function(dispatchers) + local cmd = nil + if vim.fn.executable('flow') == 1 then + cmd = { 'flow', 'lsp' } + else + cmd = { 'npx', '--no-install', 'flow', 'lsp' } + end + + return vim.lsp.rpc.start(cmd, dispatchers) + end, + filetypes = { 'javascript', 'javascriptreact' }, + root_markers = { '.flowconfig' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/flux_lsp.lua b/arch/lightvim/.config/lightvim/lsp/flux_lsp.lua new file mode 100644 index 0000000..c21319a --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/flux_lsp.lua @@ -0,0 +1,14 @@ +---@brief +--- +--- https://github.com/influxdata/flux-lsp +--- `flux-lsp` can be installed via `cargo`: +--- ```sh +--- cargo install --git https://github.com/influxdata/flux-lsp +--- ``` + +---@type vim.lsp.Config +return { + cmd = { 'flux-lsp' }, + filetypes = { 'flux' }, + root_markers = { '.git' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/foam_ls.lua b/arch/lightvim/.config/lightvim/lsp/foam_ls.lua new file mode 100644 index 0000000..636b066 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/foam_ls.lua @@ -0,0 +1,29 @@ +---@brief +--- +--- https://github.com/FoamScience/foam-language-server +--- +--- `foam-language-server` can be installed via `npm` +--- ```sh +--- npm install -g foam-language-server +--- ``` + +---@type vim.lsp.Config +return { + cmd = { 'foam-ls', '--stdio' }, + filetypes = { 'foam', 'OpenFOAM' }, + root_dir = function(bufnr, on_dir) + local fname = vim.api.nvim_buf_get_name(bufnr) + for path in vim.fs.parents(fname) do + if vim.uv.fs_stat(path .. '/system/controlDict') then + on_dir(path) + return + end + end + local git_root = vim.fs.root(bufnr, { '.git' }) + if git_root then + on_dir(git_root) + return + end + on_dir(vim.fs.dirname(fname)) + end, +} diff --git a/arch/lightvim/.config/lightvim/lsp/fortitude.lua b/arch/lightvim/.config/lightvim/lsp/fortitude.lua new file mode 100644 index 0000000..5773949 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/fortitude.lua @@ -0,0 +1,30 @@ +---@brief +--- +--- https://fortitude.readthedocs.io/en/stable/ +--- +--- Fortitude is a Fortran linter built in Rust and inspired by (and build upon) Ruff +--- +--- ```sh +--- # Install With uv: +--- uv tool install fortitude-lint@latest +--- +--- # Install with pip: +--- pip install fortitude-lint +--- ``` +--- +--- **LSP is available in Fortitude `v0.8.0`.** +--- +--- Refer to the [documentation](https://fortitude.readthedocs.io/en/stable/editors/) for more details. + +---@type vim.lsp.Config +return { + cmd = { 'fortitude', 'server' }, + filetypes = { 'fortran' }, + root_markers = { + 'fpm.toml', + 'fortitude.toml', + '.fortitude.toml', + '.git', + }, + settings = {}, +} diff --git a/arch/lightvim/.config/lightvim/lsp/fortls.lua b/arch/lightvim/.config/lightvim/lsp/fortls.lua new file mode 100644 index 0000000..989a5f8 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/fortls.lua @@ -0,0 +1,27 @@ +---@brief +--- +--- https://fortls.fortran-lang.org/index.html +--- +--- fortls is a Fortran Language Server, the server can be installed via pip +--- +--- ```sh +--- pip install fortls +--- ``` +--- +--- Settings to the server can be passed either through the `cmd` option or through +--- a local configuration file e.g. `.fortls`. For more information +--- see the `fortls` [documentation](https://fortls.fortran-lang.org/options.html). + +---@type vim.lsp.Config +return { + cmd = { + 'fortls', + '--notify_init', + '--hover_signature', + '--hover_language=fortran', + '--use_signature_help', + }, + filetypes = { 'fortran' }, + root_markers = { '.fortls', '.fortlsrc', '.fortls.json', '.git' }, + settings = {}, +} diff --git a/arch/lightvim/.config/lightvim/lsp/fsautocomplete.lua b/arch/lightvim/.config/lightvim/lsp/fsautocomplete.lua new file mode 100644 index 0000000..950f432 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/fsautocomplete.lua @@ -0,0 +1,55 @@ +---@brief +--- +--- https://github.com/fsharp/FsAutoComplete +--- +--- Language Server for F# provided by FsAutoComplete (FSAC). +--- +--- FsAutoComplete requires the [dotnet-sdk](https://dotnet.microsoft.com/download) to be installed. +--- +--- The preferred way to install FsAutoComplete is with `dotnet tool install --global fsautocomplete`. +--- +--- Instructions to compile from source are found on the main [repository](https://github.com/fsharp/FsAutoComplete). +--- +--- You may also need to configure the filetype as Vim defaults to Forth for `*.fs` files: +--- +--- `autocmd BufNewFile,BufRead *.fs,*.fsx,*.fsi set filetype=fsharp` +--- +--- This is automatically done by plugins such as [PhilT/vim-fsharp](https://github.com/PhilT/vim-fsharp), [fsharp/vim-fsharp](https://github.com/fsharp/vim-fsharp), and [adelarsq/neofsharp.vim](https://github.com/adelarsq/neofsharp.vim). +--- + +local util = require 'lspconfig.util' + +---@type vim.lsp.Config +return { + cmd = { 'fsautocomplete', '--adaptive-lsp-server-enabled' }, + root_dir = function(bufnr, on_dir) + local fname = vim.api.nvim_buf_get_name(bufnr) + on_dir(util.root_pattern('*.sln', '*.slnx', '*.fsproj', '.git')(fname)) + end, + filetypes = { 'fsharp' }, + init_options = { + AutomaticWorkspaceInit = true, + }, + -- this recommended settings values taken from https://github.com/ionide/FsAutoComplete?tab=readme-ov-file#settings + ---@type lspconfig.settings.fsautocomplete + settings = { + FSharp = { + keywordsAutocomplete = true, + ExternalAutocomplete = false, + Linter = true, + UnionCaseStubGeneration = true, + UnionCaseStubGenerationBody = 'failwith "Not Implemented"', + RecordStubGeneration = true, + RecordStubGenerationBody = 'failwith "Not Implemented"', + InterfaceStubGeneration = true, + InterfaceStubGenerationObjectIdentifier = 'this', + InterfaceStubGenerationMethodBody = 'failwith "Not Implemented"', + UnusedOpensAnalyzer = true, + UnusedDeclarationsAnalyzer = true, + UseSdkScripts = true, + SimplifyNameAnalyzer = true, + ResolveNamespaces = true, + EnableReferenceCodeLens = true, + }, + }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/fsharp_language_server.lua b/arch/lightvim/.config/lightvim/lsp/fsharp_language_server.lua new file mode 100644 index 0000000..b1de1f7 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/fsharp_language_server.lua @@ -0,0 +1,30 @@ +---@brief +--- +--- F# Language Server +--- https://github.com/faldor20/fsharp-language-server +--- +--- An implementation of the language server protocol using the F# Compiler Service. +--- +--- Build the project from source and override the command path to location of DLL. +--- +--- If filetype determination is not already performed by an available plugin ([PhilT/vim-fsharp](https://github.com/PhilT/vim-fsharp), [fsharp/vim-fsharp](https://github.com/fsharp/vim-fsharp), and [adelarsq/neofsharp.vim](https://github.com/adelarsq/neofsharp.vim). +--- ), then the following must be added to initialization configuration: +--- +--- +--- `autocmd BufNewFile,BufRead *.fs,*.fsx,*.fsi set filetype=fsharp` + +local util = require 'lspconfig.util' + +---@type vim.lsp.Config +return { + cmd = { 'dotnet', 'FSharpLanguageServer.dll' }, + root_dir = function(bufnr, on_dir) + local fname = vim.api.nvim_buf_get_name(bufnr) + on_dir(util.root_pattern('*.sln', '*.fsproj', '.git')(fname)) + end, + filetypes = { 'fsharp' }, + init_options = { + AutomaticWorkspaceInit = true, + }, + settings = {}, +} diff --git a/arch/lightvim/.config/lightvim/lsp/fstar.lua b/arch/lightvim/.config/lightvim/lsp/fstar.lua new file mode 100644 index 0000000..749460f --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/fstar.lua @@ -0,0 +1,12 @@ +---@brief +--- +--- https://github.com/FStarLang/FStar +--- +--- LSP support is included in FStar. Make sure `fstar.exe` is in your PATH. + +---@type vim.lsp.Config +return { + cmd = { 'fstar.exe', '--lsp' }, + filetypes = { 'fstar' }, + root_markers = { '.git' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/futhark_lsp.lua b/arch/lightvim/.config/lightvim/lsp/futhark_lsp.lua new file mode 100644 index 0000000..351dda3 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/futhark_lsp.lua @@ -0,0 +1,17 @@ +---@brief +--- +--- https://github.com/diku-dk/futhark +--- +--- Futhark Language Server +--- +--- This language server comes with the futhark compiler and is run with the command +--- ``` +--- futhark lsp +--- ``` + +---@type vim.lsp.Config +return { + cmd = { 'futhark', 'lsp' }, + filetypes = { 'futhark', 'fut' }, + root_markers = { '.git' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/gdscript.lua b/arch/lightvim/.config/lightvim/lsp/gdscript.lua new file mode 100644 index 0000000..9b3c861 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/gdscript.lua @@ -0,0 +1,15 @@ +---@brief +--- +--- https://github.com/godotengine/godot +--- +--- Language server for GDScript, used by Godot Engine. + +local port = os.getenv 'GDScript_Port' or '6005' +local cmd = vim.lsp.rpc.connect('127.0.0.1', tonumber(port)) + +---@type vim.lsp.Config +return { + cmd = cmd, + filetypes = { 'gdscript' }, + root_markers = { 'project.godot', '.git' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/gdshader_lsp.lua b/arch/lightvim/.config/lightvim/lsp/gdshader_lsp.lua new file mode 100644 index 0000000..38a5637 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/gdshader_lsp.lua @@ -0,0 +1,12 @@ +---@brief +--- +--- https://github.com/godofavacyn/gdshader-lsp +--- +--- A language server for the Godot Shading language. + +---@type vim.lsp.Config +return { + cmd = { 'gdshader-lsp', '--stdio' }, + filetypes = { 'gdshader', 'gdshaderinc' }, + root_markers = { 'project.godot' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/gh_actions_ls.lua b/arch/lightvim/.config/lightvim/lsp/gh_actions_ls.lua new file mode 100644 index 0000000..f029ea7 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/gh_actions_ls.lua @@ -0,0 +1,57 @@ +---@brief +--- https://github.com/lttb/gh-actions-language-server +--- +--- Language server for GitHub Actions. +--- +--- The projects [forgejo](https://forgejo.org/) and [gitea](https://about.gitea.com/) +--- design their actions to be as compatible to github as possible +--- with only [a few differences](https://docs.gitea.com/usage/actions/comparison#unsupported-workflows-syntax) between the systems. +--- The `gh_actions_ls` is therefore enabled for those `yaml` files as well. +--- +--- The `gh-actions-language-server` can be installed via `npm`: +--- +--- ```sh +--- npm install -g gh-actions-language-server +--- ``` + +---@type vim.lsp.Config +return { + cmd = { 'gh-actions-language-server', '--stdio' }, + filetypes = { 'yaml' }, + + -- `root_dir` ensures that the LSP does not attach to all yaml files + root_dir = function(bufnr, on_dir) + local parent = vim.fs.dirname(vim.api.nvim_buf_get_name(bufnr)) + if + vim.endswith(parent, '/.github/workflows') + or vim.endswith(parent, '/.forgejo/workflows') + or vim.endswith(parent, '/.gitea/workflows') + then + on_dir(parent) + end + end, + handlers = { + ['actions/readFile'] = function(_, result) + if type(result.path) ~= 'string' then + return nil, nil + end + local file_path = vim.uri_to_fname(result.path) + if vim.fn.filereadable(file_path) == 1 then + local f = assert(io.open(file_path, 'r')) + local text = f:read('*a') + f:close() + + return text, nil + end + return nil, nil + end, + }, + init_options = {}, -- needs to be present https://github.com/neovim/nvim-lspconfig/pull/3713#issuecomment-2857394868 + capabilities = { + workspace = { + didChangeWorkspaceFolders = { + dynamicRegistration = true, + }, + }, + }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/ghcide.lua b/arch/lightvim/.config/lightvim/lsp/ghcide.lua new file mode 100644 index 0000000..39d4e47 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/ghcide.lua @@ -0,0 +1,13 @@ +---@brief +--- +--- https://github.com/digital-asset/ghcide +--- +--- A library for building Haskell IDE tooling. +--- "ghcide" isn't for end users now. Use "haskell-language-server" instead of "ghcide". + +---@type vim.lsp.Config +return { + cmd = { 'ghcide', '--lsp' }, + filetypes = { 'haskell', 'lhaskell' }, + root_markers = { 'stack.yaml', 'hie-bios', 'BUILD.bazel', 'cabal.config', 'package.yaml' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/ghdl_ls.lua b/arch/lightvim/.config/lightvim/lsp/ghdl_ls.lua new file mode 100644 index 0000000..3927cfe --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/ghdl_ls.lua @@ -0,0 +1,15 @@ +---@brief +--- +--- https://github.com/ghdl/ghdl-language-server +--- +--- A language server for VHDL, using ghdl as its backend. +--- +--- `ghdl-ls` is part of pyghdl, for installation instructions see +--- [the upstream README](https://github.com/ghdl/ghdl/tree/master/pyGHDL/lsp). + +---@type vim.lsp.Config +return { + cmd = { 'ghdl-ls' }, + filetypes = { 'vhdl' }, + root_markers = { 'hdl-prj.json', '.git' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/ginko_ls.lua b/arch/lightvim/.config/lightvim/lsp/ginko_ls.lua new file mode 100644 index 0000000..d9d95df --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/ginko_ls.lua @@ -0,0 +1,17 @@ +---@brief +--- +---`ginko_ls` is meant to be a feature-complete language server for device-trees. +--- Language servers can be used in many editors, such as Visual Studio Code, Emacs +--- or Vim +--- +--- Install `ginko_ls` from https://github.com/Schottkyc137/ginko and add it to path +--- +--- `ginko_ls` doesn't require any configuration. + +---@type vim.lsp.Config +return { + cmd = { 'ginko_ls' }, + filetypes = { 'dts' }, + root_markers = { '.git' }, + settings = {}, +} diff --git a/arch/lightvim/.config/lightvim/lsp/gitlab_ci_ls.lua b/arch/lightvim/.config/lightvim/lsp/gitlab_ci_ls.lua new file mode 100644 index 0000000..d2f80ab --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/gitlab_ci_ls.lua @@ -0,0 +1,26 @@ +---@brief +--- +--- https://github.com/alesbrelih/gitlab-ci-ls +--- +--- Language Server for Gitlab CI +--- +--- `gitlab-ci-ls` can be installed via cargo: +--- cargo install gitlab-ci-ls + +local util = require 'lspconfig.util' + +local cache_dir = vim.uv.os_homedir() .. '/.cache/gitlab-ci-ls/' + +---@type vim.lsp.Config +return { + cmd = { 'gitlab-ci-ls' }, + filetypes = { 'yaml.gitlab' }, + root_dir = function(bufnr, on_dir) + local fname = vim.api.nvim_buf_get_name(bufnr) + on_dir(util.root_pattern('.git', '.gitlab*')(fname)) + end, + init_options = { + cache_path = cache_dir, + log_path = cache_dir .. '/log/gitlab-ci-ls.log', + }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/gitlab_duo.lua b/arch/lightvim/.config/lightvim/lsp/gitlab_duo.lua new file mode 100644 index 0000000..cdba7b5 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/gitlab_duo.lua @@ -0,0 +1,446 @@ +---@brief +--- +--- GitLab Duo Language Server Configuration for Neovim +--- +--- https://gitlab.com/gitlab-org/editor-extensions/gitlab-lsp +--- +--- The GitLab LSP enables any editor or IDE to integrate with GitLab Duo +--- for AI-powered code suggestions via the Language Server Protocol. +--- +--- Prerequisites: +--- - Node.js and npm installed +--- - GitLab account with Duo Pro license +--- - Internet connection for OAuth device flow +--- +--- Setup: +--- 1. Run :LspGitLabDuoSignIn to start OAuth authentication +--- 2. Follow the browser prompts to authorize +--- 3. Enable inline completion in LspAttach event (see example below) +--- +--- Inline Completion Example: +--- ```lua +--- vim.api.nvim_create_autocmd('LspAttach', { +--- callback = function(args) +--- local bufnr = args.buf +--- local client = assert(vim.lsp.get_client_by_id(args.data.client_id)) +--- +--- if vim.lsp.inline_completion and +--- client:supports_method(vim.lsp.protocol.Methods.textDocument_inlineCompletion, bufnr) then +--- vim.lsp.inline_completion.enable(true, { bufnr = bufnr }) +--- +--- -- Tab to accept suggestion +--- vim.keymap.set('i', '', function() +--- if not vim.lsp.inline_completion.get() then +--- return '' +--- end +--- end, { expr = true, buffer = bufnr, desc = 'GitLab Duo: Accept suggestion' }) +--- +--- -- Alt/Option+[ for previous suggestion +--- vim.keymap.set('i', '', function() vim.lsp.inline_completion.select({ count = -1 }) end, +--- { buffer = bufnr, desc = 'GitLab Duo: Previous suggestion' }) +--- +--- -- Alt/Option+] for next suggestion +--- vim.keymap.set('i', '', function() vim.lsp.inline_completion.select({ count = 1 }) end, +--- { buffer = bufnr, desc = 'GitLab Duo: Next suggestion' }) +--- end +--- end +--- }) +--- ``` + +-- Configuration +local config = { + gitlab_url = 'https://gitlab.com', + -- This is a oauth application created from tachyons-gitlab account with `api` scope + client_id = '00bb391f527d2e77b3467b0b6b900151cc6a28dcfb18fa1249871e43bc3e5832', + scopes = 'api', + token_file = vim.fn.stdpath('data') .. '/gitlab_duo_oauth.json', +} + +-- Helper function to make POST requests with curl via vim.system +local function curl_post(url, data, headers) + local curl_args = { + 'curl', + '-s', + '-w', + '\n%{http_code}', + '-X', + 'POST', + url, + } + + -- Add headers + for key, value in pairs(headers or {}) do + table.insert(curl_args, '-H') + table.insert(curl_args, key .. ': ' .. value) + end + + -- Add data + if data then + table.insert(curl_args, '-d') + table.insert(curl_args, data) + end + + local result = vim.system(curl_args, { text = true }):wait() + + -- Split body and status code + local output = result.stdout or '' + local body_end = output:match('.*\n()%d+$') + + local body = '' + local status = 0 + + if body_end then + body = output:sub(1, body_end - 2) -- -2 to remove trailing newline + status = tonumber(output:match('\n(%d+)$')) or 0 + else + body = output + end + + return { + status = status, + body = body, + } +end + +-- Token management +local function save_token(token_data) + token_data.saved_at = os.time() + local file = io.open(config.token_file, 'w') + if file then + file:write(vim.json.encode(token_data)) + file:close() + return true + end + return false +end + +local function load_token() + if vim.fn.filereadable(config.token_file) == 0 then + return nil + end + + local blob = vim.fn.readblob(config.token_file) + return vim.json.decode(blob) +end + +local function is_token_expired(token_data) + if not token_data or not token_data.saved_at or not token_data.expires_in then + return true + end + local token_age = os.time() - token_data.saved_at + return token_age >= (token_data.expires_in - 60) -- 60 second buffer +end + +local function refresh_access_token(refresh_token) + vim.notify('Refreshing GitLab OAuth token...', vim.log.levels.INFO) + + local response = curl_post( + config.gitlab_url .. '/oauth/token', + string.format('client_id=%s&refresh_token=%s&grant_type=refresh_token', config.client_id, refresh_token), + { ['Content-Type'] = 'application/x-www-form-urlencoded' } + ) + + if response.status ~= 200 then + vim.notify('Failed to refresh token: ' .. (response.body or 'Unknown error'), vim.log.levels.ERROR) + return nil + end + + local ok, body = pcall(vim.json.decode, response.body) + if not ok or not body.access_token then + vim.notify('Invalid refresh response', vim.log.levels.ERROR) + return nil + end + + save_token(body) + vim.notify('Token refreshed successfully', vim.log.levels.INFO) + return body +end + +local function get_valid_token() + local token_data = load_token() + + if not token_data then + return nil, 'no_token' + end + + if is_token_expired(token_data) then + if token_data.refresh_token then + local new_token_data = refresh_access_token(token_data.refresh_token) + if new_token_data then + return new_token_data.access_token, 'refreshed' + end + return nil, 'refresh_failed' + end + return nil, 'expired' + end + + return token_data.access_token, 'valid' +end + +-- OAuth Device Flow +local function device_authorization() + local response = curl_post( + config.gitlab_url .. '/oauth/authorize_device', + string.format('client_id=%s&scope=%s', config.client_id, config.scopes), + { ['Content-Type'] = 'application/x-www-form-urlencoded' } + ) + + if response.status ~= 200 then + vim.notify('Device authorization failed: ' .. response.status, vim.log.levels.ERROR) + return nil + end + + local data = vim.json.decode(response.body) + + return data +end + +local function poll_for_token(device_code, interval, client) + local max_attempts = 60 + local attempts = 0 + + local function poll() + attempts = attempts + 1 + + local response = curl_post( + config.gitlab_url .. '/oauth/token', + string.format( + 'client_id=%s&device_code=%s&grant_type=urn:ietf:params:oauth:grant-type:device_code', + config.client_id, + device_code + ), + { ['Content-Type'] = 'application/x-www-form-urlencoded' } + ) + + local ok, body = pcall(vim.json.decode, response.body) + if not ok then + vim.notify('Failed to parse token response', vim.log.levels.ERROR) + return + end + + if response.status == 200 and body.access_token then + save_token(body) + vim.notify('GitLab Duo authentication successful!', vim.log.levels.INFO) + + -- Update LSP with new token + vim.schedule(function() + client:notify('workspace/didChangeConfiguration', { + settings = { + token = body.access_token, + baseUrl = config.gitlab_url, + }, + }) + end) + return + end + + if body.error == 'authorization_pending' then + if attempts < max_attempts then + vim.defer_fn(poll, interval * 1000) + else + vim.notify('Authorization timed out', vim.log.levels.ERROR) + end + elseif body.error == 'slow_down' then + vim.defer_fn(poll, (interval + 5) * 1000) + elseif body.error == 'access_denied' then + vim.notify('Authorization denied', vim.log.levels.ERROR) + elseif body.error == 'expired_token' then + vim.notify('Device code expired. Please run :LspGitLabDuoSignIn again', vim.log.levels.ERROR) + else + vim.notify('OAuth error: ' .. (body.error or 'unknown'), vim.log.levels.ERROR) + end + end + + poll() +end + +---@param client vim.lsp.Client +local function sign_in(client) + vim.notify('Starting GitLab device authorization...', vim.log.levels.INFO) + + local auth_data = device_authorization() + if not auth_data then + return + end + + vim.ui.open(auth_data.verification_uri .. '?user_code=' .. auth_data.user_code) + + poll_for_token(auth_data.device_code, auth_data.interval or 5, client) +end + +---@param client vim.lsp.Client +local function sign_out(client) + local ok = os.remove(config.token_file) + if ok then + vim.notify('Signed out. Token removed.', vim.log.levels.INFO) + client:notify('workspace/didChangeConfiguration', { + settings = { token = '' }, + }) + else + vim.notify('Failed to remove token file', vim.log.levels.ERROR) + end +end + +local function show_status() + local token_data = load_token() + + if not token_data then + vim.notify('Not signed in. Run :LspGitLabDuoSignIn to authenticate.', vim.log.levels.INFO) + return + end + + local info = { + 'GitLab Duo Status:', + '', + 'Instance: ' .. config.gitlab_url, + 'Signed in: Yes', + 'Has refresh token: ' .. (token_data.refresh_token and 'Yes' or 'No'), + } + + if token_data.saved_at and token_data.expires_in then + local time_left = token_data.expires_in - (os.time() - token_data.saved_at) + if time_left > 0 then + local hours = math.floor(time_left / 3600) + local minutes = math.floor((time_left % 3600) / 60) + table.insert(info, string.format('Token expires in: %dh %dm', hours, minutes)) + else + table.insert(info, 'Token status: EXPIRED') + end + end + + vim.notify(table.concat(info, '\n'), vim.log.levels.INFO) +end + +---@type vim.lsp.Config +return { + cmd = { + 'npx', + '--registry=https://gitlab.com/api/v4/packages/npm/', + '@gitlab-org/gitlab-lsp', + '--stdio', + }, + root_markers = { '.git' }, + filetypes = { + 'ruby', + 'go', + 'javascript', + 'typescript', + 'typescriptreact', + 'javascriptreact', + 'rust', + 'lua', + 'python', + 'java', + 'cpp', + 'c', + 'php', + 'cs', + 'kotlin', + 'swift', + 'scala', + 'vue', + 'svelte', + 'html', + 'css', + 'scss', + 'json', + 'yaml', + }, + init_options = { + editorInfo = { + name = 'Neovim', + version = tostring(vim.version()), + }, + editorPluginInfo = { + name = 'Neovim LSP', + version = tostring(vim.version()), + }, + ide = { + name = 'Neovim', + version = tostring(vim.version()), + vendor = 'Neovim', + }, + extension = { + name = 'Neovim LSP Client', + version = tostring(vim.version()), + }, + }, + settings = { + baseUrl = config.gitlab_url, + logLevel = 'info', + codeCompletion = { + enableSecretRedaction = true, + }, + telemetry = { + enabled = false, + }, + featureFlags = { + streamCodeGenerations = false, + }, + }, + on_init = function(client) + -- Handle token validation errors + client.handlers['$/gitlab/token/check'] = function(_, result) + if result and result.reason then + vim.notify(string.format('GitLab Duo: %s - %s', result.reason, result.message or ''), vim.log.levels.ERROR) + + -- Try to refresh if possible + local token_data = load_token() + if token_data and token_data.refresh_token then + vim.schedule(function() + local new_token_data = refresh_access_token(token_data.refresh_token) + if new_token_data then + client:notify('workspace/didChangeConfiguration', { + settings = { token = new_token_data.access_token, baseUrl = config.gitlab_url }, + }) + else + vim.notify('Run :LspGitLabDuoSignIn to re-authenticate', vim.log.levels.WARN) + end + end) + else + vim.notify('Run :LspGitLabDuoSignIn to authenticate', vim.log.levels.WARN) + end + end + end + + -- Handle feature state changes + client.handlers['$/gitlab/featureStateChange'] = function(_, result) + if result and result.state == 'disabled' and result.checks then + for _, check in ipairs(result.checks) do + vim.notify(string.format('GitLab Duo: %s', check.message or check.id), vim.log.levels.WARN) + end + end + end + + -- Check authentication status + local token, status = get_valid_token() + + if token then + client:notify('workspace/didChangeConfiguration', { + settings = { + token = token, + baseUrl = config.gitlab_url, + }, + }) + end + + if not token then + vim.notify('GitLab Duo: Not authenticated. Run :LspGitLabDuoSignIn to sign in.', vim.log.levels.WARN) + elseif status == 'refreshed' then + vim.notify('GitLab Duo: Token refreshed automatically', vim.log.levels.INFO) + end + end, + on_attach = function(client, bufnr) + vim.api.nvim_buf_create_user_command(bufnr, 'LspGitLabDuoSignIn', function() + sign_in(client) + end, { desc = 'Sign in to GitLab Duo with OAuth' }) + + vim.api.nvim_buf_create_user_command(bufnr, 'LspGitLabDuoSignOut', function() + sign_out(client) + end, { desc = 'Sign out from GitLab Duo' }) + + vim.api.nvim_buf_create_user_command(bufnr, 'LspGitLabDuoStatus', function() + show_status() + end, { desc = 'Show GitLab Duo authentication status' }) + end, +} diff --git a/arch/lightvim/.config/lightvim/lsp/glasgow.lua b/arch/lightvim/.config/lightvim/lsp/glasgow.lua new file mode 100644 index 0000000..5f003b5 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/glasgow.lua @@ -0,0 +1,30 @@ +---@brief +--- +--- https://github.com/nolanderc/glasgow +--- +--- Provides language features for WGSL (WebGPU Shading Language): +--- - Completions: +--- - Local functions/variables/types. +--- - Fields and swizzles. +--- - Builtin types and functions (`dot`, `reflect`, `textureSample`, `vec3`, `mat4x2`, etc.) +--- - Hover Documentation: +--- - Function signatures. +--- - Variable types. +--- - Includes builtin types and functions. Text is taken from the WGSL specification. +--- - Goto Definition +--- - Find all References +--- - Rename +--- - Formatter +--- +--- `glasgow` can be installed via `cargo`: +--- ```sh +--- cargo install glasgow +--- ``` + +---@type vim.lsp.Config +return { + cmd = { 'glasgow' }, + filetypes = { 'wgsl' }, + root_markers = { '.git' }, + settings = {}, +} diff --git a/arch/lightvim/.config/lightvim/lsp/gleam.lua b/arch/lightvim/.config/lightvim/lsp/gleam.lua new file mode 100644 index 0000000..6a560e8 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/gleam.lua @@ -0,0 +1,14 @@ +---@brief +--- +--- https://github.com/gleam-lang/gleam +--- +--- A language server for Gleam Programming Language. +--- +--- It comes with the Gleam compiler, for installation see: [Installing Gleam](https://gleam.run/getting-started/installing/) + +---@type vim.lsp.Config +return { + cmd = { 'gleam', 'lsp' }, + filetypes = { 'gleam' }, + root_markers = { 'gleam.toml', '.git' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/glint.lua b/arch/lightvim/.config/lightvim/lsp/glint.lua new file mode 100644 index 0000000..15f1ece --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/glint.lua @@ -0,0 +1,60 @@ +---@brief +--- +--- https://github.com/typed-ember/glint +--- https://typed-ember.gitbook.io/glint/ +--- `glint-language-server` is installed when adding `@glint/core` to your project's devDependencies: +--- +--- ```sh +--- npm install @glint/core --save-dev +--- yarn add -D @glint/core +--- +--- This configuration uses the local installation of `glint-language-server` +--- (found in the `node_modules` directory of your project). +--- +--- To use a global installation of `glint-language-server`, +--- set the `init_options.glint.useGlobal` to `true`. +--- +--- vim.lsp.config('glint', { +--- init_options = { +--- glint = { +--- useGlobal = true, +--- }, +--- }, +--- }) + +---@type vim.lsp.Config +return { + cmd = function(dispatchers, config) + local cmd = 'glint-language-server' + ---@diagnostic disable-next-line: undefined-field + if not config.init_options.glint.useGlobal and (config or {}).root_dir then + local local_cmd = vim.fs.joinpath(config.root_dir, 'node_modules/.bin', cmd) + if vim.fn.executable(local_cmd) == 1 then + cmd = local_cmd + end + end + return vim.lsp.rpc.start({ cmd }, dispatchers) + end, + init_options = { + glint = { + useGlobal = false, + }, + }, + filetypes = { + 'html.handlebars', + 'handlebars', + 'typescript', + 'typescript.glimmer', + 'javascript', + 'javascript.glimmer', + }, + root_markers = { + '.glintrc.yml', + '.glintrc', + '.glintrc.json', + '.glintrc.js', + 'glint.config.js', + 'package.json', + }, + workspace_required = true, +} diff --git a/arch/lightvim/.config/lightvim/lsp/glsl_analyzer.lua b/arch/lightvim/.config/lightvim/lsp/glsl_analyzer.lua new file mode 100644 index 0000000..5cb96d2 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/glsl_analyzer.lua @@ -0,0 +1,13 @@ +---@brief +--- +--- https://github.com/nolanderc/glsl_analyzer +--- +--- Language server for GLSL + +---@type vim.lsp.Config +return { + cmd = { 'glsl_analyzer' }, + filetypes = { 'glsl', 'vert', 'tesc', 'tese', 'frag', 'geom', 'comp' }, + root_markers = { '.git' }, + capabilities = {}, +} diff --git a/arch/lightvim/.config/lightvim/lsp/glslls.lua b/arch/lightvim/.config/lightvim/lsp/glslls.lua new file mode 100644 index 0000000..d5a0af5 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/glslls.lua @@ -0,0 +1,23 @@ +---@brief +--- +--- https://github.com/svenstaro/glsl-language-server +--- +--- Language server implementation for GLSL +--- +--- `glslls` can be compiled and installed manually, or, if your distribution has access to the AUR, +--- via the `glsl-language-server` AUR package + +---@type vim.lsp.Config +return { + cmd = { 'glslls', '--stdin' }, + filetypes = { 'glsl', 'vert', 'tesc', 'tese', 'frag', 'geom', 'comp' }, + root_markers = { '.git' }, + capabilities = { + textDocument = { + completion = { + editsNearCursor = true, + }, + }, + offsetEncoding = { 'utf-8', 'utf-16' }, + }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/gn_language_server.lua b/arch/lightvim/.config/lightvim/lsp/gn_language_server.lua new file mode 100644 index 0000000..2bf80a0 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/gn_language_server.lua @@ -0,0 +1,13 @@ +---@brief +--- +--- https://github.com/google/gn-language-server +--- +--- A language server for GN, the build configuration language used in Chromium, +--- Fuchsia, and other projects. + +---@type vim.lsp.Config +return { + cmd = { 'gn-language-server', '--stdio' }, + filetypes = { 'gn' }, + root_markers = { '.gn', '.git' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/gnls.lua b/arch/lightvim/.config/lightvim/lsp/gnls.lua new file mode 100644 index 0000000..be39e44 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/gnls.lua @@ -0,0 +1,21 @@ +---@brief +--- +--- https://github.com/microsoft/gnls +--- +--- Microsoft's language server for GN build files. +--- +--- Assuming there is a `gnls` script somewhere in your `$PATH`, containing +--- for example: +--- +--- ```shell +--- GNLS_SRC_DIR= +--- +--- exec node ${GNLS_SRC_DIR}/build/server.js $@ +--- ``` + +---@type vim.lsp.Config +return { + cmd = { 'gnls', '--stdio' }, + filetypes = { 'gn' }, + root_markers = { '.gn', '.git' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/golangci_lint_ls.lua b/arch/lightvim/.config/lightvim/lsp/golangci_lint_ls.lua new file mode 100644 index 0000000..41b9b69 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/golangci_lint_ls.lua @@ -0,0 +1,72 @@ +---@brief +--- +--- Combination of both lint server and client +--- +--- https://github.com/nametake/golangci-lint-langserver +--- https://github.com/golangci/golangci-lint +--- +--- +--- Installation of binaries needed is done via +--- +--- ``` +--- go install github.com/nametake/golangci-lint-langserver@latest +--- go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest +--- ``` + +---@type vim.lsp.Config +return { + cmd = { 'golangci-lint-langserver' }, + filetypes = { 'go', 'gomod' }, + init_options = { + command = { + 'golangci-lint', + 'run', + -- disable all output formats that might be enabled by the users .golangci.yml + '--output.text.path=', + '--output.tab.path=', + '--output.html.path=', + '--output.checkstyle.path=', + '--output.junit-xml.path=', + '--output.teamcity.path=', + '--output.sarif.path=', + -- disable stats output + '--show-stats=false', + -- enable JSON output to be used by the language server + '--output.json.path=stdout', + }, + }, + root_markers = { + '.golangci.yml', + '.golangci.yaml', + '.golangci.toml', + '.golangci.json', + 'go.work', + 'go.mod', + '.git', + }, + before_init = function(_, config) + -- Add support for golangci-lint V1 (in V2 `--out-format=json` was replaced by + -- `--output.json.path=stdout`). + + if vim.fn.executable('golangci-lint') ~= 1 then + return + end + + local v1, v2 = false, false + -- PERF: `golangci-lint version` is very slow (about 0.1 sec) so let's find + -- version using `go version -m $(which golangci-lint) | grep '^\smod'`. + if vim.fn.executable 'go' == 1 then + local exe = vim.fn.exepath 'golangci-lint' + local version = vim.system({ 'go', 'version', '-m', exe }):wait() + v1 = string.match(version.stdout, '\tmod\tgithub.com/golangci/golangci%-lint\t') + v2 = string.match(version.stdout, '\tmod\tgithub.com/golangci/golangci%-lint/v2\t') + end + if not v1 and not v2 then + local version = vim.system({ 'golangci-lint', 'version' }):wait() + v1 = string.match(version.stdout, 'version v?1%.') + end + if v1 then + config.init_options.command = { 'golangci-lint', 'run', '--out-format', 'json' } + end + end, +} diff --git a/arch/lightvim/.config/lightvim/lsp/gopls.lua b/arch/lightvim/.config/lightvim/lsp/gopls.lua new file mode 100644 index 0000000..558f0a9 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/gopls.lua @@ -0,0 +1,99 @@ +---@brief +--- +--- https://github.com/golang/tools/tree/master/gopls +--- +--- Google's lsp server for golang. + +--- @class go_dir_custom_args +--- +--- @field envvar_id string +--- +--- @field custom_subdir string? + +local mod_cache = nil +local std_lib = nil + +---@param custom_args go_dir_custom_args +---@param on_complete fun(dir: string | nil) +local function identify_go_dir(custom_args, on_complete) + local cmd = { 'go', 'env', custom_args.envvar_id } + vim.system(cmd, { text = true }, function(output) + local res = vim.trim(output.stdout or '') + if output.code == 0 and res ~= '' then + if custom_args.custom_subdir and custom_args.custom_subdir ~= '' then + res = res .. custom_args.custom_subdir + end + on_complete(res) + else + vim.schedule(function() + vim.notify( + ('[gopls] identify ' .. custom_args.envvar_id .. ' dir cmd failed with code %d: %s\n%s'):format( + output.code, + vim.inspect(cmd), + output.stderr + ) + ) + end) + on_complete(nil) + end + end) +end + +---@return string? +local function get_std_lib_dir() + if std_lib and std_lib ~= '' then + return std_lib + end + + identify_go_dir({ envvar_id = 'GOROOT', custom_subdir = '/src' }, function(dir) + if dir then + std_lib = dir + end + end) + return std_lib +end + +---@return string? +local function get_mod_cache_dir() + if mod_cache and mod_cache ~= '' then + return mod_cache + end + + identify_go_dir({ envvar_id = 'GOMODCACHE' }, function(dir) + if dir then + mod_cache = dir + end + end) + return mod_cache +end + +---@param fname string +---@return string? +local function get_root_dir(fname) + if mod_cache and fname:sub(1, #mod_cache) == mod_cache then + local clients = vim.lsp.get_clients({ name = 'gopls' }) + if #clients > 0 then + return clients[#clients].config.root_dir + end + end + if std_lib and fname:sub(1, #std_lib) == std_lib then + local clients = vim.lsp.get_clients({ name = 'gopls' }) + if #clients > 0 then + return clients[#clients].config.root_dir + end + end + return vim.fs.root(fname, 'go.work') or vim.fs.root(fname, 'go.mod') or vim.fs.root(fname, '.git') +end + +---@type vim.lsp.Config +return { + cmd = { 'gopls' }, + filetypes = { 'go', 'gomod', 'gowork', 'gotmpl' }, + root_dir = function(bufnr, on_dir) + local fname = vim.api.nvim_buf_get_name(bufnr) + get_mod_cache_dir() + get_std_lib_dir() + -- see: https://github.com/neovim/nvim-lspconfig/issues/804 + on_dir(get_root_dir(fname)) + end, +} diff --git a/arch/lightvim/.config/lightvim/lsp/gradle_ls.lua b/arch/lightvim/.config/lightvim/lsp/gradle_ls.lua new file mode 100644 index 0000000..1974d77 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/gradle_ls.lua @@ -0,0 +1,28 @@ +---@brief +--- +--- https://github.com/microsoft/vscode-gradle +--- +--- Microsoft's lsp server for gradle files +--- +--- If you're setting this up manually, build vscode-gradle using `./gradlew installDist` and point `cmd` to the `gradle-language-server` generated in the build directory + +local bin_name = 'gradle-language-server' +if vim.fn.has 'win32' == 1 then + bin_name = bin_name .. '.bat' +end + +---@type vim.lsp.Config +return { + filetypes = { 'groovy' }, + root_markers = { + 'settings.gradle', -- Gradle (multi-project) + 'build.gradle', -- Gradle + }, + cmd = { bin_name }, + -- gradle-language-server expects init_options.settings to be defined + init_options = { + settings = { + gradleWrapperEnabled = true, + }, + }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/grammarly.lua b/arch/lightvim/.config/lightvim/lsp/grammarly.lua new file mode 100644 index 0000000..a8ebcd0 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/grammarly.lua @@ -0,0 +1,26 @@ +---@brief +--- +--- https://github.com/znck/grammarly +--- +--- `grammarly-languageserver` can be installed via `npm`: +--- +--- ```sh +--- npm i -g grammarly-languageserver +--- ``` +--- +--- WARNING: Since this language server uses Grammarly's API, any document you open with it running is shared with them. Please evaluate their [privacy policy](https://www.grammarly.com/privacy-policy) before using this. + +---@type vim.lsp.Config +return { + cmd = { 'grammarly-languageserver', '--stdio' }, + filetypes = { 'markdown' }, + root_markers = { '.git' }, + handlers = { + ['$/updateDocumentState'] = function() + return '' + end, + }, + init_options = { + clientId = 'client_BaDkMgx4X19X9UxxYRCXZo', + }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/graphql.lua b/arch/lightvim/.config/lightvim/lsp/graphql.lua new file mode 100644 index 0000000..27a8603 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/graphql.lua @@ -0,0 +1,23 @@ +---@brief +--- +--- https://github.com/graphql/graphiql/tree/main/packages/graphql-language-service-cli +--- +--- `graphql-lsp` can be installed via `npm`: +--- +--- ```sh +--- npm install -g graphql-language-service-cli +--- ``` +--- +--- Note that you must also have [the graphql package](https://github.com/graphql/graphql-js) installed within your project and create a [GraphQL config file](https://the-guild.dev/graphql/config/docs). + +local util = require 'lspconfig.util' + +---@type vim.lsp.Config +return { + cmd = { 'graphql-lsp', 'server', '-m', 'stream' }, + filetypes = { 'graphql', 'typescriptreact', 'javascriptreact' }, + root_dir = function(bufnr, on_dir) + local fname = vim.api.nvim_buf_get_name(bufnr) + on_dir(util.root_pattern('.graphqlrc*', '.graphql.config.*', 'graphql.config.*')(fname)) + end, +} diff --git a/arch/lightvim/.config/lightvim/lsp/groovyls.lua b/arch/lightvim/.config/lightvim/lsp/groovyls.lua new file mode 100644 index 0000000..7193ffb --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/groovyls.lua @@ -0,0 +1,33 @@ +---@brief +--- +--- https://github.com/prominic/groovy-language-server.git +--- +--- Requirements: +--- - Linux/macOS (for now) +--- - Java 11+ +--- +--- `groovyls` can be installed by following the instructions [here](https://github.com/prominic/groovy-language-server.git#build). +--- +--- If you have installed groovy language server, you can set the `cmd` custom path as follow: +--- +--- ```lua +--- vim.lsp.config('groovyls', { +--- -- Unix +--- cmd = { "java", "-jar", "path/to/groovyls/groovy-language-server-all.jar" }, +--- ... +--- }) +--- ``` + +---@type vim.lsp.Config +return { + -- When installed via mason + cmd = { 'groovy-language-server' }, + -- If installed/built locally, please provide the correct filepath to Java. + -- cmd = { + -- 'java', + -- '-jar', + -- 'groovy-language-server-all.jar', + -- }, + filetypes = { 'groovy' }, + root_markers = { 'Jenkinsfile', '.git' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/guile_ls.lua b/arch/lightvim/.config/lightvim/lsp/guile_ls.lua new file mode 100644 index 0000000..58bb6c7 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/guile_ls.lua @@ -0,0 +1,21 @@ +---@brief +--- +--- https://codeberg.org/rgherdt/scheme-lsp-server +--- +--- The recommended way is to install guile-lsp-server is using Guix. Unfortunately it is still not available at the official Guix channels, but you can use the provided channel guix.scm in the repo: +--- ```sh +--- guix package -f guix.scm +--- ``` +--- +--- Checkout the repo for more info. +--- +--- Note: This LSP will start on `scheme.guile` filetype. You can set this file type using `:help modeline` or adding https://gitlab.com/HiPhish/guile.vim to your plugins to automatically set it. + +---@type vim.lsp.Config +return { + cmd = { 'guile-lsp-server' }, + filetypes = { + 'scheme.guile', + }, + root_markers = { 'guix.scm', '.git' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/harper_ls.lua b/arch/lightvim/.config/lightvim/lsp/harper_ls.lua new file mode 100644 index 0000000..42bdf94 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/harper_ls.lua @@ -0,0 +1,52 @@ +---@brief +--- +--- https://github.com/automattic/harper +--- +--- The language server for Harper, the slim, clean language checker for developers. +--- +--- See our [documentation](https://writewithharper.com/docs/integrations/neovim) for more information on settings. +--- +--- In short, they should look something like this: +--- ```lua +--- vim.lsp.config('harper_ls', { +--- settings = { +--- ["harper-ls"] = { +--- userDictPath = "~/dict.txt" +--- } +--- }, +--- }) +--- ``` + +---@type vim.lsp.Config +return { + cmd = { 'harper-ls', '--stdio' }, + filetypes = { + 'asciidoc', + 'c', + 'cpp', + 'cs', + 'gitcommit', + 'go', + 'html', + 'java', + 'javascript', + 'lua', + 'markdown', + 'nix', + 'python', + 'ruby', + 'rust', + 'swift', + 'toml', + 'typescript', + 'typescriptreact', + 'haskell', + 'cmake', + 'typst', + 'php', + 'dart', + 'clojure', + 'sh', + }, + root_markers = { '.harper-dictionary.txt', '.git' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/hdl_checker.lua b/arch/lightvim/.config/lightvim/lsp/hdl_checker.lua new file mode 100644 index 0000000..bd0912c --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/hdl_checker.lua @@ -0,0 +1,12 @@ +---@brief +--- +--- https://github.com/suoto/hdl_checker +--- Language server for hdl-checker. +--- Install using: `pip install hdl-checker --upgrade` + +---@type vim.lsp.Config +return { + cmd = { 'hdl_checker', '--lsp' }, + filetypes = { 'vhdl', 'verilog', 'systemverilog' }, + root_markers = { '.git' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/helm_ls.lua b/arch/lightvim/.config/lightvim/lsp/helm_ls.lua new file mode 100644 index 0000000..a2deb89 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/helm_ls.lua @@ -0,0 +1,25 @@ +---@brief +--- +--- https://github.com/mrjosh/helm-ls +--- +--- Helm Language server. (This LSP is in early development) +--- +--- `helm Language server` can be installed by following the instructions [here](https://github.com/mrjosh/helm-ls). +--- +--- The default `cmd` assumes that the `helm_ls` binary can be found in `$PATH`. +--- +--- If need Helm file highlight use [vim-helm](https://github.com/towolf/vim-helm) plugin. + +---@type vim.lsp.Config +return { + cmd = { 'helm_ls', 'serve' }, + filetypes = { 'helm', 'yaml.helm-values' }, + root_markers = { 'Chart.yaml' }, + capabilities = { + workspace = { + didChangeWatchedFiles = { + dynamicRegistration = true, + }, + }, + }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/herb_ls.lua b/arch/lightvim/.config/lightvim/lsp/herb_ls.lua new file mode 100644 index 0000000..637eb56 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/herb_ls.lua @@ -0,0 +1,29 @@ +---@brief +--- +--- https://www.npmjs.com/package/@herb-tools/language-server +--- https://github.com/marcoroth/herb +--- +--- HTML+ERB (HTML + Embedded Ruby) +--- Powerful and seamless HTML-aware ERB parsing and tooling. +--- +--- Herb is designed from the ground up to deeply understand `.html.erb` files, +--- preserving both HTML and embedded Ruby structure without losing any details. +--- +--- `herb-language-server` can be installed via `npm`: +--- +--- ```sh +--- npm install -g @herb-tools/language-server +--- ``` +--- +--- or via `yarn`: +--- +--- ```sh +--- yarn global add @herb-tools/language-server +--- ``` + +---@type vim.lsp.Config +return { + cmd = { 'herb-language-server', '--stdio' }, + filetypes = { 'html', 'eruby' }, + root_markers = { 'Gemfile', '.git' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/hhvm.lua b/arch/lightvim/.config/lightvim/lsp/hhvm.lua new file mode 100644 index 0000000..2016614 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/hhvm.lua @@ -0,0 +1,14 @@ +---@brief +--- +--- Language server for programs written in Hack +--- https://hhvm.com/ +--- https://github.com/facebook/hhvm +--- See below for how to setup HHVM & typechecker: +--- https://docs.hhvm.com/hhvm/getting-started/getting-started + +---@type vim.lsp.Config +return { + cmd = { 'hh_client', 'lsp' }, + filetypes = { 'php', 'hack' }, + root_markers = { '.hhconfig' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/hie.lua b/arch/lightvim/.config/lightvim/lsp/hie.lua new file mode 100644 index 0000000..8d6acac --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/hie.lua @@ -0,0 +1,25 @@ +---@brief +--- +--- https://github.com/haskell/haskell-ide-engine +--- +--- the following init_options are supported (see https://github.com/haskell/haskell-ide-engine#configuration): +--- ```lua +--- init_options = { +--- languageServerHaskell = { +--- hlintOn = bool; +--- maxNumberOfProblems = number; +--- diagnosticsDebounceDuration = number; +--- liquidOn = bool (default false); +--- completionSnippetsOn = bool (default true); +--- formatOnImportOn = bool (default true); +--- formattingProvider = string (default "brittany", alternate "floskell"); +--- } +--- } +--- ``` + +---@type vim.lsp.Config +return { + cmd = { 'hie-wrapper', '--lsp' }, + filetypes = { 'haskell' }, + root_markers = { 'stack.yaml', 'package.yaml', '.git' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/hlasm.lua b/arch/lightvim/.config/lightvim/lsp/hlasm.lua new file mode 100644 index 0000000..9ca794d --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/hlasm.lua @@ -0,0 +1,12 @@ +---@brief +--- +--- `hlasm_language_server` is a language server for the High Level Assembler language used on IBM SystemZ mainframes. +--- +--- To learn how to configure the HLASM language server, see the [HLASM Language Support documentation](https://github.com/eclipse-che4z/che-che4z-lsp-for-hlasm). + +---@type vim.lsp.Config +return { + cmd = { 'hlasm_language_server' }, + filetypes = { 'hlasm' }, + root_markers = { '.hlasmplugin' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/hls.lua b/arch/lightvim/.config/lightvim/lsp/hls.lua new file mode 100644 index 0000000..5b2ec86 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/hls.lua @@ -0,0 +1,31 @@ +---@brief +--- +--- https://github.com/haskell/haskell-language-server +--- +--- Haskell Language Server +--- +--- If you are using HLS 1.9.0.0, enable the language server to launch on Cabal files as well: +--- +--- ```lua +--- vim.lsp.config('hls', { +--- filetypes = { 'haskell', 'lhaskell', 'cabal' }, +--- }) +--- ``` + +local util = require 'lspconfig.util' + +---@type vim.lsp.Config +return { + cmd = { 'haskell-language-server-wrapper', '--lsp' }, + filetypes = { 'haskell', 'lhaskell' }, + root_dir = function(bufnr, on_dir) + local fname = vim.api.nvim_buf_get_name(bufnr) + on_dir(util.root_pattern('hie.yaml', 'stack.yaml', 'cabal.project', '*.cabal', 'package.yaml')(fname)) + end, + settings = { + haskell = { + formattingProvider = 'ormolu', + cabalFormattingProvider = 'cabal-fmt', + }, + }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/home_assistant.lua b/arch/lightvim/.config/lightvim/lsp/home_assistant.lua new file mode 100644 index 0000000..80a9354 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/home_assistant.lua @@ -0,0 +1,18 @@ +---@brief +--- +--- https://github.com/keesschollaart81/vscode-home-assistant +--- +--- `vscode-home-assistant` can be installed via from source or by downloading +--- and extracting the VSCode "Home Assistant Config Helper" extension +--- +--- `vscode-home-assistant` is a language server for Home Assistant ported from the VSCode "Home Assistant Config Helper" extension. + +---@type vim.lsp.Config +return { + cmd = { 'vscode-home-assistant', '--stdio' }, + filetypes = { 'yaml' }, + root_markers = { + 'configuration.yaml', + 'configuration.yml', + }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/hoon_ls.lua b/arch/lightvim/.config/lightvim/lsp/hoon_ls.lua new file mode 100644 index 0000000..165c803 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/hoon_ls.lua @@ -0,0 +1,17 @@ +---@brief +--- +--- https://github.com/urbit/hoon-language-server +--- +--- A language server for Hoon. +--- +--- The language server can be installed via `npm install -g @hoon-language-server` +--- +--- Start a fake ~zod with `urbit -F zod`. +--- Start the language server at the Urbit Dojo prompt with: `|start %language-server` + +---@type vim.lsp.Config +return { + cmd = { 'hoon-language-server' }, + filetypes = { 'hoon' }, + root_markers = { '.git' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/html.lua b/arch/lightvim/.config/lightvim/lsp/html.lua new file mode 100644 index 0000000..bc7bcba --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/html.lua @@ -0,0 +1,46 @@ +---@brief +--- +--- https://github.com/hrsh7th/vscode-langservers-extracted +--- +--- `vscode-html-language-server` can be installed via `npm`: +--- ```sh +--- npm i -g vscode-langservers-extracted +--- ``` +--- +--- Neovim does not currently include built-in snippets. `vscode-html-language-server` only provides completions when snippet support is enabled. +--- To enable completion, install a snippet plugin and add the following override to your language client capabilities during setup. +--- +--- The code-formatting feature of the lsp can be controlled with the `provideFormatter` option. +--- +--- ```lua +--- --Enable (broadcasting) snippet capability for completion +--- local capabilities = vim.lsp.protocol.make_client_capabilities() +--- capabilities.textDocument.completion.completionItem.snippetSupport = true +--- +--- vim.lsp.config('html', { +--- capabilities = capabilities, +--- }) +--- ``` + +---@type vim.lsp.Config +return { + cmd = function(dispatchers, config) + local cmd = 'vscode-html-language-server' + if (config or {}).root_dir then + local local_cmd = vim.fs.joinpath(config.root_dir, 'node_modules/.bin', cmd) + if vim.fn.executable(local_cmd) == 1 then + cmd = local_cmd + end + end + return vim.lsp.rpc.start({ cmd, '--stdio' }, dispatchers) + end, + filetypes = { 'html' }, + root_markers = { 'package.json', '.git' }, + ---@type lspconfig.settings.html + settings = {}, + init_options = { + provideFormatter = true, + embeddedLanguages = { css = true, javascript = true }, + configurationSection = { 'html', 'css', 'javascript' }, + }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/htmx.lua b/arch/lightvim/.config/lightvim/lsp/htmx.lua new file mode 100644 index 0000000..87b0429 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/htmx.lua @@ -0,0 +1,64 @@ +---@brief +--- +--- https://github.com/ThePrimeagen/htmx-lsp +--- +--- `htmx-lsp` can be installed via `cargo`: +--- ```sh +--- cargo install htmx-lsp +--- ``` +--- +--- Lsp is still very much work in progress and experimental. Use at your own risk. + +---@type vim.lsp.Config +return { + cmd = { 'htmx-lsp' }, + filetypes = { -- filetypes copied and adjusted from tailwindcss-intellisense + -- html + 'aspnetcorerazor', + 'astro', + 'astro-markdown', + 'blade', + 'clojure', + 'django-html', + 'htmldjango', + 'edge', + 'eelixir', -- vim ft + 'elixir', + 'ejs', + 'erb', + 'eruby', -- vim ft + 'gohtml', + 'gohtmltmpl', + 'haml', + 'handlebars', + 'hbs', + 'html', + 'htmlangular', + 'html-eex', + 'heex', + 'jade', + 'leaf', + 'liquid', + 'markdown', + 'mdx', + 'mustache', + 'njk', + 'nunjucks', + 'php', + 'razor', + 'slim', + 'twig', + -- js + 'javascript', + 'javascriptreact', + 'reason', + 'rescript', + 'typescript', + 'typescriptreact', + -- mixed + 'vue', + 'svelte', + 'templ', + }, + root_markers = { '.git' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/hydra_lsp.lua b/arch/lightvim/.config/lightvim/lsp/hydra_lsp.lua new file mode 100644 index 0000000..b443433 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/hydra_lsp.lua @@ -0,0 +1,12 @@ +---@brief +--- +--- https://github.com/Retsediv/hydra-lsp +--- +--- LSP for Hydra Python package config files. + +---@type vim.lsp.Config +return { + cmd = { 'hydra-lsp' }, + filetypes = { 'yaml' }, + root_markers = { '.git' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/hylo_ls.lua b/arch/lightvim/.config/lightvim/lsp/hylo_ls.lua new file mode 100644 index 0000000..682cddb --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/hylo_ls.lua @@ -0,0 +1,13 @@ +---@brief +--- +--- https://github.com/hylo-lang/hylo-language-server +--- +--- A language server for the Hylo programming language. + +---@type vim.lsp.Config +return { + cmd = { 'hylo-language-server', '--stdio' }, + filetypes = { 'hylo' }, + root_markers = { '.git' }, + settings = {}, +} diff --git a/arch/lightvim/.config/lightvim/lsp/hyprls.lua b/arch/lightvim/.config/lightvim/lsp/hyprls.lua new file mode 100644 index 0000000..64d7cda --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/hyprls.lua @@ -0,0 +1,15 @@ +---@brief +--- +--- https://github.com/hyprland-community/hyprls +--- +--- `hyprls` can be installed via `go`: +--- ```sh +--- go install github.com/hyprland-community/hyprls/cmd/hyprls@latest +--- ``` + +---@type vim.lsp.Config +return { + cmd = { 'hyprls', '--stdio' }, + filetypes = { 'hyprlang' }, + root_markers = { '.git' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/idris2_lsp.lua b/arch/lightvim/.config/lightvim/lsp/idris2_lsp.lua new file mode 100644 index 0000000..d7f153e --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/idris2_lsp.lua @@ -0,0 +1,42 @@ +---@brief +--- +--- https://github.com/idris-community/idris2-lsp +--- +--- The Idris 2 language server. +--- +--- Plugins for the Idris 2 filetype include +--- [Idris2-Vim](https://github.com/edwinb/idris2-vim) (fewer features, stable) and +--- [Nvim-Idris2](https://github.com/ShinKage/nvim-idris2) (cutting-edge, +--- experimental). +--- +--- Idris2-Lsp requires a build of Idris 2 that includes the "Idris 2 API" package. +--- Package managers with known support for this build include the +--- [AUR](https://aur.archlinux.org/packages/idris2/) and +--- [Homebrew](https://formulae.brew.sh/formula/idris2#default). +--- +--- If your package manager does not support the Idris 2 API, you will need to build +--- Idris 2 from source. Refer to the +--- [the Idris 2 installation instructions](https://github.com/idris-lang/Idris2/blob/main/INSTALL.md) +--- for details. Steps 5 and 8 are listed as "optional" in that guide, but they are +--- necessary in order to make the Idris 2 API available. +--- +--- You need to install a version of Idris2-Lsp that is compatible with your +--- version of Idris 2. There should be a branch corresponding to every released +--- Idris 2 version after v0.4.0. Use the latest commit on that branch. For example, +--- if you have Idris v0.5.1, you should use the v0.5.1 branch of Idris2-Lsp. +--- +--- If your Idris 2 version is newer than the newest Idris2-Lsp branch, use the +--- latest commit on the `master` branch, and set a reminder to check the Idris2-Lsp +--- repo for the release of a compatible versioned branch. + +local util = require 'lspconfig.util' + +---@type vim.lsp.Config +return { + cmd = { 'idris2-lsp' }, + filetypes = { 'idris2' }, + root_dir = function(bufnr, on_dir) + local fname = vim.api.nvim_buf_get_name(bufnr) + on_dir(util.root_pattern '*.ipkg'(fname)) + end, +} diff --git a/arch/lightvim/.config/lightvim/lsp/intelephense.lua b/arch/lightvim/.config/lightvim/lsp/intelephense.lua new file mode 100644 index 0000000..34f8785 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/intelephense.lua @@ -0,0 +1,41 @@ +---@brief +--- +--- https://intelephense.com/ +--- +--- `intelephense` can be installed via `npm`: +--- ```sh +--- npm install -g intelephense +--- ``` +--- +--- ```lua +--- -- See https://github.com/bmewburn/intelephense-docs/blob/master/installation.md#initialisation-options +--- init_options = { +--- storagePath = …, -- Optional absolute path to storage dir. Defaults to os.tmpdir(). +--- globalStoragePath = …, -- Optional absolute path to a global storage dir. Defaults to os.homedir(). +--- licenceKey = …, -- Optional licence key or absolute path to a text file containing the licence key. +--- clearCache = …, -- Optional flag to clear server state. State can also be cleared by deleting {storagePath}/intelephense +--- } +--- -- See https://github.com/bmewburn/intelephense-docs +--- settings = { +--- intelephense = { +--- files = { +--- maxSize = 1000000; +--- }; +--- }; +--- } +--- ``` + +---@type vim.lsp.Config +return { + cmd = { 'intelephense', '--stdio' }, + filetypes = { 'php' }, + root_markers = { '.git', 'composer.json' }, + ---@type lspconfig.settings.intelephense + settings = { + intelephense = { + telemetry = { + enabled = false, + }, + }, + }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/janet_lsp.lua b/arch/lightvim/.config/lightvim/lsp/janet_lsp.lua new file mode 100644 index 0000000..7d444e4 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/janet_lsp.lua @@ -0,0 +1,15 @@ +---@brief +--- +--- https://github.com/CFiggers/janet-lsp +--- +--- A Language Server Protocol implementation for Janet. + +---@type vim.lsp.Config +return { + cmd = { + 'janet-lsp', + '--stdio', + }, + filetypes = { 'janet' }, + root_markers = { 'project.janet', '.git' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/java_language_server.lua b/arch/lightvim/.config/lightvim/lsp/java_language_server.lua new file mode 100644 index 0000000..a8569d9 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/java_language_server.lua @@ -0,0 +1,16 @@ +---@brief +--- +--- https://github.com/georgewfraser/java-language-server +--- +--- Java language server +--- +--- Point `cmd` to `lang_server_linux.sh` or the equivalent script for macOS/Windows provided by java-language-server + +---@type vim.lsp.Config +return { + cmd = { 'java-language-server' }, + filetypes = { 'java' }, + root_markers = { 'build.gradle', 'build.gradle.kts', 'pom.xml', '.git' }, + ---@type lspconfig.settings.java_language_server + settings = {}, +} diff --git a/arch/lightvim/.config/lightvim/lsp/jdtls.lua b/arch/lightvim/.config/lightvim/lsp/jdtls.lua new file mode 100644 index 0000000..ed20613 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/jdtls.lua @@ -0,0 +1,102 @@ +---@brief +--- +--- https://projects.eclipse.org/projects/eclipse.jdt.ls +--- +--- Language server for Java. +--- +--- IMPORTANT: If you want all the features jdtls has to offer, [nvim-jdtls](https://github.com/mfussenegger/nvim-jdtls) +--- is highly recommended. If all you need is diagnostics, completion, imports, gotos and formatting and some code actions +--- you can keep reading here. +--- +--- For manual installation you can download precompiled binaries from the +--- [official downloads site](http://download.eclipse.org/jdtls/snapshots/?d) +--- and ensure that the `PATH` variable contains the `bin` directory of the extracted archive. +--- +--- ```lua +--- -- init.lua +--- vim.lsp.enable('jdtls') +--- ``` +--- +--- You can also pass extra custom jvm arguments with the JDTLS_JVM_ARGS environment variable as a space separated list of arguments, +--- that will be converted to multiple --jvm-arg= args when passed to the jdtls script. This will allow for example tweaking +--- the jvm arguments or integration with external tools like lombok: +--- +--- ```sh +--- export JDTLS_JVM_ARGS="-javaagent:$HOME/.local/share/java/lombok.jar" +--- ``` +--- +--- For automatic installation you can use the following unofficial installers/launchers under your own risk: +--- - [jdtls-launcher](https://github.com/eruizc-dev/jdtls-launcher) (Includes lombok support by default) +--- ```lua +--- -- init.lua +--- vim.lsp.config('jdtls', { cmd = { 'jdtls' } }) +--- ``` + +local function get_jdtls_cache_dir() + return vim.fn.stdpath('cache') .. '/jdtls' +end + +local function get_jdtls_workspace_dir() + return get_jdtls_cache_dir() .. '/workspace' +end + +local function get_jdtls_jvm_args() + local env = os.getenv('JDTLS_JVM_ARGS') + local args = {} + for a in string.gmatch((env or ''), '%S+') do + local arg = string.format('--jvm-arg=%s', a) + table.insert(args, arg) + end + return unpack(args) +end + +local root_markers1 = { + -- Multi-module projects + 'mvnw', -- Maven + 'gradlew', -- Gradle + 'settings.gradle', -- Gradle + 'settings.gradle.kts', -- Gradle + -- Use git directory as last resort for multi-module maven projects + -- In multi-module maven projects it is not really possible to determine what is the parent directory + -- and what is submodule directory. And jdtls does not break if the parent directory is at higher level than + -- actual parent pom.xml so propagating all the way to root git directory is fine + '.git', +} +local root_markers2 = { + -- Single-module projects + 'build.xml', -- Ant + 'pom.xml', -- Maven + 'build.gradle', -- Gradle + 'build.gradle.kts', -- Gradle +} + +---@type vim.lsp.Config +return { + ---@param dispatchers? vim.lsp.rpc.Dispatchers + ---@param config vim.lsp.ClientConfig + cmd = function(dispatchers, config) + local workspace_dir = get_jdtls_workspace_dir() + local data_dir = workspace_dir + + if config.root_dir then + data_dir = data_dir .. '/' .. vim.fn.fnamemodify(config.root_dir, ':p:h:t') + end + + local config_cmd = { + 'jdtls', + '-data', + data_dir, + get_jdtls_jvm_args(), + } + + return vim.lsp.rpc.start(config_cmd, dispatchers, { + cwd = config.cmd_cwd, + env = config.cmd_env, + detached = config.detached, + }) + end, + filetypes = { 'java' }, + root_markers = vim.fn.has('nvim-0.11.3') == 1 and { root_markers1, root_markers2 } + or vim.list_extend(root_markers1, root_markers2), + init_options = {}, +} diff --git a/arch/lightvim/.config/lightvim/lsp/jedi_language_server.lua b/arch/lightvim/.config/lightvim/lsp/jedi_language_server.lua new file mode 100644 index 0000000..99427a4 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/jedi_language_server.lua @@ -0,0 +1,19 @@ +---@brief +--- +--- https://github.com/pappasam/jedi-language-server +--- +--- `jedi-language-server`, a language server for Python, built on top of jedi + +---@type vim.lsp.Config +return { + cmd = { 'jedi-language-server' }, + filetypes = { 'python' }, + root_markers = { + 'pyproject.toml', + 'setup.py', + 'setup.cfg', + 'requirements.txt', + 'Pipfile', + '.git', + }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/jinja_lsp.lua b/arch/lightvim/.config/lightvim/lsp/jinja_lsp.lua new file mode 100644 index 0000000..c3a034f --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/jinja_lsp.lua @@ -0,0 +1,23 @@ +---@brief +--- +--- jinja-lsp enhances minijinja development experience by providing Helix/Nvim users with advanced features such as autocomplete, syntax highlighting, hover, goto definition, code actions and linting. +--- +--- The file types are not detected automatically, you can register them manually (see below) or override the filetypes: +--- +--- ```lua +--- vim.filetype.add { +--- extension = { +--- jinja = 'jinja', +--- jinja2 = 'jinja', +--- j2 = 'jinja', +--- }, +--- } +--- ``` + +---@type vim.lsp.Config +return { + name = 'jinja_lsp', + cmd = { 'jinja-lsp' }, + filetypes = { 'jinja' }, + root_markers = { '.git' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/jqls.lua b/arch/lightvim/.config/lightvim/lsp/jqls.lua new file mode 100644 index 0000000..2fcdeb3 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/jqls.lua @@ -0,0 +1,24 @@ +---@brief +--- +--- https://github.com/wader/jq-lsp +--- Language server for jq, written using Go. +--- You can install the server easily using go install: +--- ```sh +--- # install directly +--- go install github.com/wader/jq-lsp@master +--- # copy binary to $PATH +--- cp $(go env GOPATH)/bin/jq-lsp /usr/local/bin +--- +--- ``` +--- Note: To activate properly nvim needs to know the jq filetype. +--- You can add it via: +--- ```lua +--- vim.cmd([[au BufRead,BufNewFile *.jq setfiletype jq]]) +--- ``` + +---@type vim.lsp.Config +return { + cmd = { 'jq-lsp' }, + filetypes = { 'jq' }, + root_markers = { '.git' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/jsonls.lua b/arch/lightvim/.config/lightvim/lsp/jsonls.lua new file mode 100644 index 0000000..b86289e --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/jsonls.lua @@ -0,0 +1,41 @@ +---@brief +--- +--- https://github.com/hrsh7th/vscode-langservers-extracted +--- +--- vscode-json-language-server, a language server for JSON and JSON schema +--- +--- `vscode-json-language-server` can be installed via `npm`: +--- ```sh +--- npm i -g vscode-langservers-extracted +--- ``` +--- +--- `vscode-json-language-server` only provides completions when snippet support is enabled. If you use Neovim older than v0.10 you need to enable completion, install a snippet plugin and add the following override to your language client capabilities during setup. +--- +--- ```lua +--- --Enable (broadcasting) snippet capability for completion +--- local capabilities = vim.lsp.protocol.make_client_capabilities() +--- capabilities.textDocument.completion.completionItem.snippetSupport = true +--- +--- vim.lsp.config('jsonls', { +--- capabilities = capabilities, +--- }) +--- ``` + +---@type vim.lsp.Config +return { + cmd = function(dispatchers, config) + local cmd = 'vscode-json-language-server' + if (config or {}).root_dir then + local local_cmd = vim.fs.joinpath(config.root_dir, 'node_modules/.bin', cmd) + if vim.fn.executable(local_cmd) == 1 then + cmd = local_cmd + end + end + return vim.lsp.rpc.start({ cmd, '--stdio' }, dispatchers) + end, + filetypes = { 'json', 'jsonc' }, + init_options = { + provideFormatter = true, + }, + root_markers = { '.git' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/jsonnet_ls.lua b/arch/lightvim/.config/lightvim/lsp/jsonnet_ls.lua new file mode 100644 index 0000000..c5b0dee --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/jsonnet_ls.lua @@ -0,0 +1,20 @@ +--- @brief +--- +--- https://github.com/grafana/jsonnet-language-server +--- +--- A Language Server Protocol (LSP) server for Jsonnet. +--- +--- The language server can be installed with `go`: +--- ```sh +--- go install github.com/grafana/jsonnet-language-server@latest +--- ``` + +---@type vim.lsp.Config +return { + cmd = { 'jsonnet-language-server' }, + filetypes = { + 'jsonnet', + 'libsonnet', + }, + root_markers = { 'jsonnetfile.json', '.git' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/julials.lua b/arch/lightvim/.config/lightvim/lsp/julials.lua new file mode 100644 index 0000000..053452c --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/julials.lua @@ -0,0 +1,138 @@ +---@brief +--- +--- https://github.com/julia-vscode/julia-vscode +--- +--- LanguageServer.jl, SymbolServer.jl and StaticLint.jl can be installed with `julia` and `Pkg`: +--- ```sh +--- julia --project=~/.julia/environments/nvim-lspconfig -e 'using Pkg; Pkg.add("LanguageServer"); Pkg.add("SymbolServer"); Pkg.add("StaticLint")' +--- ``` +--- where `~/.julia/environments/nvim-lspconfig` is the location where +--- the default configuration expects LanguageServer.jl, SymbolServer.jl and StaticLint.jl to be installed. +--- +--- To update an existing install, use the following command: +--- ```sh +--- julia --project=~/.julia/environments/nvim-lspconfig -e 'using Pkg; Pkg.update()' +--- ``` +--- +--- Note: In order to have LanguageServer.jl pick up installed packages or dependencies in a +--- Julia project, you must make sure that the project is instantiated: +--- ```sh +--- julia --project=/path/to/my/project -e 'using Pkg; Pkg.instantiate()' +--- ``` +--- +--- To activate a Julia environment, use the `:LspJuliaActivateEnv` command. A prompt will ask you to select a Julia +--- environment from the list of environments found in the current working directory and the `environments/` folder of +--- `$JULIA_DEPOT_PATH` entries. You can also provide a path to a Julia environment directly. +--- Example: `:LspJuliaActivateEnv /path/to/my/project`. +--- +--- Note: The julia programming language searches for global environments within the `environments/` +--- folder of `$JULIA_DEPOT_PATH` entries. By default this simply `~/.julia/environments` + +local root_files = { 'Project.toml', 'JuliaProject.toml' } + +local function activate_env(args) + assert(vim.fn.has 'nvim-0.10' == 1, 'requires Nvim 0.10 or newer') + local bufnr = vim.api.nvim_get_current_buf() + local julials_clients = vim.lsp.get_clients { bufnr = bufnr, name = 'julials' } + assert( + #julials_clients > 0, + 'method julia/activateenvironment is not supported by any servers active on the current buffer' + ) + local function _activate_env(environment) + if environment then + for _, julials_client in ipairs(julials_clients) do + ---@diagnostic disable-next-line: param-type-mismatch + julials_client:notify('julia/activateenvironment', { envPath = environment }) + end + vim.notify('Julia environment activated: \n`' .. environment .. '`', vim.log.levels.INFO) + end + end + local path = args.args + if path ~= nil and #path > 0 then + path = vim.fs.normalize(vim.fn.fnamemodify(vim.fn.expand(path), ':p')) + local found_env = false + for _, project_file in ipairs(root_files) do + local file = vim.uv.fs_stat(vim.fs.joinpath(path, project_file)) + if file and file.type then + found_env = true + break + end + end + if not found_env then + vim.notify('Path is not a julia environment: \n`' .. path .. '`', vim.log.levels.WARN) + return + end + _activate_env(path) + else + local depot_paths = vim.env.JULIA_DEPOT_PATH + and vim.split(vim.env.JULIA_DEPOT_PATH, vim.fn.has 'win32' == 1 and ';' or ':') + or { vim.fn.expand '~/.julia' } + local environments = {} + vim.list_extend(environments, vim.fs.find(root_files, { type = 'file', upward = true, limit = math.huge })) + for _, depot_path in ipairs(depot_paths) do + local depot_env = vim.fs.joinpath(vim.fs.normalize(depot_path), 'environments') + vim.list_extend( + environments, + vim.fs.find(function(name, env_path) + return vim.tbl_contains(root_files, name) and string.sub(env_path, #depot_env + 1):match '^/[^/]*$' + end, { path = depot_env, type = 'file', limit = math.huge }) + ) + end + environments = vim.tbl_map(vim.fs.dirname, environments) + vim.ui.select(environments, { prompt = 'Select a Julia environment' }, _activate_env) + end +end + +local cmd = { + 'julia', + '--startup-file=no', + '--history-file=no', + '-e', + [[ + # Load LanguageServer.jl: attempt to load from ~/.julia/environments/nvim-lspconfig + # with the regular load path as a fallback + ls_install_path = joinpath( + get(DEPOT_PATH, 1, joinpath(homedir(), ".julia")), + "environments", "nvim-lspconfig" + ) + pushfirst!(LOAD_PATH, ls_install_path) + using LanguageServer, SymbolServer, StaticLint + popfirst!(LOAD_PATH) + depot_path = get(ENV, "JULIA_DEPOT_PATH", "") + project_path = let + dirname(something( + ## 1. Finds an explicitly set project (JULIA_PROJECT) + Base.load_path_expand(( + p = get(ENV, "JULIA_PROJECT", nothing); + p === nothing ? nothing : isempty(p) ? nothing : p + )), + ## 2. Look for a Project.toml file in the current working directory, + ## or parent directories, with $HOME as an upper boundary + Base.current_project(), + ## 3. First entry in the load path + get(Base.load_path(), 1, nothing), + ## 4. Fallback to default global environment, + ## this is more or less unreachable + Base.load_path_expand("@v#.#"), + )) + end + @info "Running language server" VERSION pwd() project_path depot_path + server = LanguageServer.LanguageServerInstance(stdin, stdout, project_path, depot_path) + server.runlinter = true + run(server) + ]], +} + +---@type vim.lsp.Config +return { + cmd = cmd, + filetypes = { 'julia' }, + root_markers = root_files, + on_attach = function(_, bufnr) + vim.api.nvim_buf_create_user_command(bufnr, 'LspJuliaActivateEnv', activate_env, { + desc = 'Activate a Julia environment', + nargs = '?', + complete = 'file', + }) + end, +} diff --git a/arch/lightvim/.config/lightvim/lsp/just.lua b/arch/lightvim/.config/lightvim/lsp/just.lua new file mode 100644 index 0000000..a5db058 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/just.lua @@ -0,0 +1,12 @@ +---@brief +--- +--- https://github.com/terror/just-lsp +--- +--- `just-lsp` is an LSP for just built on top of the tree-sitter-just parser. + +---@type vim.lsp.Config +return { + cmd = { 'just-lsp' }, + filetypes = { 'just' }, + root_markers = { '.git' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/kakehashi.lua b/arch/lightvim/.config/lightvim/lsp/kakehashi.lua new file mode 100644 index 0000000..b37ff7b --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/kakehashi.lua @@ -0,0 +1,41 @@ +--- @brief +--- +--- https://github.com/atusy/kakehashi +--- +--- Tree-sitter-based language server that provides semantic tokens, selection ranges, +--- and LSP bridging for embedded languages (e.g., code blocks in Markdown). +--- +--- kakehashi works with any language that has a Tree-sitter grammar. +--- Parsers and queries are automatically installed on first use +--- when `autoInstall` is enabled (the default). This requires the +--- `tree-sitter` CLI, a C compiler, and Git. +--- +--- **You must specify `filetypes` in your call to `vim.lsp.config`** to +--- restrict which files activate the server: +--- +--- ```lua +--- vim.lsp.config('kakehashi', { +--- filetypes = { 'markdown', 'lua', 'rust', 'python' }, +--- init_options = { +--- autoInstall = true, +--- -- Optional: bridge LSP requests in injection regions +--- languageServers = { +--- ['lua_ls'] = { +--- cmd = { 'lua-language-server' }, +--- languages = { 'lua' }, +--- }, +--- }, +--- languages = { +--- markdown = { +--- bridge = { lua_ls = { enabled = true } }, +--- }, +--- }, +--- }, +--- }) +--- ``` + +---@type vim.lsp.Config +return { + cmd = { 'kakehashi' }, + root_markers = { 'kakehashi.toml', '.git' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/kcl.lua b/arch/lightvim/.config/lightvim/lsp/kcl.lua new file mode 100644 index 0000000..08041fc --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/kcl.lua @@ -0,0 +1,13 @@ +---@brief +--- +--- https://github.com/kcl-lang/kcl.nvim +--- +--- Language server for the KCL configuration and policy language. +--- + +---@type vim.lsp.Config +return { + cmd = { 'kcl-language-server' }, + filetypes = { 'kcl' }, + root_markers = { '.git' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/koka.lua b/arch/lightvim/.config/lightvim/lsp/koka.lua new file mode 100644 index 0000000..c5a3df3 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/koka.lua @@ -0,0 +1,11 @@ +---@brief +--- +--- https://koka-lang.github.io/koka/doc/index.html +--- Koka is a functional programming language with effect types and handlers. + +---@type vim.lsp.Config +return { + cmd = { 'koka', '--language-server', '--lsstdio' }, + filetypes = { 'koka' }, + root_markers = { '.git' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/kotlin_language_server.lua b/arch/lightvim/.config/lightvim/lsp/kotlin_language_server.lua new file mode 100644 index 0000000..ee18f32 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/kotlin_language_server.lua @@ -0,0 +1,42 @@ +---@brief +--- +--- A kotlin language server which was developed for internal usage and +--- released afterwards. Maintaining is not done by the original author, +--- but by fwcd. +--- +--- It is built via gradle and developed on github. +--- Source and additional description: +--- https://github.com/fwcd/kotlin-language-server +--- +--- This server requires vim to be aware of the kotlin-filetype. +--- You could refer for this capability to: +--- https://github.com/udalov/kotlin-vim (recommended) +--- Note that there is no LICENSE specified yet. +--- +--- For faster startup, you can setup caching by specifying a storagePath +--- in the init_options. The default is your home directory. + +--- The presence of one of these files indicates a project root directory +-- +-- These are configuration files for the various build systems supported by +-- Kotlin. I am not sure whether the language server supports Ant projects, +-- but I'm keeping it here as well since Ant does support Kotlin. +local root_files = { + 'settings.gradle', -- Gradle (multi-project) + 'settings.gradle.kts', -- Gradle (multi-project) + 'build.xml', -- Ant + 'pom.xml', -- Maven + 'build.gradle', -- Gradle + 'build.gradle.kts', -- Gradle +} + +---@type vim.lsp.Config +return { + filetypes = { 'kotlin' }, + root_markers = root_files, + cmd = { 'kotlin-language-server' }, + init_options = { + -- Enables caching and use project root to store cache data. + storagePath = vim.fs.root(vim.fn.expand '%:p:h', root_files) --[[@as string]], + }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/kotlin_lsp.lua b/arch/lightvim/.config/lightvim/lsp/kotlin_lsp.lua new file mode 100644 index 0000000..be78426 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/kotlin_lsp.lua @@ -0,0 +1,23 @@ +---@brief +---Pre-alpha official Kotlin support for Visual Studio Code and an implementation of Language Server Protocol for the Kotlin language. +--- +---The server is based on IntelliJ IDEA and the IntelliJ IDEA Kotlin Plugin implementation. + +--- The presence of one of these files indicates a project root directory +-- +-- These are configuration files for the various build systems supported by +-- Kotlin. + +---@type vim.lsp.Config +return { + filetypes = { 'kotlin' }, + cmd = { 'intellij-server', '--stdio' }, + root_markers = { + 'settings.gradle', -- Gradle (multi-project) + 'settings.gradle.kts', -- Gradle (multi-project) + 'pom.xml', -- Maven + 'build.gradle', -- Gradle + 'build.gradle.kts', -- Gradle + 'workspace.json', -- Used to integrate your own build system + }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/kulala_ls.lua b/arch/lightvim/.config/lightvim/lsp/kulala_ls.lua new file mode 100644 index 0000000..e56a2cf --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/kulala_ls.lua @@ -0,0 +1,12 @@ +---@brief +--- +--- https://github.com/mistweaverco/kulala-ls +--- +--- A minimal language server for HTTP syntax. + +---@type vim.lsp.Config +return { + cmd = { 'kulala-ls', '--stdio' }, + filetypes = { 'http' }, + root_markers = { '.git' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/laravel_ls.lua b/arch/lightvim/.config/lightvim/lsp/laravel_ls.lua new file mode 100644 index 0000000..59d986f --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/laravel_ls.lua @@ -0,0 +1,14 @@ +---@brief +--- +--- https://github.com/laravel-ls/laravel-ls +--- +--- `laravel-ls`, language server for laravel +--- +--- The default `cmd` assumes that the `laravel-ls` binary can be found in `$PATH`. + +---@type vim.lsp.Config +return { + cmd = { 'laravel-ls' }, + filetypes = { 'php', 'blade' }, + root_markers = { 'artisan' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/lean3ls.lua b/arch/lightvim/.config/lightvim/lsp/lean3ls.lua new file mode 100644 index 0000000..aefbbe9 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/lean3ls.lua @@ -0,0 +1,40 @@ +---@brief +--- +--- https://github.com/leanprover/lean-client-js/tree/master/lean-language-server +--- +--- Lean installation instructions can be found +--- [here](https://leanprover-community.github.io/get_started.html#regular-install). +--- +--- Once Lean is installed, you can install the Lean 3 language server by running +--- ```sh +--- npm install -g lean-language-server +--- ``` +--- +--- Note: that if you're using [lean.nvim](https://github.com/Julian/lean.nvim), +--- that plugin fully handles the setup of the Lean language server, +--- and you shouldn't set up `lean3ls` both with it and `lspconfig`. + +---@type vim.lsp.Config +return { + cmd = { 'lean-language-server', '--stdio', '--', '-M', '4096', '-T', '100000' }, + filetypes = { 'lean3' }, + offset_encoding = 'utf-32', + root_dir = function(bufnr, on_dir) + local fname = vim.api.nvim_buf_get_name(bufnr) + fname = vim.fs.normalize(fname) + -- check if inside elan stdlib + local stdlib_dir + do + local _, endpos = fname:find '/lean/library' + if endpos then + stdlib_dir = fname:sub(1, endpos) + end + end + + on_dir( + vim.fs.root(fname, { 'leanpkg.toml', 'leanpkg.path' }) + or stdlib_dir + or vim.fs.dirname(vim.fs.find('.git', { path = fname, upward = true })[1]) + ) + end, +} diff --git a/arch/lightvim/.config/lightvim/lsp/lelwel_ls.lua b/arch/lightvim/.config/lightvim/lsp/lelwel_ls.lua new file mode 100644 index 0000000..0b04eb1 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/lelwel_ls.lua @@ -0,0 +1,17 @@ +---@brief +--- +--- https://github.com/0x2a-42/lelwel +--- +--- Language server for lelwel grammars. +--- +--- You can install `lelwel-ls` via cargo: +--- ```sh +--- cargo install --features="lsp" lelwel +--- ``` + +---@type vim.lsp.Config +return { + cmd = { 'lelwel-ls' }, + filetypes = { 'llw' }, + root_markers = { '.git' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/lemminx.lua b/arch/lightvim/.config/lightvim/lsp/lemminx.lua new file mode 100644 index 0000000..4aac3a8 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/lemminx.lua @@ -0,0 +1,14 @@ +---@brief +--- +--- https://github.com/eclipse/lemminx +--- +--- The easiest way to install the server is to get a binary from https://github.com/redhat-developer/vscode-xml/releases and place it on your PATH. +--- +--- NOTE to macOS users: Binaries from unidentified developers are blocked by default. If you trust the downloaded binary, run it once, cancel the prompt, then remove the binary from Gatekeeper quarantine with `xattr -d com.apple.quarantine lemminx`. It should now run without being blocked. + +---@type vim.lsp.Config +return { + cmd = { 'lemminx' }, + filetypes = { 'xml', 'xsd', 'xsl', 'xslt', 'svg' }, + root_markers = { '.git' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/lexical.lua b/arch/lightvim/.config/lightvim/lsp/lexical.lua new file mode 100644 index 0000000..6968a5e --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/lexical.lua @@ -0,0 +1,15 @@ +---@brief +--- +--- https://github.com/lexical-lsp/lexical +--- +--- Lexical is a next-generation language server for the Elixir programming language. +--- +--- To install from source, follow the [Detailed Installation Instructions](https://github.com/lexical-lsp/lexical/blob/main/pages/installation.md). +--- Ensure to point `cmd` to the generated `_build/dev/package/lexical/start_lexical.sh` executable. + +---@type vim.lsp.Config +return { + cmd = { 'lexical' }, + filetypes = { 'elixir', 'eelixir', 'heex', 'surface' }, + root_markers = { 'mix.exs', '.git' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/lsp_ai.lua b/arch/lightvim/.config/lightvim/lsp/lsp_ai.lua new file mode 100644 index 0000000..ef853e2 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/lsp_ai.lua @@ -0,0 +1,24 @@ +---@brief +--- +--- https://github.com/SilasMarvin/lsp-ai +--- +--- LSP-AI is an open source language server that serves as a backend for AI-powered functionality in your favorite code +--- editors. It offers features like in-editor chatting with LLMs and code completions. +--- +--- +--- You will need to provide configuration for the inference backends and models you want to use, as well as configure +--- completion/code actions. See the [wiki docs](https://github.com/SilasMarvin/lsp-ai/wiki/Configuration) and +--- [examples](https://github.com/SilasMarvin/lsp-ai/blob/main/examples/nvim) for more information. + +---@type vim.lsp.Config +return { + cmd = { 'lsp-ai' }, + filetypes = {}, + root_dir = nil, + init_options = { + memory = { + file_store = vim.empty_dict(), + }, + models = vim.empty_dict(), + }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/ltex.lua b/arch/lightvim/.config/lightvim/lsp/ltex.lua new file mode 100644 index 0000000..eda6b7e --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/ltex.lua @@ -0,0 +1,86 @@ +---@brief +--- +--- https://github.com/valentjn/ltex-ls +--- +--- LTeX Language Server: LSP language server for LanguageTool 🔍✔️ with support for LaTeX 🎓, Markdown 📝, and others +--- +--- To install, download the latest [release](https://github.com/valentjn/ltex-ls/releases) and ensure `ltex-ls` is on your path. +--- +--- This server accepts configuration via the `settings` key. +--- +--- ```lua +--- settings = { +--- ltex = { +--- language = "en-GB", +--- }, +--- }, +--- ``` +--- +--- To support org files or R sweave, users can define a custom filetype autocommand (or use a plugin which defines these filetypes): +--- +--- ```lua +--- vim.cmd [[ autocmd BufRead,BufNewFile *.org set filetype=org ]] +--- ``` + +local language_id_mapping = { + bib = 'bibtex', + plaintex = 'tex', + rnoweb = 'rsweave', + rst = 'restructuredtext', + tex = 'latex', + pandoc = 'markdown', + text = 'plaintext', +} + +local filetypes = { + 'bib', + 'gitcommit', + 'markdown', + 'org', + 'plaintex', + 'rst', + 'rnoweb', + 'tex', + 'pandoc', + 'quarto', + 'rmd', + 'context', + 'html', + 'xhtml', + 'mail', + 'text', +} + +local function get_language_id(_, filetype) + local language_id = language_id_mapping[filetype] + if language_id then + return language_id + else + return filetype + end +end +local enabled_ids = {} +do + local enabled_keys = {} + for _, ft in ipairs(filetypes) do + local id = get_language_id({}, ft) + if not enabled_keys[id] then + enabled_keys[id] = true + table.insert(enabled_ids, id) + end + end +end + +---@type vim.lsp.Config +return { + cmd = { 'ltex-ls' }, + filetypes = filetypes, + root_markers = { '.git' }, + get_language_id = get_language_id, + ---@type lspconfig.settings.ltex + settings = { + ltex = { + enabled = enabled_ids, + }, + }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/ltex_plus.lua b/arch/lightvim/.config/lightvim/lsp/ltex_plus.lua new file mode 100644 index 0000000..d9b9941 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/ltex_plus.lua @@ -0,0 +1,89 @@ +---@brief +--- +--- https://github.com/ltex-plus/ltex-ls-plus +--- +--- LTeX Language Server: LSP language server for LanguageTool 🔍✔️ with support for LaTeX 🎓, Markdown 📝, and others +--- +--- To install, download the latest [release](https://github.com/ltex-plus/ltex-ls-plus) and ensure `ltex-ls-plus` is on your path. +--- +--- This server accepts configuration via the `settings` key. +--- +--- ```lua +--- settings = { +--- ltex = { +--- language = "en-GB", +--- }, +--- }, +--- ``` +--- +--- To support org files or R sweave, users can define a custom filetype autocommand (or use a plugin which defines these filetypes): +--- +--- ```lua +--- vim.cmd [[ autocmd BufRead,BufNewFile *.org set filetype=org ]] +--- ``` + +local language_id_mapping = { + bib = 'bibtex', + pandoc = 'markdown', + plaintex = 'tex', + rnoweb = 'rsweave', + rst = 'restructuredtext', + tex = 'latex', + text = 'plaintext', +} + +---@type vim.lsp.Config +return { + cmd = { 'ltex-ls-plus' }, + filetypes = { + 'asciidoc', + 'bib', + 'context', + 'gitcommit', + 'html', + 'markdown', + 'org', + 'pandoc', + 'plaintex', + 'quarto', + 'mail', + 'mdx', + 'rmd', + 'rnoweb', + 'rst', + 'tex', + 'text', + 'typst', + 'xhtml', + }, + root_markers = { '.git' }, + get_language_id = function(_, filetype) + return language_id_mapping[filetype] or filetype + end, + settings = { + ltex = { + enabled = { + 'asciidoc', + 'bib', + 'context', + 'gitcommit', + 'html', + 'markdown', + 'org', + 'pandoc', + 'plaintex', + 'quarto', + 'mail', + 'mdx', + 'rmd', + 'rnoweb', + 'rst', + 'tex', + 'latex', + 'text', + 'typst', + 'xhtml', + }, + }, + }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/lua_ls.lua b/arch/lightvim/.config/lightvim/lsp/lua_ls.lua new file mode 100644 index 0000000..e1b393a --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/lua_ls.lua @@ -0,0 +1,97 @@ +---@brief +--- +--- https://github.com/luals/lua-language-server +--- +--- Lua language server. +--- +--- `lua-language-server` can be installed by following the instructions [here](https://luals.github.io/#neovim-install). +--- +--- The default `cmd` assumes that the `lua-language-server` binary can be found in `$PATH`. +--- +--- If you primarily use `lua-language-server` for Neovim, and want to provide completions, +--- analysis, and location handling for plugins on runtime path, you can use the following +--- settings. +--- +--- ```lua +--- vim.lsp.config('lua_ls', { +--- on_init = function(client) +--- if client.workspace_folders then +--- local path = client.workspace_folders[1].name +--- if +--- path ~= vim.fn.stdpath('config') +--- and (vim.uv.fs_stat(path .. '/.luarc.json') or vim.uv.fs_stat(path .. '/.luarc.jsonc')) +--- then +--- return +--- end +--- end +--- +--- client.config.settings.Lua = vim.tbl_deep_extend('force', client.config.settings.Lua, { +--- runtime = { +--- -- Tell the language server which version of Lua you're using (most +--- -- likely LuaJIT in the case of Neovim) +--- version = 'LuaJIT', +--- -- Tell the language server how to find Lua modules same way as Neovim +--- -- (see `:h lua-module-load`) +--- path = { +--- 'lua/?.lua', +--- 'lua/?/init.lua', +--- }, +--- }, +--- -- Make the server aware of Neovim runtime files +--- workspace = { +--- checkThirdParty = false, +--- library = { +--- vim.env.VIMRUNTIME, +--- -- For LSP Settings Type Annotations: https://github.com/neovim/nvim-lspconfig#lsp-settings-type-annotations +--- vim.api.nvim_get_runtime_file("lua/lspconfig", false)[1], +--- -- Depending on the usage, you might want to add additional paths +--- -- here. +--- -- '${3rd}/luv/library', +--- -- '${3rd}/busted/library', +--- }, +--- -- Or pull in all of 'runtimepath'. +--- -- NOTE: this is a lot slower and will cause issues when working on +--- -- your own configuration. +--- -- See https://github.com/neovim/nvim-lspconfig/issues/3189 +--- -- library = vim.api.nvim_get_runtime_file('', true), +--- }, +--- }) +--- end, +--- settings = { +--- Lua = {}, +--- }, +--- }) +--- ``` +--- +--- See `lua-language-server`'s [documentation](https://luals.github.io/wiki/settings/) for an explanation of the above fields: +--- * [Lua.runtime.path](https://luals.github.io/wiki/settings/#runtimepath) +--- * [Lua.workspace.library](https://luals.github.io/wiki/settings/#workspacelibrary) +--- + +local root_markers1 = { + '.emmyrc.json', + '.luarc.json', + '.luarc.jsonc', +} +local root_markers2 = { + '.luacheckrc', + '.stylua.toml', + 'stylua.toml', + 'selene.toml', + 'selene.yml', +} + +---@type vim.lsp.Config +return { + cmd = { 'lua-language-server' }, + filetypes = { 'lua' }, + root_markers = vim.fn.has('nvim-0.11.3') == 1 and { root_markers1, root_markers2, { '.git' } } + or vim.list_extend(vim.list_extend(root_markers1, root_markers2), { '.git' }), + ---@type lspconfig.settings.lua_ls + settings = { + Lua = { + codeLens = { enable = true }, + hint = { enable = true, semicolon = 'Disable' }, + }, + }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/luau_lsp.lua b/arch/lightvim/.config/lightvim/lsp/luau_lsp.lua new file mode 100644 index 0000000..8686501 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/luau_lsp.lua @@ -0,0 +1,20 @@ +---@brief +--- +--- https://github.com/JohnnyMorganz/luau-lsp +--- +--- Language server for the [Luau](https://luau-lang.org/) language. +--- +--- `luau-lsp` can be installed by downloading one of the release assets available at https://github.com/JohnnyMorganz/luau-lsp. +--- +--- You might also have to set up automatic filetype detection for Luau files, for example like so: +--- +--- ```vim +--- autocmd BufRead,BufNewFile *.luau setf luau +--- ``` + +---@type vim.lsp.Config +return { + cmd = { 'luau-lsp', 'lsp' }, + filetypes = { 'luau' }, + root_markers = { '.git' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/lwc_ls.lua b/arch/lightvim/.config/lightvim/lsp/lwc_ls.lua new file mode 100644 index 0000000..2e4ded3 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/lwc_ls.lua @@ -0,0 +1,30 @@ +---@brief +--- +--- https://github.com/forcedotcom/lightning-language-server/ +--- +--- Language server for Lightning Web Components. +--- +--- For manual installation, utilize the official [NPM package](https://www.npmjs.com/package/@salesforce/lwc-language-server). +--- Then, configure `cmd` to run the Node script at the unpacked location: +--- +--- ```lua +--- vim.lsp.config('lwc_ls', { +--- cmd = { +--- 'node', +--- '/path/to/node_modules/@salesforce/lwc-language-server/bin/lwc-language-server.js', +--- '--stdio' +--- } +--- }) +--- ``` + +---@type vim.lsp.Config +return { + cmd = { 'lwc-language-server', '--stdio' }, + filetypes = { 'javascript', 'html' }, + root_markers = { 'sfdx-project.json' }, + init_options = { + embeddedLanguages = { + javascript = true, + }, + }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/m68k.lua b/arch/lightvim/.config/lightvim/lsp/m68k.lua new file mode 100644 index 0000000..e54559a --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/m68k.lua @@ -0,0 +1,24 @@ +---@brief +--- +--- https://github.com/grahambates/m68k-lsp +--- +--- Language server for Motorola 68000 family assembly +--- +--- `m68k-lsp-server` can be installed via `npm`: +--- +--- ```sh +--- npm install -g m68k-lsp-server +--- ``` +--- +--- Ensure you are using the 68k asm syntax variant in Neovim. +--- +--- ```lua +--- vim.g.asmsyntax = 'asm68k' +--- ``` + +---@type vim.lsp.Config +return { + cmd = { 'm68k-lsp-server', '--stdio' }, + filetypes = { 'asm68k' }, + root_markers = { 'Makefile', '.git' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/markdown_oxide.lua b/arch/lightvim/.config/lightvim/lsp/markdown_oxide.lua new file mode 100644 index 0000000..cb61d23 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/markdown_oxide.lua @@ -0,0 +1,37 @@ +---@brief +--- +--- https://github.com/Feel-ix-343/markdown-oxide +--- +--- Editor Agnostic PKM: you bring the text editor and we +--- bring the PKM. +--- +--- Inspired by and compatible with Obsidian. +--- +--- Check the readme to see how to properly setup. + +---@param client vim.lsp.Client +---@param bufnr integer +---@param cmd string +local function command_factory(client, bufnr, cmd) + return client:exec_cmd({ + title = ('Markdown-Oxide-%s'):format(cmd), + command = 'jump', + arguments = { cmd }, + }, { bufnr = bufnr }) +end + +---@type vim.lsp.Config +return { + root_markers = { '.git', '.obsidian', '.moxide.toml' }, + filetypes = { 'markdown' }, + cmd = { 'markdown-oxide' }, + on_attach = function(client, bufnr) + for _, cmd in ipairs({ 'today', 'tomorrow', 'yesterday' }) do + vim.api.nvim_buf_create_user_command(bufnr, 'Lsp' .. ('%s'):format(cmd:gsub('^%l', string.upper)), function() + command_factory(client, bufnr, cmd) + end, { + desc = ('Open %s daily note'):format(cmd), + }) + end + end, +} diff --git a/arch/lightvim/.config/lightvim/lsp/marko-js.lua b/arch/lightvim/.config/lightvim/lsp/marko-js.lua new file mode 100644 index 0000000..fba69bd --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/marko-js.lua @@ -0,0 +1,17 @@ +---@brief +--- +--- https://github.com/marko-js/language-server +--- +--- Using the Language Server Protocol to improve Marko's developer experience. +--- +--- Can be installed via npm: +--- ``` +--- npm i -g @marko/language-server +--- ``` + +---@type vim.lsp.Config +return { + cmd = { 'marko-language-server', '--stdio' }, + filetypes = { 'marko' }, + root_markers = { '.git' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/marksman.lua b/arch/lightvim/.config/lightvim/lsp/marksman.lua new file mode 100644 index 0000000..fc1e048 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/marksman.lua @@ -0,0 +1,16 @@ +---@brief +--- +--- https://github.com/artempyanykh/marksman +--- +--- Marksman is a Markdown LSP server providing completion, cross-references, diagnostics, and more. +--- +--- Marksman works on MacOS, Linux, and Windows and is distributed as a self-contained binary for each OS. +--- +--- Pre-built binaries can be downloaded from https://github.com/artempyanykh/marksman/releases + +---@type vim.lsp.Config +return { + cmd = { 'marksman', 'server' }, + filetypes = { 'markdown', 'markdown.mdx' }, + root_markers = { '.marksman.toml', '.git' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/matlab_ls.lua b/arch/lightvim/.config/lightvim/lsp/matlab_ls.lua new file mode 100644 index 0000000..6da14a0 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/matlab_ls.lua @@ -0,0 +1,34 @@ +---@brief +--- +--- https://github.com/mathworks/MATLAB-language-server +--- +--- MATLAB® language server implements the Microsoft® Language Server Protocol for the MATLAB language. +--- +--- Make sure to set `MATLAB.installPath` to your MATLAB path, e.g.: +--- ```lua +--- settings = { +--- MATLAB = { +--- ... +--- installPath = '/usr/local/MATLAB/R2023a', +--- ... +--- }, +--- }, +--- ``` + +---@type vim.lsp.Config +return { + cmd = { 'matlab-language-server', '--stdio' }, + filetypes = { 'matlab' }, + root_dir = function(bufnr, on_dir) + local root_dir = vim.fs.root(bufnr, '.git') + on_dir(root_dir or vim.fn.getcwd()) + end, + settings = { + MATLAB = { + indexWorkspace = true, + installPath = '', -- NOTE: Set this to your MATLAB installation path. + matlabConnectionTiming = 'onStart', + telemetry = true, + }, + }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/mdx_analyzer.lua b/arch/lightvim/.config/lightvim/lsp/mdx_analyzer.lua new file mode 100644 index 0000000..3ff8136 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/mdx_analyzer.lua @@ -0,0 +1,22 @@ +---@brief +--- https://github.com/mdx-js/mdx-analyzer +--- +--- `mdx-analyzer`, a language server for MDX + +local util = require 'lspconfig.util' + +---@type vim.lsp.Config +return { + cmd = { 'mdx-language-server', '--stdio' }, + filetypes = { 'mdx' }, + root_markers = { 'package.json' }, + settings = {}, + init_options = { + typescript = {}, + }, + before_init = function(_, config) + if config.init_options and config.init_options.typescript and not config.init_options.typescript.tsdk then + config.init_options.typescript.tsdk = util.get_typescript_server_path(config.root_dir) + end + end, +} diff --git a/arch/lightvim/.config/lightvim/lsp/mesonlsp.lua b/arch/lightvim/.config/lightvim/lsp/mesonlsp.lua new file mode 100644 index 0000000..dc10550 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/mesonlsp.lua @@ -0,0 +1,38 @@ +---@brief +--- +--- https://github.com/JCWasmx86/mesonlsp +--- +--- An unofficial, unendorsed language server for meson written in C++ + +---Checks if a given path contains a valid Meson project root file +---Looks for 'meson.build' file which contains 'project()' function +local meson_matcher = function(_, path) + local pattern = 'meson.build' + local f = vim.fn.glob(table.concat({ path, pattern }, '/')) + if f == '' then + return false + end + for line in io.lines(f) do + -- skip meson comments + if not line:match '^%s*#.*' then + local str = line:gsub('%s+', '') + if str ~= '' then + if str:match '^project%(' then + return true + else + break + end + end + end + end + return false +end + +---@type vim.lsp.Config +return { + cmd = { 'mesonlsp', '--lsp' }, + filetypes = { 'meson' }, + root_dir = function(bufnr, on_dir) + on_dir(vim.fs.root(bufnr, meson_matcher) or vim.fs.root(bufnr, '.git')) + end, +} diff --git a/arch/lightvim/.config/lightvim/lsp/metals.lua b/arch/lightvim/.config/lightvim/lsp/metals.lua new file mode 100644 index 0000000..a9eaaa9 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/metals.lua @@ -0,0 +1,32 @@ +---@brief +--- +--- https://scalameta.org/metals/ +--- +--- Scala language server with rich IDE features. +--- +--- See full instructions in the Metals documentation: +--- +--- https://scalameta.org/metals/docs/editors/vim#using-an-alternative-lsp-client +--- +--- Note: that if you're using [nvim-metals](https://github.com/scalameta/nvim-metals), that plugin fully handles the setup and installation of Metals, and you shouldn't set up Metals both with it and `lspconfig`. +--- +--- To install Metals, make sure to have [coursier](https://get-coursier.io/docs/cli-installation) installed, and once you do you can install the latest Metals with `cs install metals`. + +---@type vim.lsp.Config +return { + cmd = { 'metals' }, + filetypes = { 'scala' }, + root_markers = { 'build.sbt', 'build.sc', { 'build.gradle', 'build.gradle.kts' }, 'pom.xml' }, + init_options = { + statusBarProvider = 'show-message', + isHttpEnabled = true, + compilerOptions = { + snippetAutoIndent = false, + }, + }, + capabilities = { + workspace = { + configuration = false, + }, + }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/millet.lua b/arch/lightvim/.config/lightvim/lsp/millet.lua new file mode 100644 index 0000000..87207b1 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/millet.lua @@ -0,0 +1,19 @@ +---@brief +--- +--- https://github.com/azdavis/millet +--- +--- Millet, a language server for Standard ML +--- +--- To use with nvim: +--- +--- 1. Install a Rust toolchain: https://rustup.rs +--- 2. Clone the repo +--- 3. Run `cargo build --release --bin millet-ls` +--- 4. Move `target/release/millet-ls` to somewhere on your $PATH as `millet` + +---@type vim.lsp.Config +return { + cmd = { 'millet' }, + filetypes = { 'sml' }, + root_markers = { 'millet.toml' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/mint.lua b/arch/lightvim/.config/lightvim/lsp/mint.lua new file mode 100644 index 0000000..fdcc238 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/mint.lua @@ -0,0 +1,13 @@ +---@brief +--- +--- https://www.mint-lang.com +--- +--- Install Mint using the [instructions](https://www.mint-lang.com/install). +--- The language server is included since version 0.12.0. + +---@type vim.lsp.Config +return { + cmd = { 'mint', 'ls' }, + filetypes = { 'mint' }, + root_markers = { 'mint.json', '.git' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/mlir_lsp_server.lua b/arch/lightvim/.config/lightvim/lsp/mlir_lsp_server.lua new file mode 100644 index 0000000..65365f2 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/mlir_lsp_server.lua @@ -0,0 +1,14 @@ +---@brief +--- +--- https://mlir.llvm.org/docs/Tools/MLIRLSP/#mlir-lsp-language-server--mlir-lsp-server= +--- +--- The Language Server for the LLVM MLIR language +--- +--- `mlir-lsp-server` can be installed at the llvm-project repository (https://github.com/llvm/llvm-project) + +---@type vim.lsp.Config +return { + cmd = { 'mlir-lsp-server' }, + filetypes = { 'mlir' }, + root_markers = { '.git' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/mlir_pdll_lsp_server.lua b/arch/lightvim/.config/lightvim/lsp/mlir_pdll_lsp_server.lua new file mode 100644 index 0000000..a3b6d88 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/mlir_pdll_lsp_server.lua @@ -0,0 +1,14 @@ +---@brief +--- +--- https://mlir.llvm.org/docs/Tools/MLIRLSP/#pdll-lsp-language-server--mlir-pdll-lsp-server +--- +--- The Language Server for the LLVM PDLL language +--- +--- `mlir-pdll-lsp-server` can be installed at the llvm-project repository (https://github.com/llvm/llvm-project) + +---@type vim.lsp.Config +return { + cmd = { 'mlir-pdll-lsp-server' }, + filetypes = { 'pdll' }, + root_markers = { 'pdll_compile_commands.yml', '.git' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/mm0_ls.lua b/arch/lightvim/.config/lightvim/lsp/mm0_ls.lua new file mode 100644 index 0000000..079a08d --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/mm0_ls.lua @@ -0,0 +1,15 @@ +---@brief +--- +--- https://github.com/digama0/mm0 +--- +--- Language Server for the metamath-zero theorem prover. +--- +--- Requires [mm0-rs](https://github.com/digama0/mm0/tree/master/mm0-rs) to be installed +--- and available on the `PATH`. + +---@type vim.lsp.Config +return { + cmd = { 'mm0-rs', 'server' }, + root_markers = { '.git' }, + filetypes = { 'metamath-zero' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/mojo.lua b/arch/lightvim/.config/lightvim/lsp/mojo.lua new file mode 100644 index 0000000..b0a9af9 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/mojo.lua @@ -0,0 +1,14 @@ +---@brief +--- +--- https://github.com/modularml/mojo +--- +--- `mojo-lsp-server` can be installed [via Modular](https://developer.modular.com/download) +--- +--- Mojo is a new programming language that bridges the gap between research and production by combining Python syntax and ecosystem with systems programming and metaprogramming features. + +---@type vim.lsp.Config +return { + cmd = { 'mojo-lsp-server' }, + filetypes = { 'mojo' }, + root_markers = { '.git' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/motoko_lsp.lua b/arch/lightvim/.config/lightvim/lsp/motoko_lsp.lua new file mode 100644 index 0000000..f4cd7e4 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/motoko_lsp.lua @@ -0,0 +1,15 @@ +---@brief +--- +--- https://github.com/dfinity/vscode-motoko +--- +--- Language server for the Motoko programming language. + +---@type vim.lsp.Config +return { + cmd = { 'motoko-lsp', '--stdio' }, + filetypes = { 'motoko' }, + root_markers = { 'dfx.json', '.git' }, + init_options = { + formatter = 'auto', + }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/move_analyzer.lua b/arch/lightvim/.config/lightvim/lsp/move_analyzer.lua new file mode 100644 index 0000000..6670882 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/move_analyzer.lua @@ -0,0 +1,20 @@ +---@brief +--- +--- https://github.com/move-language/move/tree/main/language/move-analyzer +--- +--- Language server for Move +--- +--- The `move-analyzer` can be installed by running: +--- +--- ``` +--- cargo install --git https://github.com/move-language/move move-analyzer +--- ``` +--- +--- See [`move-analyzer`'s doc](https://github.com/move-language/move/blob/1b258a06e3c7d2bc9174578aac92cca3ac19de71/language/move-analyzer/editors/code/README.md#how-to-install) for details. + +---@type vim.lsp.Config +return { + cmd = { 'move-analyzer' }, + filetypes = { 'move' }, + root_markers = { 'Move.toml' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/mpls.lua b/arch/lightvim/.config/lightvim/lsp/mpls.lua new file mode 100644 index 0000000..227342b --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/mpls.lua @@ -0,0 +1,36 @@ +---@brief +--- +--- https://github.com/mhersson/mpls +--- +--- Markdown Preview Language Server + +---@type vim.lsp.Config +return { + cmd = { + 'mpls', + '--theme', + 'dark', + '--enable-emoji', + '--enable-footnotes', + '--no-auto', + }, + root_markers = { '.marksman.toml', '.git' }, + filetypes = { 'markdown' }, + on_attach = function(client, bufnr) + vim.api.nvim_create_autocmd('BufEnter', { + pattern = { '*.md' }, + group = vim.api.nvim_create_augroup('lspconfig.mpls.focus', { clear = true }), + callback = function(ctx) + ---@diagnostic disable-next-line:param-type-mismatch + client:notify('mpls/editorDidChangeFocus', { uri = ctx.match }) + end, + desc = 'mpls: notify buffer focus changed', + }) + vim.api.nvim_buf_create_user_command(bufnr, 'LspMplsOpenPreview', function() + client:exec_cmd({ + title = 'Preview markdown with mpls', + command = 'open-preview', + }) + end, { desc = 'Preview markdown with mpls' }) + end, +} diff --git a/arch/lightvim/.config/lightvim/lsp/msbuild_project_tools_server.lua b/arch/lightvim/.config/lightvim/lsp/msbuild_project_tools_server.lua new file mode 100644 index 0000000..0f85e51 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/msbuild_project_tools_server.lua @@ -0,0 +1,47 @@ +---@brief +--- +--- https://github.com/tintoy/msbuild-project-tools-server/ +--- +--- MSBuild Project Tools Server can be installed by following the README.MD on the above repository. +--- +--- Example config: +--- ```lua +--- vim.lsp.config('msbuild_project_tools_server', { +--- cmd = {'dotnet', '/path/to/server/MSBuildProjectTools.LanguageServer.Host.dll'} +--- }) +--- ``` +--- +--- There's no builtin filetypes for msbuild files, would require some filetype aliases: +--- +--- ```lua +--- vim.filetype.add({ +--- extension = { +--- props = 'msbuild', +--- tasks = 'msbuild', +--- targets = 'msbuild', +--- }, +--- pattern = { +--- [ [[.*\..*proj]] ] = 'msbuild', +--- }, +--- }) +--- ``` +--- +--- Optionally tell treesitter to treat `msbuild` as `xml` so you can get syntax highlighting if you have the treesitter-xml-parser installed. +--- +--- ```lua +--- vim.treesitter.language.register('xml', { 'msbuild' }) +--- ``` + +local host_dll_name = 'MSBuildProjectTools.LanguageServer.Host.dll' +local util = require 'lspconfig.util' + +---@type vim.lsp.Config +return { + filetypes = { 'msbuild' }, + root_dir = function(bufnr, on_dir) + local fname = vim.api.nvim_buf_get_name(bufnr) + on_dir(util.root_pattern('*.sln', '*.slnx', '*.*proj', '.git')(fname)) + end, + init_options = {}, + cmd = { 'dotnet', host_dll_name }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/muon.lua b/arch/lightvim/.config/lightvim/lsp/muon.lua new file mode 100644 index 0000000..160878c --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/muon.lua @@ -0,0 +1,25 @@ +---@brief +--- +--- https://muon.build + +---@type vim.lsp.Config +return { + cmd = { 'muon', 'analyze', 'lsp' }, + filetypes = { 'meson' }, + root_dir = function(bufnr, on_dir) + local fname = vim.api.nvim_buf_get_name(bufnr) + local cmd = { 'muon', 'analyze', 'root-for', fname } + vim.system(cmd, { text = true }, function(output) + if output.code == 0 then + if output.stdout then + on_dir(vim.trim(output.stdout)) + return + end + + on_dir(nil) + else + vim.notify(('[muon] cmd failed with code %d: %s\n%s'):format(output.code, cmd, output.stderr)) + end + end) + end, +} diff --git a/arch/lightvim/.config/lightvim/lsp/mutt_ls.lua b/arch/lightvim/.config/lightvim/lsp/mutt_ls.lua new file mode 100644 index 0000000..050b411 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/mutt_ls.lua @@ -0,0 +1,17 @@ +---@brief +--- +--- https://github.com/neomutt/mutt-language-server +--- +--- A language server for (neo)mutt's muttrc. It can be installed via pip. +--- +--- ```sh +--- pip install mutt-language-server +--- ``` + +---@type vim.lsp.Config +return { + cmd = { 'mutt-language-server' }, + filetypes = { 'muttrc', 'neomuttrc' }, + root_markers = { '.git' }, + settings = {}, +} diff --git a/arch/lightvim/.config/lightvim/lsp/nelua_lsp.lua b/arch/lightvim/.config/lightvim/lsp/nelua_lsp.lua new file mode 100644 index 0000000..e0feff5 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/nelua_lsp.lua @@ -0,0 +1,31 @@ +--- @brief +--- +--- https://github.com/codehz/nelua-lsp +--- +--- nelua-lsp is an experimental nelua language server. +--- +--- You need [nelua.vim](https://github.com/stefanos82/nelua.vim/blob/main/ftdetect/nelua.vim) for nelua files to be recognized or add this to your config: +--- +--- in vimscript: +--- ```vimscript +--- au BufNewFile,BufRead *.nelua setf nelua +--- ``` +--- +--- in lua: +--- ```lua +--- vim.api.nvim_create_autocmd({ "BufNewFile", "BufRead" }, { pattern = { "*.nelua" }, command = "setf nelua"}) +--- ``` +--- +--- **By default, nelua-lsp doesn't have a `cmd` set.** This is because nvim-lspconfig does not make assumptions about your path. You must add the following to your init.vim or init.lua to set `cmd` to the absolute path ($HOME and ~ are not expanded) of the unzipped run script or binary. +--- +--- ```lua +--- vim.lsp.config('nelua_lsp', { +--- cmd = { "nelua", "-L", "/path/to/nelua-lsp/", "--script", "/path/to/nelua-lsp/nelua-lsp.lua" }, +--- }) +--- ``` + +---@type vim.lsp.Config +return { + filetypes = { 'nelua' }, + root_markers = { 'Makefile', '.git', '*.nelua' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/neocmake.lua b/arch/lightvim/.config/lightvim/lsp/neocmake.lua new file mode 100644 index 0000000..4769955 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/neocmake.lua @@ -0,0 +1,24 @@ +---@brief +--- +--- https://github.com/neocmakelsp/neocmakelsp +--- +--- CMake LSP Implementation +--- +--- Neovim does not currently include built-in snippets. `neocmakelsp` only provides completions when snippet support is enabled. To enable completion, install a snippet plugin and add the following override to your language client capabilities during setup. +--- +--- ```lua +--- --Enable (broadcasting) snippet capability for completion +--- local capabilities = vim.lsp.protocol.make_client_capabilities() +--- capabilities.textDocument.completion.completionItem.snippetSupport = true +--- +--- vim.lsp.config('neocmake', { +--- capabilities = capabilities, +--- }) +--- ``` + +---@type vim.lsp.Config +return { + cmd = { 'neocmakelsp', 'stdio' }, + filetypes = { 'cmake' }, + root_markers = { '.neocmake.toml', '.git', 'build', 'cmake' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/nextflow_ls.lua b/arch/lightvim/.config/lightvim/lsp/nextflow_ls.lua new file mode 100644 index 0000000..a1d1efe --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/nextflow_ls.lua @@ -0,0 +1,38 @@ +---@brief +--- +--- https://github.com/nextflow-io/language-server +--- +--- Requirements: +--- - Java 17+ +--- +--- `nextflow_ls` can be installed by following the instructions [here](https://github.com/nextflow-io/language-server#development). +--- +--- If you have installed nextflow language server, you can set the `cmd` custom path as follow: +--- +--- ```lua +--- vim.lsp.config('nextflow_ls', { +--- cmd = { 'nextflow-language-server' }, +--- filetypes = { 'nextflow' }, +--- settings = { +--- nextflow = { +--- files = { +--- exclude = { '.git', '.nf-test', 'work' }, +--- }, +--- }, +--- }, +--- }) +--- ``` + +---@type vim.lsp.Config +return { + cmd = { 'nextflow-language-server' }, + filetypes = { 'nextflow' }, + root_markers = { 'nextflow.config', '.git' }, + settings = { + nextflow = { + files = { + exclude = { '.git', '.nf-test', 'work' }, + }, + }, + }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/nextls.lua b/arch/lightvim/.config/lightvim/lsp/nextls.lua new file mode 100644 index 0000000..c243dfb --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/nextls.lua @@ -0,0 +1,12 @@ +---@brief +--- +--- https://github.com/elixir-tools/next-ls +--- +--- **Please see the following [detailed instructions](https://www.elixir-tools.dev/docs/next-ls/installation/) for possible installation methods.** + +---@type vim.lsp.Config +return { + cmd = { 'nextls', '--stdio' }, + filetypes = { 'elixir', 'eelixir', 'heex', 'surface' }, + root_markers = { 'mix.exs', '.git' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/nginx_language_server.lua b/arch/lightvim/.config/lightvim/lsp/nginx_language_server.lua new file mode 100644 index 0000000..4a8c0e8 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/nginx_language_server.lua @@ -0,0 +1,16 @@ +---@brief +--- +--- https://pypi.org/project/nginx-language-server/ +--- +--- `nginx-language-server` can be installed via pip: +--- +--- ```sh +--- pip install -U nginx-language-server +--- ``` + +---@type vim.lsp.Config +return { + cmd = { 'nginx-language-server' }, + filetypes = { 'nginx' }, + root_markers = { 'nginx.conf', '.git' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/nickel_ls.lua b/arch/lightvim/.config/lightvim/lsp/nickel_ls.lua new file mode 100644 index 0000000..74fe33c --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/nickel_ls.lua @@ -0,0 +1,32 @@ +---@brief +--- +--- Nickel Language Server +--- +--- https://github.com/tweag/nickel +--- +--- `nls` can be installed with nix, or cargo, from the Nickel repository. +--- ```sh +--- git clone https://github.com/tweag/nickel.git +--- ``` +--- +--- Nix: +--- ```sh +--- cd nickel +--- nix-env -f . -i +--- ``` +--- +--- cargo: +--- ```sh +--- cd nickel/lsp/nls +--- cargo install --path . +--- ``` +--- +--- In order to have lspconfig detect Nickel filetypes (a prerequisite for autostarting a server), +--- install the [Nickel vim plugin](https://github.com/nickel-lang/vim-nickel). + +---@type vim.lsp.Config +return { + cmd = { 'nls' }, + filetypes = { 'ncl', 'nickel' }, + root_markers = { '.git' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/nil_ls.lua b/arch/lightvim/.config/lightvim/lsp/nil_ls.lua new file mode 100644 index 0000000..da8ee63 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/nil_ls.lua @@ -0,0 +1,17 @@ +---@brief +--- +--- https://github.com/oxalica/nil +--- +--- A new language server for Nix Expression Language. +--- +--- If you are using Nix with Flakes support, run `nix profile install github:oxalica/nil` to install. +--- Check the repository README for more information. +--- +--- _See an example config at https://github.com/oxalica/nil/blob/main/dev/nvim-lsp.nix._ + +---@type vim.lsp.Config +return { + cmd = { 'nil' }, + filetypes = { 'nix' }, + root_markers = { 'flake.nix', '.git' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/nim_langserver.lua b/arch/lightvim/.config/lightvim/lsp/nim_langserver.lua new file mode 100644 index 0000000..441ee24 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/nim_langserver.lua @@ -0,0 +1,23 @@ +---@brief +--- +--- https://github.com/nim-lang/langserver +--- +--- +--- `nim-langserver` can be installed via the `nimble` package manager: +--- ```sh +--- nimble install nimlangserver +--- ``` + +local util = require 'lspconfig.util' + +---@type vim.lsp.Config +return { + cmd = { 'nimlangserver' }, + filetypes = { 'nim' }, + root_dir = function(bufnr, on_dir) + local fname = vim.api.nvim_buf_get_name(bufnr) + on_dir( + util.root_pattern '*.nimble'(fname) or vim.fs.dirname(vim.fs.find('.git', { path = fname, upward = true })[1]) + ) + end, +} diff --git a/arch/lightvim/.config/lightvim/lsp/nimls.lua b/arch/lightvim/.config/lightvim/lsp/nimls.lua new file mode 100644 index 0000000..ad5b7a0 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/nimls.lua @@ -0,0 +1,23 @@ +---@brief +--- +--- https://github.com/PMunch/nimlsp +--- +--- `nimlsp` can be installed via the `nimble` package manager: +--- +--- ```sh +--- nimble install nimlsp +--- ``` + +local util = require 'lspconfig.util' + +---@type vim.lsp.Config +return { + cmd = { 'nimlsp' }, + filetypes = { 'nim' }, + root_dir = function(bufnr, on_dir) + local fname = vim.api.nvim_buf_get_name(bufnr) + on_dir( + util.root_pattern '*.nimble'(fname) or vim.fs.dirname(vim.fs.find('.git', { path = fname, upward = true })[1]) + ) + end, +} diff --git a/arch/lightvim/.config/lightvim/lsp/nixd.lua b/arch/lightvim/.config/lightvim/lsp/nixd.lua new file mode 100644 index 0000000..64ff08e --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/nixd.lua @@ -0,0 +1,15 @@ +---@brief +--- +--- https://github.com/nix-community/nixd +--- +--- Nix language server, based on nix libraries. +--- +--- If you are using Nix with Flakes support, run `nix profile install github:nix-community/nixd` to install. +--- Check the repository README for more information. + +---@type vim.lsp.Config +return { + cmd = { 'nixd' }, + filetypes = { 'nix' }, + root_markers = { 'flake.nix', '.git' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/nomad_lsp.lua b/arch/lightvim/.config/lightvim/lsp/nomad_lsp.lua new file mode 100644 index 0000000..2388683 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/nomad_lsp.lua @@ -0,0 +1,34 @@ +---@brief +--- +--- https://github.com/juliosueiras/nomad-lsp +--- +--- Written in Go, compilation is needed for `nomad_lsp` to be used. Please see the [original repository](https://github.com/juliosuieras/nomad-lsp). +--- +--- Add the executable to your system or vim PATH and it will be set to go. +--- +--- No configuration option is needed unless you choose not to add `nomad-lsp` executable to the PATH. You should know what you are doing if you choose so. +--- +--- ```lua +--- vim.lsp.enable('nomad_lsp') +--- ``` +--- +--- However, a `hcl.nomad` or `nomad` filetype should be defined. +--- +--- Description of your jobs should be written in `.nomad` files for the LSP client to configure the server's `root_dir` configuration option. + +local util = require 'lspconfig.util' +local bin_name = 'nomad-lsp' + +if vim.fn.has 'win32' == 1 then + bin_name = bin_name .. '.exe' +end + +---@type vim.lsp.Config +return { + cmd = { bin_name }, + filetypes = { 'hcl.nomad', 'nomad' }, + root_dir = function(bufnr, on_dir) + local fname = vim.api.nvim_buf_get_name(bufnr) + on_dir(util.root_pattern '*.nomad'(fname)) + end, +} diff --git a/arch/lightvim/.config/lightvim/lsp/ntt.lua b/arch/lightvim/.config/lightvim/lsp/ntt.lua new file mode 100644 index 0000000..6fcbb28 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/ntt.lua @@ -0,0 +1,20 @@ +---@brief +--- +--- https://github.com/nokia/ntt +--- Installation instructions can be found [here](https://github.com/nokia/ntt#Install). +--- Can be configured by passing a "settings" object to vim.lsp.config('ntt'): +--- ```lua +--- vim.lsp.config('ntt', { +--- settings = { +--- ntt = { +--- } +--- } +--- }) +--- ``` + +---@type vim.lsp.Config +return { + cmd = { 'ntt', 'langserver' }, + filetypes = { 'ttcn' }, + root_markers = { '.git' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/nushell.lua b/arch/lightvim/.config/lightvim/lsp/nushell.lua new file mode 100644 index 0000000..0cd85e7 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/nushell.lua @@ -0,0 +1,14 @@ +---@brief +--- +--- https://github.com/nushell/nushell +--- +--- Nushell built-in language server. + +---@type vim.lsp.Config +return { + cmd = { 'nu', '--lsp' }, + filetypes = { 'nu' }, + root_dir = function(bufnr, on_dir) + on_dir(vim.fs.root(bufnr, { '.git' }) or vim.fs.dirname(vim.api.nvim_buf_get_name(bufnr))) + end, +} diff --git a/arch/lightvim/.config/lightvim/lsp/nxls.lua b/arch/lightvim/.config/lightvim/lsp/nxls.lua new file mode 100644 index 0000000..1fb9755 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/nxls.lua @@ -0,0 +1,17 @@ +---@brief +--- +--- https://github.com/nrwl/nx-console/tree/master/apps/nxls +--- +--- nxls, a language server for Nx Workspaces +--- +--- `nxls` can be installed via `npm`: +--- ```sh +--- npm i -g nxls +--- ``` + +---@type vim.lsp.Config +return { + cmd = { 'nxls', '--stdio' }, + filetypes = { 'json', 'jsonc' }, + root_markers = { 'nx.json', '.git' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/ocamllsp.lua b/arch/lightvim/.config/lightvim/lsp/ocamllsp.lua new file mode 100644 index 0000000..d7a2726 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/ocamllsp.lua @@ -0,0 +1,88 @@ +---@brief +--- +--- https://github.com/ocaml/ocaml-lsp +--- +--- `ocaml-lsp` can be installed as described in [installation guide](https://github.com/ocaml/ocaml-lsp#installation). +--- +--- To install the lsp server in a particular opam switch: +--- ```sh +--- opam install ocaml-lsp-server +--- ``` + +-- https://github.com/ocaml/ocaml-lsp/blob/master/ocaml-lsp-server/docs/ocamllsp/switchImplIntf-spec.md +local function switch_impl_intf(bufnr, client) + local method_name = 'ocamllsp/switchImplIntf' + ---@diagnostic disable-next-line:param-type-mismatch + if not client or not client:supports_method(method_name) then + return vim.notify(('method %s is not supported by any servers active on the current buffer'):format(method_name)) + end + local uri = vim.lsp.util.make_given_range_params(nil, nil, bufnr, client.offset_encoding).textDocument.uri + if not uri then + return vim.notify('could not get URI for current buffer') + end + local params = { uri } + ---@diagnostic disable-next-line:param-type-mismatch + client:request(method_name, params, function(err, result) + if err then + error(tostring(err)) + end + if not result or #result == 0 then + vim.notify('corresponding file cannot be determined') + elseif #result == 1 then + vim.cmd.edit(vim.uri_to_fname(result[1])) + else + vim.ui.select( + result, + { prompt = 'Select an implementation/interface:', format_item = vim.uri_to_fname }, + function(choice) + if choice then + vim.cmd.edit(vim.uri_to_fname(choice)) + end + end + ) + end + end, bufnr) +end + +local language_id_of = { + menhir = 'ocaml.menhir', + ocaml = 'ocaml', + ocamlinterface = 'ocaml.interface', + ocamllex = 'ocaml.ocamllex', + reason = 'reason', + dune = 'dune', +} + +local language_id_of_ext = { + mll = language_id_of.ocamllex, + mly = language_id_of.menhir, + mli = language_id_of.ocamlinterface, +} + +local get_language_id = function(bufnr, ftype) + if ftype == 'ocaml' then + local path = vim.api.nvim_buf_get_name(bufnr) + local ext = vim.fn.fnamemodify(path, ':e') + return language_id_of_ext[ext] or language_id_of.ocaml + else + return language_id_of[ftype] + end +end + +local root_markers1 = { 'dune-project', 'dune-workspace' } +local root_markers2 = { '*.opam', 'opam', 'esy.json', 'package.json' } +local root_markers3 = { '.git' } + +---@type vim.lsp.Config +return { + cmd = { 'ocamllsp' }, + filetypes = { 'ocaml', 'menhir', 'ocamlinterface', 'ocamllex', 'reason', 'dune' }, + root_markers = vim.fn.has('nvim-0.11.3') == 1 and { root_markers1, root_markers2, root_markers3 } + or vim.list_extend(vim.list_extend(root_markers1, root_markers2), root_markers3), + get_language_id = get_language_id, + on_attach = function(client, bufnr) + vim.api.nvim_buf_create_user_command(bufnr, 'LspOcamllspSwitchImplIntf', function() + switch_impl_intf(bufnr, client) + end, { desc = 'Switch between implementation/interface' }) + end, +} diff --git a/arch/lightvim/.config/lightvim/lsp/ols.lua b/arch/lightvim/.config/lightvim/lsp/ols.lua new file mode 100644 index 0000000..aad2a5e --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/ols.lua @@ -0,0 +1,17 @@ +---@brief +--- +--- https://github.com/DanielGavin/ols +--- +--- `Odin Language Server`. + +local util = require 'lspconfig.util' + +---@type vim.lsp.Config +return { + cmd = { 'ols' }, + filetypes = { 'odin' }, + root_dir = function(bufnr, on_dir) + local fname = vim.api.nvim_buf_get_name(bufnr) + on_dir(util.root_pattern('ols.json', '.git', '*.odin')(fname)) + end, +} diff --git a/arch/lightvim/.config/lightvim/lsp/omnisharp.lua b/arch/lightvim/.config/lightvim/lsp/omnisharp.lua new file mode 100644 index 0000000..b3874fc --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/omnisharp.lua @@ -0,0 +1,92 @@ +---@brief +--- +--- https://github.com/omnisharp/omnisharp-roslyn +--- OmniSharp server based on Roslyn workspaces +--- +--- `omnisharp-roslyn` can be installed by downloading and extracting a release from [here](https://github.com/OmniSharp/omnisharp-roslyn/releases). +--- OmniSharp can also be built from source by following the instructions [here](https://github.com/omnisharp/omnisharp-roslyn#downloading-omnisharp). +--- +--- OmniSharp requires the [dotnet-sdk](https://dotnet.microsoft.com/download) to be installed. +--- +--- For `go_to_definition` to work fully, extended `textDocument/definition` handler is needed, for example see [omnisharp-extended-lsp.nvim](https://github.com/Hoffs/omnisharp-extended-lsp.nvim) +--- +--- + +local util = require 'lspconfig.util' + +---@type vim.lsp.Config +return { + cmd = { + vim.fn.executable('OmniSharp') == 1 and 'OmniSharp' or 'omnisharp', + '-z', -- https://github.com/OmniSharp/omnisharp-vscode/pull/4300 + '--hostPID', + tostring(vim.fn.getpid()), + 'DotNet:enablePackageRestore=false', + '--encoding', + 'utf-8', + '--languageserver', + }, + filetypes = { 'cs', 'vb' }, + root_dir = function(bufnr, on_dir) + local fname = vim.api.nvim_buf_get_name(bufnr) + on_dir( + util.root_pattern '*.slnx'(fname) + or util.root_pattern '*.sln'(fname) + or util.root_pattern '*.csproj'(fname) + or util.root_pattern 'omnisharp.json'(fname) + or util.root_pattern 'function.json'(fname) + ) + end, + init_options = {}, + capabilities = { + workspace = { + workspaceFolders = false, -- https://github.com/OmniSharp/omnisharp-roslyn/issues/909 + }, + }, + ---@type lspconfig.settings.omnisharp + settings = { + FormattingOptions = { + -- Enables support for reading code style, naming convention and analyzer + -- settings from .editorconfig. + EnableEditorConfigSupport = true, + -- Specifies whether 'using' directives should be grouped and sorted during + -- document formatting. + OrganizeImports = nil, + }, + MsBuild = { + -- If true, MSBuild project system will only load projects for files that + -- were opened in the editor. This setting is useful for big C# codebases + -- and allows for faster initialization of code navigation features only + -- for projects that are relevant to code that is being edited. With this + -- setting enabled OmniSharp may load fewer projects and may thus display + -- incomplete reference lists for symbols. + LoadProjectsOnDemand = nil, + }, + RoslynExtensionsOptions = { + -- Enables support for roslyn analyzers, code fixes and rulesets. + EnableAnalyzersSupport = nil, + -- Enables support for showing unimported types and unimported extension + -- methods in completion lists. When committed, the appropriate using + -- directive will be added at the top of the current file. This option can + -- have a negative impact on initial completion responsiveness, + -- particularly for the first few completion sessions after opening a + -- solution. + EnableImportCompletion = nil, + -- Only run analyzers against open files when 'enableRoslynAnalyzers' is + -- true + AnalyzeOpenDocumentsOnly = nil, + -- Enables the possibility to see the code in external nuget dependencies + EnableDecompilationSupport = nil, + }, + RenameOptions = { + RenameInComments = nil, + RenameOverloads = nil, + RenameInStrings = nil, + }, + Sdk = { + -- Specifies whether to include preview versions of the .NET SDK when + -- determining which version to use for project loading. + IncludePrereleases = true, + }, + }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/opencl_ls.lua b/arch/lightvim/.config/lightvim/lsp/opencl_ls.lua new file mode 100644 index 0000000..53cf67e --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/opencl_ls.lua @@ -0,0 +1,14 @@ +---@brief +--- +--- https://github.com/Galarius/opencl-language-server +--- +--- Build instructions can be found [here](https://github.com/Galarius/opencl-language-server/blob/main/_dev/build.md). +--- +--- Prebuilt binaries are available for Linux, macOS and Windows [here](https://github.com/Galarius/opencl-language-server/releases). + +---@type vim.lsp.Config +return { + cmd = { 'opencl-language-server' }, + filetypes = { 'opencl' }, + root_markers = { '.git' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/openscad_ls.lua b/arch/lightvim/.config/lightvim/lsp/openscad_ls.lua new file mode 100644 index 0000000..f0f4e1b --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/openscad_ls.lua @@ -0,0 +1,27 @@ +---@brief +--- +--- https://github.com/dzhu/openscad-language-server +--- +--- A Language Server Protocol server for OpenSCAD +--- +--- You can build and install `openscad-language-server` binary with `cargo`: +--- ```sh +--- cargo install openscad-language-server +--- ``` +--- +--- Vim does not have built-in syntax for the `openscad` filetype currently. +--- +--- This can be added via an autocmd: +--- +--- ```lua +--- vim.cmd [[ autocmd BufRead,BufNewFile *.scad set filetype=openscad ]] +--- ``` +--- +--- or by installing a filetype plugin such as https://github.com/sirtaj/vim-openscad + +---@type vim.lsp.Config +return { + cmd = { 'openscad-language-server' }, + filetypes = { 'openscad' }, + root_markers = { '.git' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/openscad_lsp.lua b/arch/lightvim/.config/lightvim/lsp/openscad_lsp.lua new file mode 100644 index 0000000..a9b8da0 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/openscad_lsp.lua @@ -0,0 +1,17 @@ +---@brief +--- +--- https://github.com/Leathong/openscad-LSP +--- +--- A Language Server Protocol server for OpenSCAD +--- +--- You can build and install `openscad-lsp` binary with `cargo`: +--- ```sh +--- cargo install openscad-lsp +--- ``` + +---@type vim.lsp.Config +return { + cmd = { 'openscad-lsp', '--stdio' }, + filetypes = { 'openscad' }, + root_markers = { '.git' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/oso.lua b/arch/lightvim/.config/lightvim/lsp/oso.lua new file mode 100644 index 0000000..390dbd8 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/oso.lua @@ -0,0 +1,32 @@ +---@brief +--- https://www.osohq.com/docs/develop/local-dev/env-setup +--- +--- Oso Polar language server. +--- +--- `oso-cloud` can be installed by following the instructions +--- [here](https://www.osohq.com/docs/develop/local-dev/env-setup). +--- +--- The default `cmd` assumes that the `oso-cloud` binary can be found in the `$PATH`. +--- +--- You may need to configure the filetype for Polar (*.polar) files: +--- +--- ``` +--- autocmd BufNewFile,BufRead *.polar set filetype=polar +--- ``` +--- +--- or +--- +--- ```lua +--- vim.filetype.add({ +--- pattern = { +--- ['.*/*.polar'] = 'polar', +--- }, +--- }) +--- +--- Alternatively, you may use a syntax plugin like https://github.com/osohq/polar.vim + +---@type vim.lsp.Config +return { + cmd = { 'oso-cloud', 'lsp' }, + filetypes = { 'polar' }, +} diff --git a/arch/lightvim/.config/lightvim/lsp/oxfmt.lua b/arch/lightvim/.config/lightvim/lsp/oxfmt.lua new file mode 100644 index 0000000..e2a7666 --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/oxfmt.lua @@ -0,0 +1,58 @@ +--- @brief +--- +--- https://github.com/oxc-project/oxc +--- https://oxc.rs/docs/guide/usage/formatter.html +--- +--- `oxfmt` is a Prettier-compatible code formatter that supports multiple languages +--- including JavaScript, TypeScript, JSON, YAML, HTML, CSS, Markdown, and more. +--- It can be installed via `npm`: +--- +--- ```sh +--- npm i -g oxfmt +--- ``` + +local util = require 'lspconfig.util' + +---@type vim.lsp.Config +return { + cmd = function(dispatchers, config) + local cmd = 'oxfmt' + if (config or {}).root_dir then + local local_cmd = vim.fs.joinpath(config.root_dir, 'node_modules/.bin', cmd) + if vim.fn.executable(local_cmd) == 1 then + cmd = local_cmd + end + end + return vim.lsp.rpc.start({ cmd, '--lsp' }, dispatchers) + end, + filetypes = { + 'javascript', + 'javascriptreact', + 'typescript', + 'typescriptreact', + 'toml', + 'json', + 'jsonc', + 'json5', + 'yaml', + 'html', + 'vue', + 'handlebars', + 'css', + 'scss', + 'less', + 'graphql', + 'markdown', + }, + workspace_required = true, + root_dir = function(bufnr, on_dir) + local fname = vim.api.nvim_buf_get_name(bufnr) + + -- Oxfmt resolves configuration by walking upward and using the nearest config file + -- to the file being processed. We therefore compute the root directory by locating + -- the closest `.oxfmtrc.json` / `.oxfmtrc.jsonc` / `oxfmt.config.ts` (or `package.json` fallback) above the buffer. + local root_markers = + util.insert_package_json({ '.oxfmtrc.json', '.oxfmtrc.jsonc', 'oxfmt.config.ts' }, 'oxfmt', fname) + on_dir(vim.fs.dirname(vim.fs.find(root_markers, { path = fname, upward = true })[1])) + end, +} diff --git a/arch/lightvim/.config/lightvim/lsp/oxlint.lua b/arch/lightvim/.config/lightvim/lsp/oxlint.lua new file mode 100644 index 0000000..06d395f --- /dev/null +++ b/arch/lightvim/.config/lightvim/lsp/oxlint.lua @@ -0,0 +1,87 @@ +--- @brief +--- +--- https://github.com/oxc-project/oxc +--- https://oxc.rs/docs/guide/usage/linter.html +--- +--- `oxlint` is a linter for JavaScript / TypeScript supporting over 500 rules from ESLint and its popular plugins. +--- It also supports linting framework files (Vue, Svelte, Astro) by analyzing their