From cd40e1763472b9bc8accb4bae71e57eb6f535ec0 Mon Sep 17 00:00:00 2001 From: Michael Mandl Date: Thu, 21 Jul 2022 14:02:12 +0200 Subject: [PATCH] feat(nvim): add null-ls for markdown formatting --- home-manager/neovim/default.nix | 1 + home-manager/neovim/lspconfig.lua | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/home-manager/neovim/default.nix b/home-manager/neovim/default.nix index fc20135..cc4af18 100644 --- a/home-manager/neovim/default.nix +++ b/home-manager/neovim/default.nix @@ -69,6 +69,7 @@ lsp-status-nvim rust-tools-nvim lua-dev-nvim + null-ls-nvim ]; extraConfig = '' diff --git a/home-manager/neovim/lspconfig.lua b/home-manager/neovim/lspconfig.lua index 23cdb0f..b16fce4 100644 --- a/home-manager/neovim/lspconfig.lua +++ b/home-manager/neovim/lspconfig.lua @@ -93,3 +93,15 @@ local luadev = require("lua-dev").setup({ }) lspconfig["sumneko_lua"].setup(luadev) + +-- setup null-ls for markdown formatting +local null_ls = require("null-ls") +null_ls.setup({ + sources = { + null_ls.builtins.formatting.prettier.with({ + filetypes = { "markdown" } + }), + }, + + on_attach = on_attach, +})