fix: better fold

This commit is contained in:
alzalia1 2025-08-17 17:42:12 +02:00
parent 67df812bec
commit 640176cad2
7 changed files with 45 additions and 47 deletions

View file

@ -1,18 +1,24 @@
local options = {
formatters_by_ft = {
lua = { "stylua" },
css = { "prettier" },
html = { "prettier" },
typescript = { "prettier" },
typescriptreact = { "prettier" },
javascript = { "prettier" },
javascriptreact = { "prettier" },
},
formatters_by_ft = {
lua = { "stylua" },
css = { "prettier" },
html = { "prettier" },
typescript = { "prettier" },
typescriptreact = { "prettier" },
javascript = { "prettier" },
javascriptreact = { "prettier" },
},
format_on_save = {
timeout_ms = 500,
lsp_fallback = true,
},
format_on_save = {
timeout_ms = 500,
lsp_fallback = true,
},
formatters = {
prettier = {
append_args = { "--tab-width", "4" },
},
},
}
return options

View file

@ -1,10 +0,0 @@
local highlight = {
"CatppuccinRed",
"CatppuccinPeach",
"CatppuccinYellow",
"CatppuccinGreen",
"CatppuccinBlue",
"CatppuccinPurple",
}
return highlight

View file

@ -1,13 +0,0 @@
return {
"chrisgrieser/nvim-origami",
event = "VeryLazy",
opts = {
foldKeymaps = { setup = false },
}, -- needed even when using default config
-- recommended: disable vim's auto-folding
init = function()
vim.opt.foldlevel = 99
vim.opt.foldlevelstart = 99
end,
}

View file

@ -0,0 +1,20 @@
return {
"kevinhwang91/nvim-ufo",
event = "BufReadPost",
dependencies = {
"kevinhwang91/promise-async",
"nvim-treesitter/nvim-treesitter",
},
init = function()
vim.o.foldenable = true
vim.o.foldcolumn = "auto:9"
vim.o.foldlevel = 99
vim.o.foldlevelstart = 99
vim.o.fillchars = "eob: ,fold: ,foldopen:,foldsep:│,foldclose:"
end,
opts = {
provider_selector = function()
return { "treesitter", "indent" }
end,
},
}

View file

@ -15,16 +15,8 @@ map("n", "K", "<cmd>Lspsaga hover_doc<CR>", { desc = "Displays doc" })
-- toogle terminal
map("n", "<C-t>", function()
term.toggle()
term.toggle()
end)
map("t", "<C-t>", function()
term.toggle()
end)
-- folds
map("n", "<Left>", function()
require("origami").h()
end)
map("n", "<Right>", function()
require("origami").l()
term.toggle()
end)

View file

@ -4,3 +4,5 @@ require "nvchad.options"
local o = vim.o
o.shiftwidth = 4
o.tabstop = 4
-- vim.wo.number = true