neoformat -> null-ls

This commit is contained in:
Guanran Wang 2024-07-28 23:50:04 +08:00
parent d696237fc0
commit 3d070af4c7
Signed by: nyancat
GPG key ID: 91F97D9ED12639CF
3 changed files with 31 additions and 29 deletions

View file

@ -1,15 +0,0 @@
return {
"romgrk/barbar.nvim",
dependencies = {
"lewis6991/gitsigns.nvim", -- OPTIONAL: for git status
"nvim-tree/nvim-web-devicons", -- OPTIONAL: for file icons
},
init = function()
vim.g.barbar_auto_setup = false
end,
opts = {
auto_hide = 1,
},
enabled = false,
}

View file

@ -1,14 +0,0 @@
return {
"sbdchd/neoformat",
init = function()
-- Basic formatting
vim.g.neoformat_basic_format_retab = 1
vim.g.neoformat_basic_format_trim = 1
-- Prefer Alejandra for Nix files
vim.g.neoformat_enabled_nix = { "alejandra" }
end,
keys = {
{ "<leader>lf", "<cmd>Neoformat<CR>", desc = "Format file" },
},
}

31
lua/plugins/null-ls.lua Normal file
View file

@ -0,0 +1,31 @@
return {
"nvimtools/none-ls.nvim",
dependencies = { "nvim-lua/plenary.nvim" },
opts = function()
local null_ls = require("null-ls")
null_ls.setup({
sources = {
null_ls.builtins.formatting.alejandra,
null_ls.builtins.formatting.stylua,
null_ls.builtins.formatting.black,
},
})
end,
keys = {
{
"<leader>lf",
function()
vim.lsp.buf.format()
end,
desc = "Format file",
},
{
"<leader>a",
function()
vim.lsp.buf.code_action()
end,
desc = "Code action",
},
},
}