updated neovim configuration

added telescop and fuzzy finding along with lsp and git integration
This commit is contained in:
hellisabove
2023-01-26 00:50:03 +02:00
parent ea718c82b6
commit 0002e01d23
11 changed files with 336 additions and 3 deletions
+41
View File
@@ -0,0 +1,41 @@
local setup, null_ls = pcall(require, "null-ls")
if not setup then
return
end
local formatting = null_ls.builtins.formatting
local diagnostics = null_ls.builtins.diagnostics
local augroup = vim.api.nvim_create_augroup("LspFormatting", {})
null_ls.setup({
sources = {
formatting.prettier,
formatting.stylua,
formatting.eslint_d.with({
condition = function(utils)
return utils.root_has_file('.eslintrc.js')
end,
}),
},
on_attach = function(current_client, bufnr)
if current_client.supports_method("textDocument/formatting") then
vim.api.nvim_clear_autocmds({
group = augroup,
buffer = bufnr
})
vim.api.nvim_create_autocmd("BufWritePre", {
group = augroup,
buffer = bufnr,
callback = function()
vim.lsp.buf.format({
filter = function(client)
return client.name == "null-ls"
end,
bufnr = bufnr,
})
end,
})
end
end,
})