changeset 310:386f7d66c031

Add efm-langserver for formatting and linting
author zegervdv <zegervdv@me.com>
date Wed, 25 Nov 2020 09:05:10 +0100
parents 49b61215e3d0
children 8cefee2cbe37
files dot_config/nvim/init.lua
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/dot_config/nvim/init.lua	Wed Nov 25 09:04:15 2020 +0100
+++ b/dot_config/nvim/init.lua	Wed Nov 25 09:05:10 2020 +0100
@@ -1,4 +1,5 @@
 local lsp = require'lspconfig'
+local lsputil = require'lspconfig.util'
 
 require "nvim-treesitter.highlight"
 
@@ -104,3 +105,10 @@
     on_attach = on_attach;
   }
 end
+
+if (vim.fn.executable('efm-langserver') == 1) then
+  lsp.efm.setup{
+    on_attach = on_attach;
+    root_dir = lsputil.root_pattern('.git', '.hg');
+  }
+end