✨ feat(nvim): new extra: inline fold
useful for working with tailwind
This commit is contained in:
parent
d294825200
commit
158a591850
3 changed files with 31 additions and 0 deletions
1
.config/nvim/.github/README.md
vendored
1
.config/nvim/.github/README.md
vendored
|
@ -515,6 +515,7 @@
|
|||
<summary><b>🔧 Utility</b></summary>
|
||||
|
||||
- [zbirenbaum/neodim](https://dotfyle.com/plugins/zbirenbaum/neodim)
|
||||
- [malbertzard/inline-fold.nvim](https://dotfyle.com/plugins/malbertzard/inline-fold.nvim)
|
||||
- [dmmulroy/ts-error-translator.nvim](https://dotfyle.com/plugins/dmmulroy/ts-error-translator.nvim)
|
||||
- [creativenull/dotfyle-metadata.nvim](https://dotfyle.com/plugins/creativenull/dotfyle-metadata.nvim)
|
||||
- [rasulomaroff/reactive.nvim](https://dotfyle.com/plugins/rasulomaroff/reactive.nvim)
|
||||
|
|
|
@ -47,3 +47,5 @@ o.breakindent = true
|
|||
if vim.fn.has("nvim-0.10") == 1 then
|
||||
o.smoothscroll = true
|
||||
end
|
||||
|
||||
o.conceallevel = 2
|
||||
|
|
28
.config/nvim/lua/plugins/extras/ui/inline-fold.lua
Normal file
28
.config/nvim/lua/plugins/extras/ui/inline-fold.lua
Normal file
|
@ -0,0 +1,28 @@
|
|||
return {
|
||||
"malbertzard/inline-fold.nvim",
|
||||
init = function()
|
||||
vim.api.nvim_create_autocmd({ "BufEnter", "BufWinEnter" }, {
|
||||
pattern = { "*.html", "*.tsx", "*.jsx" },
|
||||
callback = function(_)
|
||||
if not require("inline-fold.module").isHidden then
|
||||
vim.cmd("InlineFoldToggle")
|
||||
end
|
||||
end,
|
||||
})
|
||||
end,
|
||||
ft = "html",
|
||||
cmd = "InlineFoldToggle",
|
||||
opts = {
|
||||
defaultPlaceholder = "…",
|
||||
queries = {
|
||||
html = {
|
||||
{ pattern = 'class="([^"]*)"' },
|
||||
{ pattern = 'href="(.-)"' },
|
||||
{ pattern = 'src="(.-)"' },
|
||||
},
|
||||
},
|
||||
},
|
||||
keys = {
|
||||
{ "<leader>uI", "<cmd>InlineFoldToggle<CR>", desc = "Toggle Inline Fold" },
|
||||
},
|
||||
}
|
Loading…
Add table
Reference in a new issue