Mercurial > dotfiles
comparison dot_config/nvim/config.lua @ 404:04483ffbd282
Replace efm with null-ls
author | Zeger Van de Vannet <zegervdv@me.com> |
---|---|
date | Fri, 16 Jul 2021 09:06:51 +0200 |
parents | 483c3746730f |
children | 34862cc22221 |
comparison
equal
deleted
inserted
replaced
403:483c3746730f | 404:04483ffbd282 |
---|---|
198 { 'nvim-treesitter/playground', opt = true }, | 198 { 'nvim-treesitter/playground', opt = true }, |
199 } | 199 } |
200 use { 'hrsh7th/vim-vsnip', requires = 'hrsh7th/vim-vsnip-integ' } | 200 use { 'hrsh7th/vim-vsnip', requires = 'hrsh7th/vim-vsnip-integ' } |
201 use { 'glepnir/lspsaga.nvim', config = function() require'lspsaga'.init_lsp_saga {} end } | 201 use { 'glepnir/lspsaga.nvim', config = function() require'lspsaga'.init_lsp_saga {} end } |
202 use { 'rmagatti/goto-preview', config = function() require'goto-preview'.setup {} end } | 202 use { 'rmagatti/goto-preview', config = function() require'goto-preview'.setup {} end } |
203 use { | |
204 'jose-elias-alvarez/null-ls.nvim', | |
205 requires='nvim-lua/plenary.nvim', | |
206 } | |
203 | 207 |
204 -- Vanity | 208 -- Vanity |
205 use { | 209 use { |
206 'yamatsum/nvim-web-nonicons', | 210 'yamatsum/nvim-web-nonicons', |
207 requires = 'kyazdani42/nvim-web-devicons', | 211 requires = 'kyazdani42/nvim-web-devicons', |
337 end) | 341 end) |
338 | 342 |
339 -- LSP config | 343 -- LSP config |
340 local lsp = require 'lspconfig' | 344 local lsp = require 'lspconfig' |
341 local lsputil = require 'lspconfig.util' | 345 local lsputil = require 'lspconfig.util' |
346 local null_ls = require'null-ls' | |
342 | 347 |
343 local on_attach = function(client) | 348 local on_attach = function(client) |
344 local nnoremap = vim.keymap.nnoremap | 349 local nnoremap = vim.keymap.nnoremap |
345 local inoremap = vim.keymap.inoremap | 350 local inoremap = vim.keymap.inoremap |
346 -- nnoremap { '', require'lspsaga.diagnostic'.show_line_diagnostics, silent = true } | 351 -- nnoremap { '', require'lspsaga.diagnostic'.show_line_diagnostics, silent = true } |
403 } | 408 } |
404 } | 409 } |
405 | 410 |
406 lsp.pyright.setup { on_attach = on_attach, capabilities = capabilities } | 411 lsp.pyright.setup { on_attach = on_attach, capabilities = capabilities } |
407 | 412 |
408 if (vim.fn.executable('efm-langserver') == 1) then | 413 null_ls.setup { |
409 require 'efm/python' | 414 on_attach = on_attach, |
410 require 'efm/lua' | 415 sources = { |
411 | 416 null_ls.builtins.formatting.black, |
412 -- May not be installed, use pcall to handle errors | 417 }, |
413 -- pcall(require, 'efm/systemverilog') | 418 } |
414 pcall(require, 'efm/flp') | |
415 | |
416 local language_cfg = require 'efm/languages' | |
417 | |
418 local filetypes = {} | |
419 for lang, _ in pairs(language_cfg) do table.insert(filetypes, lang) end | |
420 | |
421 lsp.efm.setup { | |
422 on_attach = on_attach, | |
423 filetypes = filetypes, | |
424 init_options = { documentFormatting = true }, | |
425 root_dir = lsputil.root_pattern('.git', '.hg'), | |
426 settings = { rootMarkers = { '.git/', '.hg/' }, languages = language_cfg }, | |
427 } | |
428 end | |
429 | 419 |
430 -- Try importing local config | 420 -- Try importing local config |
431 local ok, localconfig = pcall(require, 'localconfig') | 421 local ok, localconfig = pcall(require, 'localconfig') |
432 if ok then localconfig.setup { on_attach = on_attach, capabilities = capabilities } end | 422 if ok then localconfig.setup { on_attach = on_attach, capabilities = capabilities } end |