From 6e4a400002547928f181bac5da4f9eaa85b6e38d Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Sat, 25 Dec 2021 22:54:11 +0000 Subject: [PATCH] feat(nvim): add null-ls for formatting --- nvim/.config/nvim/lua/opdavies/lsp/null-ls.lua | 13 +++++++++++++ nvim/.config/nvim/lua/opdavies/plugins.lua | 1 + 2 files changed, 14 insertions(+) create mode 100644 nvim/.config/nvim/lua/opdavies/lsp/null-ls.lua diff --git a/nvim/.config/nvim/lua/opdavies/lsp/null-ls.lua b/nvim/.config/nvim/lua/opdavies/lsp/null-ls.lua new file mode 100644 index 0000000..8737bb6 --- /dev/null +++ b/nvim/.config/nvim/lua/opdavies/lsp/null-ls.lua @@ -0,0 +1,13 @@ +local status_ok, null_ls = pcall(require, "null-ls") +if not status_ok then + return +end + +null_ls.setup({ + sources = { + null_ls.builtins.formatting.prettier, + null_ls.builtins.formatting.stylua, + null_ls.builtins.diagnostics.eslint, + null_ls.builtins.completion.spell, + }, +}) diff --git a/nvim/.config/nvim/lua/opdavies/plugins.lua b/nvim/.config/nvim/lua/opdavies/plugins.lua index f84e09a..53e1a1d 100644 --- a/nvim/.config/nvim/lua/opdavies/plugins.lua +++ b/nvim/.config/nvim/lua/opdavies/plugins.lua @@ -75,6 +75,7 @@ return packer.startup(function() -- LSP use 'neovim/nvim-lspconfig' + use 'jose-elias-alvarez/null-ls.nvim' -- Telescope use 'nvim-telescope/telescope.nvim'