Add conform for foramtting and mason back for lsp installation but nothing more
This commit is contained in:
2
init.lua
2
init.lua
@@ -51,7 +51,7 @@ vim.keymap.set('n', 'gl', builtin.lsp_references, {})
|
||||
vim.keymap.set('n', '<leader>d', builtin.diagnostics, {})
|
||||
|
||||
-- Formating
|
||||
vim.keymap.set("n", "<leader>gf", vim.lsp.buf.format, {})
|
||||
vim.keymap.set("n", "<leader>gf", require("conform").format, {})
|
||||
|
||||
-- Filesystem
|
||||
vim.keymap.set("n", "<leader>e", ":Oil<CR>", {})
|
||||
|
||||
@@ -3,9 +3,12 @@
|
||||
"autoclose.nvim": { "branch": "main", "commit": "3f86702b54a861a17d7994b2e32a7c648cb12fb1" },
|
||||
"blink.cmp": { "branch": "main", "commit": "327fff91fe6af358e990be7be1ec8b78037d2138" },
|
||||
"catppuccin": { "branch": "main", "commit": "234fc048de931a0e42ebcad675bf6559d75e23df" },
|
||||
"conform.nvim": { "branch": "master", "commit": "cde4da5c1083d3527776fee69536107d98dae6c9" },
|
||||
"fidget.nvim": { "branch": "main", "commit": "e32b672d8fd343f9d6a76944fedb8c61d7d8111a" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "85c7ff3711b730b4030d03144f6db6375044ae82" },
|
||||
"lazydev.nvim": { "branch": "main", "commit": "5231c62aa83c2f8dc8e7ba957aa77098cda1257d" },
|
||||
"lualine.nvim": { "branch": "master", "commit": "3946f0122255bc377d14a59b27b609fb3ab25768" },
|
||||
"mason.nvim": { "branch": "main", "commit": "ad7146aa61dcaeb54fa900144d768f040090bff0" },
|
||||
"mini.icons": { "branch": "main", "commit": "ff2e4f1d29f659cc2bad0f9256f2f6195c6b2428" },
|
||||
"neotest": { "branch": "master", "commit": "deadfb1af5ce458742671ad3a013acb9a6b41178" },
|
||||
"neotest-python": { "branch": "master", "commit": "b0d3a861bd85689d8ed73f0590c47963a7eb1bf9" },
|
||||
|
||||
15
lua/plugins/conform.lua
Normal file
15
lua/plugins/conform.lua
Normal file
@@ -0,0 +1,15 @@
|
||||
return {
|
||||
"stevearc/conform.nvim",
|
||||
config = function()
|
||||
require("conform").setup {
|
||||
formatters_by_ft = {
|
||||
lua = { "stylua" },
|
||||
python = { "black" }
|
||||
},
|
||||
format_on_save = {
|
||||
timeout_ms = 500,
|
||||
lsp_format = "fallback"
|
||||
}
|
||||
}
|
||||
end
|
||||
}
|
||||
4
lua/plugins/fidget.lua
Normal file
4
lua/plugins/fidget.lua
Normal file
@@ -0,0 +1,4 @@
|
||||
return {
|
||||
"j-hui/fidget.nvim",
|
||||
opts = {}
|
||||
}
|
||||
@@ -2,20 +2,5 @@ return {
|
||||
"neovim/nvim-lspconfig",
|
||||
config = function()
|
||||
vim.lsp.enable({ "lua_ls", "basedpyright", "gopls", "html", "yamlls", "svelte-language-server", "clangd", "ansiblels" })
|
||||
|
||||
vim.api.nvim_create_autocmd("LspAttach", {
|
||||
group = vim.api.nvim_create_augroup("lsp", { clear = true }),
|
||||
callback = function(args)
|
||||
-- 2
|
||||
vim.api.nvim_create_autocmd("BufWritePre", {
|
||||
-- 3
|
||||
buffer = args.buf,
|
||||
callback = function()
|
||||
-- 4 + 5
|
||||
vim.lsp.buf.format { async = false, id = args.data.client_id }
|
||||
end,
|
||||
})
|
||||
end
|
||||
})
|
||||
end
|
||||
}
|
||||
|
||||
4
lua/plugins/mason.lua
Normal file
4
lua/plugins/mason.lua
Normal file
@@ -0,0 +1,4 @@
|
||||
return {
|
||||
"mason-org/mason.nvim",
|
||||
opts = {}
|
||||
}
|
||||
Reference in New Issue
Block a user