Update .config/nvim/lazy-lock.json Update .config/nvim/lua/config/10_opts.lua Update .config/nvim/lua/config/20_keymaps.lua Update .config/nvim/lua/plugin/00_colorscheme.lua Update .config/nvim/lua/plugin/01_whichkey.lua Update .config/nvim/lua/plugin/03_treesitter.lua Update .config/nvim/lua/plugin/05_fzf.lua Update .config/nvim/lua/plugin/15_lsp.lua Add .config/nvim/lua/plugin/25_git.lua Add .config/nvim/lua/plugin/30_formatting.lua Add .config/nvim/stylua.toml
39 lines
845 B
Lua
39 lines
845 B
Lua
return {
|
|
{
|
|
"tpope/vim-sleuth",
|
|
},
|
|
{
|
|
"stevearc/conform.nvim",
|
|
event = { "BufWritePre" },
|
|
cmd = { "ConformInfo" },
|
|
keys = {
|
|
{
|
|
"<leader>af",
|
|
function()
|
|
require("conform").format({ async = true })
|
|
end,
|
|
mode = "",
|
|
desc = "format buffer",
|
|
},
|
|
},
|
|
opts = {
|
|
formatters_by_ft = {
|
|
lua = { "stylua" },
|
|
python = { "isort", "black" },
|
|
javascript = { "prettierd", "prettier", stop_after_first = true },
|
|
},
|
|
default_format_opts = {
|
|
lsp_format = "fallback",
|
|
},
|
|
format_on_save = { timeout_ms = 500 },
|
|
formatters = {
|
|
shfmt = {
|
|
append_args = { "-i", "2" },
|
|
},
|
|
},
|
|
},
|
|
init = function()
|
|
vim.o.formatexpr = "v:lua.require'conform'.formatexpr()"
|
|
end,
|
|
},
|
|
}
|