Skip to content

Commit

Permalink
changed null ls sources and added global autocmd
Browse files Browse the repository at this point in the history
  • Loading branch information
Axel committed Nov 3, 2022
1 parent 8e832d2 commit 33ced16
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
1 change: 1 addition & 0 deletions lua/core/autocmds.lua
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
vim.cmd([[colorscheme gruvbox]])
vim.cmd([[hi Normal guibg=NONE ctermbg=NONE]])
vim.cmd([[autocmd BufWritePre <buffer> lua vim.lsp.buf.formatting_sync()]])
17 changes: 6 additions & 11 deletions lua/plugins/configs/null.lua
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
local _, null_ls = pcall(require, "null-ls")

local sources = {
null_ls.builtins.formatting.prettierd,
null_ls.builtins.formatting.eslint_d,
null_ls.builtins.formatting.autopep8,
--null_ls.builtins.formatting.prettierd,
null_ls.builtins.formatting.stylua,
null_ls.builtins.formatting.eslint_d,
null_ls.builtins.formatting.autopep8,
null_ls.builtins.formatting.tidy,
}

null_ls.setup({
sources = sources,
on_attach = function(client)
if client.server_capabilities.document_formatting then
vim.cmd("autocmd BufWritePre <buffer> lua vim.lsp.buf.formatting_sync()")
end
end,
})
null_ls.setup({ sources = sources })

0 comments on commit 33ced16

Please sign in to comment.