feat: update neovim lsp

This commit is contained in:
2022-02-05 00:10:16 +08:00
parent 35e8936114
commit 777096d908
9 changed files with 37 additions and 41 deletions
+1 -2
View File
@@ -14,11 +14,10 @@ require('gitsigns').setup {
noremap = true,
buffer = true,
},
watch_index = {
watch_gitdir = {
interval = 1000
},
sign_priority = 6,
update_debounce = 200,
status_formatter = nil, -- Use default
use_decoration_api = false
}
+1 -1
View File
@@ -5,7 +5,7 @@ require('pluginconfig/dashboard-nvim')
require('pluginconfig/galaxyline')
require('pluginconfig/gitsigns')
require('pluginconfig/hop')
-- require('pluginconfig/lspinstall')
require('pluginconfig/lspinstall')
require('pluginconfig/numb')
require('pluginconfig/nvim-autopairs')
require('pluginconfig/nvim-colorizer')
+18 -24
View File
@@ -1,27 +1,21 @@
-- 1. get the config for this server from nvim-lspconfig and adjust the cmd path.
-- relative paths are allowed, lspinstall automatically adjusts the cmd and cmd_cwd for us!
local config = require'lspconfig'.jdtls.document_config
require'lspconfig/configs'.jdtls = nil -- important, unset the loaded config again
-- config.default_config.cmd[1] = "./node_modules/.bin/bash-language-server"
-- 2. extend the config with an install_script and (optionally) uninstall_script
require'lspinstall/servers'.jdtls = vim.tbl_extend('error', config, {
-- lspinstall will automatically create/delete the install directory for every server
install_script = [[
git clone https://github.com/eclipse/eclipse.jdt.ls.git
cd eclipse.jdt.ls
./mvnw clean verify
]],
uninstall_script = nil -- can be omitted
local lsp_installer = require("nvim-lsp-installer")
lsp_installer.settings({
install_root_dir = table.concat { vim.fn.stdpath("data"), "/lspinstall" },
})
require'lspinstall/servers'.kotlin = vim.tbl_extend('error', config, {
install_script = [[
git clone https://github.com/fwcd/kotlin-language-server.git language-server
cd language-server
./gradlew :server:installDist
]],
uninstall_script = nil -- can be omitted
})
-- Register a handler that will be called for each installed server when it's ready (i.e. when installation is finished
-- or if the server is already installed).
lsp_installer.on_server_ready(function(server)
local opts = {
}
require'lspinstall'.setup()
-- (optional) Customize the options passed to the server
-- if server.name == "tsserver" then
-- opts.root_dir = function() ... end
-- end
-- This setup() function will take the provided server configuration and decorate it with the necessary properties
-- before passing it onwards to lspconfig.
-- Refer to https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md
server:setup(opts)
end)
+1 -1
View File
@@ -1,6 +1,6 @@
local treesitter = {
ensure_installed = "all",
ignore_install = {"haskell"},
ignore_install = {"haskell","markdown"},
highlight = {enabled = true},
playground = {enabled = true},
rainbow = {enabled = false},
+1
View File
@@ -186,6 +186,7 @@ local mappings = {
s = {"<cmd>Telescope lsp_document_symbols<cr>", "Document Symbols"},
S = {"<cmd>Telescope lsp_dynamic_workspace_symbols<cr>", "Workspace Symbols"},
z = {"<cmd>LspInfo<cr>", "Info"},
[","]= {"<cmd>LspInstallInfo<cr>","LSP servers"}
},
p = {
name = "Packer",