mirror of
https://github.com/pojokcodeid/nvim-lazy.git
synced 2025-06-21 08:35:48 +02:00
add: google java format for java config
This commit is contained in:
parent
66c83b9abb
commit
ab36e30b69
3 changed files with 45 additions and 2 deletions
|
@ -46,6 +46,30 @@ if pcode.active_java_config.active then
|
|||
{ "<Leader>TS", function() require("neotest").run.stop() end, desc = "Stop" },
|
||||
},
|
||||
},
|
||||
{
|
||||
"stevearc/conform.nvim",
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
config = function()
|
||||
local conform = require("conform")
|
||||
conform.setup({
|
||||
formatters_by_ft = {
|
||||
java = { "google-java-format" },
|
||||
},
|
||||
format_on_save = {
|
||||
-- These options will be passed to conform.format()
|
||||
timeout_ms = 500,
|
||||
lsp_fallback = true,
|
||||
},
|
||||
})
|
||||
vim.keymap.set({ "n", "v" }, "<leader>lF", function()
|
||||
conform.format({
|
||||
lsp_fallback = true,
|
||||
async = false,
|
||||
timeout_ms = 500,
|
||||
})
|
||||
end, { desc = "Format file or range (in visual mode)" })
|
||||
end,
|
||||
},
|
||||
}
|
||||
end
|
||||
return M
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue