Skip to content

Commit

Permalink
feat(nvim): replace null-ls with efm-ls
Browse files Browse the repository at this point in the history
  • Loading branch information
caarlos0 committed Sep 27, 2023
1 parent 9aff5a5 commit 692c6ad
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 11 deletions.
30 changes: 20 additions & 10 deletions modules/neovim/config/lua/user/lsp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -197,18 +197,28 @@ lspconfig.taplo.setup({
on_attach = on_attach,
})

local null_ls = require("null-ls")
null_ls.setup({
sources = {
null_ls.builtins.formatting.stylua,
null_ls.builtins.formatting.fish_indent,
null_ls.builtins.formatting.nixpkgs_fmt,
null_ls.builtins.formatting.prettier,
null_ls.builtins.code_actions.gitsigns,
-- null_ls.builtins.formatting.shfmt,
},
local prettier = require("efmls-configs.formatters.prettier")
local stylua = require("efmls-configs.formatters.stylua")
local languages = {
lua = { stylua },
css = { prettier },
javascript = { prettier },
html = { prettier },
markdown = { prettier },
}

lspconfig.efm.setup({
capabilities = capabilities,
on_attach = on_attach,
filetypes = vim.tbl_keys(languages),
settings = {
rootMarkers = { ".git/" },
languages = languages,
},
init_options = {
documentFormatting = true,
documentRangeFormatting = true,
},
})

local float_config = {
Expand Down
2 changes: 1 addition & 1 deletion modules/neovim/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ in

# coding
nvim-lspconfig
null-ls-nvim
efmls-configs-nvim
nvim-cmp
cmp-buffer
cmp-path
Expand Down
1 change: 1 addition & 0 deletions modules/pkgs.nix
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
clang-tools # clangd lsp
delve
dockerfile-language-server-nodejs
efm-langserver
gofumpt
golangci-lint
golangci-lint-langserver
Expand Down

0 comments on commit 692c6ad

Please sign in to comment.