aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/home/.config
diff options
context:
space:
mode:
authorLibravatar sommerfeld <sommerfeld@sommerfeld.dev>2025-01-31 17:38:25 +0000
committerLibravatar sommerfeld <sommerfeld@sommerfeld.dev>2025-01-31 17:56:08 +0000
commit4264fde0fa429c8136dda52ac936deecc9609dec (patch)
treeac2cd3477a96088485bc05fc741745e9f82c6cc5 /home/.config
parent1b5851eb5602a443c831774940d802c8dd706c23 (diff)
downloaddotfiles-4264fde0fa429c8136dda52ac936deecc9609dec.tar.gz
dotfiles-4264fde0fa429c8136dda52ac936deecc9609dec.tar.bz2
dotfiles-4264fde0fa429c8136dda52ac936deecc9609dec.zip
[nvim][lsp] Change conform config
Diffstat (limited to 'home/.config')
-rw-r--r--home/.config/nvim/lua/custom/plugins/lsp.lua35
1 files changed, 19 insertions, 16 deletions
diff --git a/home/.config/nvim/lua/custom/plugins/lsp.lua b/home/.config/nvim/lua/custom/plugins/lsp.lua
index 4447ff6..1dfd400 100644
--- a/home/.config/nvim/lua/custom/plugins/lsp.lua
+++ b/home/.config/nvim/lua/custom/plugins/lsp.lua
@@ -208,23 +208,26 @@ return {
desc = "Format buffer",
},
},
- opts = {
- formatters_by_ft = {
- python = { "ruff_format" },
- cmake = { "cmake_format" },
- json = { "jq" },
- rust = { "rustfmt" },
- sh = { "shfmt" },
- bash = { "shfmt" },
- zsh = { "shfmt" },
- },
- formatters = {
- shfmt = {
- prepend_args = { "-i", "2" },
+ config = function()
+ require("conform").setup({
+ formatters_by_ft = {
+ python = { "ruff_format" },
+ cmake = { "cmake_format" },
+ json = { "jq" },
+ rust = { "rustfmt" },
+ sh = { "shfmt" },
+ bash = { "shfmt" },
+ zsh = { "shfmt" },
},
- },
- },
- init = function()
+ default_format_opts = {
+ lsp_format = "fallback",
+ },
+ formatters = {
+ shfmt = {
+ prepend_args = { "-i", "2" },
+ },
+ },
+ })
vim.o.formatexpr = "v:lua.require'conform'.formatexpr()"
vim.api.nvim_create_autocmd("BufWritePre", {
callback = require "cfg.utils".format_hunks,