aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreug-vs <eugene@eug-vs.xyz>2022-10-14 16:38:58 +0300
committereug-vs <eugene@eug-vs.xyz>2022-10-14 16:38:58 +0300
commit8158c2d1ce8ddddf85a791bf3f1358fab3339113 (patch)
tree14c5c7f1cc8fe5dc2599e4662c1ecc4043f108ac
parent3274150d37064ed4f20f204454b95634c5a8cdcc (diff)
downloaddotfiles-8158c2d1ce8ddddf85a791bf3f1358fab3339113.tar.gz
feat(nvim): add more LSP language servers
-rw-r--r--nvim/.config/nvim/lua/lsp-config.lua39
-rw-r--r--nvim/.config/nvim/lua/plugins.lua3
2 files changed, 42 insertions, 0 deletions
diff --git a/nvim/.config/nvim/lua/lsp-config.lua b/nvim/.config/nvim/lua/lsp-config.lua
index a2d6ccb..2a0a881 100644
--- a/nvim/.config/nvim/lua/lsp-config.lua
+++ b/nvim/.config/nvim/lua/lsp-config.lua
@@ -18,6 +18,7 @@ local on_attach = function(client, bufnr)
buf_set_keymap('n', 'gi', '<cmd>lua vim.lsp.buf.implementation()<CR>', opts)
buf_set_keymap('n', 'gr', '<cmd>lua vim.lsp.buf.references()<CR>', opts)
buf_set_keymap('n', 'K', '<cmd>lua vim.lsp.buf.hover()<CR>', opts)
+ buf_set_keymap('n', 'L', '<cmd>lua vim.diagnostic.open_float()<CR>', opts)
buf_set_keymap('n', '<leader>rn', '<cmd>lua vim.lsp.buf.rename()<CR>', opts)
buf_set_keymap('n', '<leader>ca', '<cmd>lua vim.lsp.buf.code_action()<CR>', opts)
end
@@ -34,8 +35,37 @@ nvim_lsp.tsserver.setup {
on_attach = on_attach,
flags = flags,
capabilities = capabilities,
+ root_dir = nvim_lsp.util.root_pattern("package.json"),
+}
+-- Enhanced features
+require('typescript').setup {
+ server = {
+ on_attach = on_attach,
+ },
+ flags = flags,
+ capabilities = capabilities,
+ disable_commands = false,
+ go_to_source_definition = {
+ fallback = true,
+ },
+}
+
+
+-- Eslint
+nvim_lsp.eslint.setup {
+ on_attach = on_attach,
+ flags = flags,
+ capabilities = capabilities,
}
+-- Prisma
+nvim_lsp.prismals.setup {
+ on_attach = on_attach,
+ flags = flags,
+ capabilities = capabilities,
+}
+
+
-- Vue
nvim_lsp.vuels.setup{
on_attach = on_attach,
@@ -57,12 +87,21 @@ nvim_lsp.pylsp.setup{
capabilities = capabilities,
}
+-- C
nvim_lsp.ccls.setup {
on_attach = on_attach,
flags = flags,
capabilities = capabilities,
}
+-- Deno
+nvim_lsp.denols.setup {
+ on_attach = on_attach,
+ flags = flags,
+ capabilities = capabilities,
+ root_dir = nvim_lsp.util.root_pattern("deno.json", "deno.jsonc"),
+}
+
-- Lua
local runtime_path = vim.split(package.path, ';')
table.insert(runtime_path, "lua/?.lua")
diff --git a/nvim/.config/nvim/lua/plugins.lua b/nvim/.config/nvim/lua/plugins.lua
index 519537c..ae8673c 100644
--- a/nvim/.config/nvim/lua/plugins.lua
+++ b/nvim/.config/nvim/lua/plugins.lua
@@ -42,4 +42,7 @@ return require('packer').startup(function(use)
use 'airblade/vim-gitgutter'
use 'Raimondi/delimitMate'
use 'tonchis/vim-to-github'
+
+ -- Typescript enhanced features
+ use 'jose-elias-alvarez/typescript.nvim'
end)