mirror of
https://github.com/dcarrillo/dotfiles.git
synced 2024-12-22 13:58:00 +00:00
[neovim] Add ufo/statuscol
This commit is contained in:
parent
a5f849c30e
commit
3f298771a5
@ -36,7 +36,6 @@ vim.opt.wrap = false -- display lines as one long line
|
|||||||
vim.opt.scrolloff = 8
|
vim.opt.scrolloff = 8
|
||||||
vim.opt.sidescrolloff = 8
|
vim.opt.sidescrolloff = 8
|
||||||
vim.opt.guifont = "monospace:h10" -- the font used in graphical neovim applications
|
vim.opt.guifont = "monospace:h10" -- the font used in graphical neovim applications
|
||||||
vim.opt.fillchars.eob = " "
|
|
||||||
vim.opt.shortmess:append("c")
|
vim.opt.shortmess:append("c")
|
||||||
vim.opt.whichwrap:append("<,>,[,],h,l")
|
vim.opt.whichwrap:append("<,>,[,],h,l")
|
||||||
vim.opt.iskeyword:append("-")
|
vim.opt.iskeyword:append("-")
|
||||||
@ -44,5 +43,11 @@ vim.opt.formatoptions:remove({ "c", "r", "o" })
|
|||||||
vim.opt.linebreak = true
|
vim.opt.linebreak = true
|
||||||
vim.opt.numberwidth = 1
|
vim.opt.numberwidth = 1
|
||||||
|
|
||||||
|
vim.opt.foldenable = true
|
||||||
|
vim.opt.foldlevel = 99
|
||||||
|
vim.opt.foldlevelstart = 99
|
||||||
|
vim.opt.foldcolumn = "1"
|
||||||
|
vim.opt.fillchars = [[eob: ,fold: ,foldopen:,foldsep: ,foldclose:,diff: ]]
|
||||||
|
|
||||||
-- experimental
|
-- experimental
|
||||||
vim.opt.cmdheight = 0 -- Number of screen lines to use for the command-line
|
vim.opt.cmdheight = 0 -- Number of screen lines to use for the command-line
|
||||||
|
@ -173,4 +173,31 @@ require("lazy").setup({
|
|||||||
end,
|
end,
|
||||||
ft = { "markdown" },
|
ft = { "markdown" },
|
||||||
},
|
},
|
||||||
|
|
||||||
|
-- Folding
|
||||||
|
{
|
||||||
|
"kevinhwang91/nvim-ufo",
|
||||||
|
dependencies = {
|
||||||
|
"kevinhwang91/promise-async",
|
||||||
|
{
|
||||||
|
"luukvbaal/statuscol.nvim",
|
||||||
|
config = function()
|
||||||
|
local builtin = require("statuscol.builtin")
|
||||||
|
require("statuscol").setup({
|
||||||
|
relculright = true,
|
||||||
|
segments = {
|
||||||
|
{
|
||||||
|
text = {
|
||||||
|
builtin.foldfunc,
|
||||||
|
},
|
||||||
|
click = "v:lua.ScFa",
|
||||||
|
},
|
||||||
|
{ text = { "%s" }, click = "v:lua.ScSa" },
|
||||||
|
{ text = { builtin.lnumfunc, " " }, click = "v:lua.ScLa" },
|
||||||
|
},
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
}, lazy_opts)
|
}, lazy_opts)
|
||||||
|
@ -6,4 +6,4 @@ require("diffview").setup({
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
vim.opt.fillchars = "diff: "
|
-- vim.opt.fillchars = "diff: "
|
||||||
|
@ -21,3 +21,4 @@ require("plugins.markdowntoc")
|
|||||||
require("plugins.projections")
|
require("plugins.projections")
|
||||||
require("plugins.diffview")
|
require("plugins.diffview")
|
||||||
require("plugins.align")
|
require("plugins.align")
|
||||||
|
require("plugins.ufo")
|
||||||
|
13
.config/nvim/lua/plugins/ufo.lua
Normal file
13
.config/nvim/lua/plugins/ufo.lua
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
require("ufo").setup({
|
||||||
|
provider_selector = function(bufnr, filetype, buftype)
|
||||||
|
return { "treesitter", "indent" }
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
local keymap = vim.keymap.set
|
||||||
|
-- Code Folding
|
||||||
|
-- keymap("n", "zR", require("ufo").openAllFolds, { desc = "Open all folds" })
|
||||||
|
-- keymap("n", "zM", require("ufo").closeAllFolds, { desc = "Close all folds" })
|
||||||
|
keymap("n", "zr", require("ufo").openFoldsExceptKinds, { desc = "Fold less" })
|
||||||
|
keymap("n", "zm", require("ufo").closeFoldsWith, { desc = "Fold more" })
|
||||||
|
keymap("n", "zp", require("ufo").peekFoldedLinesUnderCursor, { desc = "Peek fold" })
|
Loading…
Reference in New Issue
Block a user