plugins clean up
This commit is contained in:
15
lua/plugins/null-ls.lua
Normal file
15
lua/plugins/null-ls.lua
Normal file
@ -0,0 +1,15 @@
|
||||
local null_ls = require("null-ls")
|
||||
|
||||
null_ls.setup({
|
||||
on_attach = function(client, bufnr)
|
||||
if client.resolved_capabilities.document_formatting then
|
||||
vim.cmd("nnoremap <silent><buffer> <Leader>f :lua vim.lsp.buf.formatting()<CR>")
|
||||
-- format on save
|
||||
vim.cmd("autocmd BufWritePost <buffer> lua vim.lsp.buf.formatting()")
|
||||
end
|
||||
|
||||
if client.resolved_capabilities.document_range_formatting then
|
||||
vim.cmd("xnoremap <silent><buffer> <Leader>f :lua vim.lsp.buf.range_formatting({})<CR>")
|
||||
end
|
||||
end,
|
||||
})
|
||||
Reference in New Issue
Block a user