From 2d81f71b02d20d6eb0490f717d994f06bbdb5f61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Magalh=C3=A3es?= Date: Wed, 16 Aug 2023 18:40:05 -0300 Subject: [PATCH] Eslint lsp and fix an nvim-tree issue --- lua/core/keymaps/async/project-tree.lua | 8 +++++++- lua/core/settings/init.lua | 8 ++++++++ lua/core/setup/language-servers.lua | 1 + 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/lua/core/keymaps/async/project-tree.lua b/lua/core/keymaps/async/project-tree.lua index 047d353d..f70fab50 100644 --- a/lua/core/keymaps/async/project-tree.lua +++ b/lua/core/keymaps/async/project-tree.lua @@ -11,8 +11,14 @@ return function(buffer) nowait = true }) + --[[ + -- WARN The docs tell us to call default_on_attach + -- but doing it causes issues on git commits or when + -- no file is loaded + --]] + -- default mappings - api.config.mappings.default_on_attach(buffer) + -- api.config.mappings.default_on_attach(buffer) nmap('', api.tree.toggle, 'File Tree') nmap('t', api.node.open.tab, 'Toggle Node') diff --git a/lua/core/settings/init.lua b/lua/core/settings/init.lua index a6efed22..8c398638 100644 --- a/lua/core/settings/init.lua +++ b/lua/core/settings/init.lua @@ -49,3 +49,11 @@ vim.o.completeopt = 'menuone,noselect' -- NOTE: You should make sure your terminal supports this vim.o.termguicolors = true + +vim.diagnostic.config({ + virtual_text = false +}) + +-- Show line diagnostics automatically in hover window +vim.o.updatetime = 250 +vim.cmd [[autocmd CursorHold,CursorHoldI * lua vim.diagnostic.open_float(nil, {focus=false})]] diff --git a/lua/core/setup/language-servers.lua b/lua/core/setup/language-servers.lua index 0aa3538d..82b71731 100644 --- a/lua/core/setup/language-servers.lua +++ b/lua/core/setup/language-servers.lua @@ -3,6 +3,7 @@ local servers = { -- gopls = {}, -- pyright = {}, -- rust_analyzer = {}, + eslint = {}, tsserver = {}, lua_ls = {