feat(nvim): add statuscol-nvim
This commit is contained in:
parent
7d1ae8c1f4
commit
8768b58ce1
3 changed files with 27 additions and 24 deletions
|
@ -150,6 +150,11 @@ with builtins;
|
|||
}
|
||||
];
|
||||
}
|
||||
{
|
||||
plugin = statuscol-nvim;
|
||||
event = [ "VeryLazy" ];
|
||||
conf = readFile ./statuscol-nvim.lua;
|
||||
}
|
||||
{
|
||||
plugin = vim-fugitive;
|
||||
event = [ "VeryLazy" ];
|
||||
|
|
|
@ -2,30 +2,6 @@ vim.o.foldcolumn = "1" -- '0' is not bad
|
|||
vim.o.foldlevel = 99 -- Using ufo provider need a large value, feel free to decrease the value
|
||||
vim.o.foldlevelstart = 99
|
||||
vim.o.foldenable = true
|
||||
vim.o.fillchars = [[eob: ,fold: ,foldopen:,foldsep: ,foldclose:]]
|
||||
vim.o.statuscolumn = "%s" -- sign column
|
||||
.. "%="
|
||||
.. "%{%" -- evaluate this, and then evaluate what it returns
|
||||
.. "&number ?"
|
||||
.. "(v:relnum ?"
|
||||
-- when showing relative numbers, make sure to pad so things don't shift as you move the cursor
|
||||
.. 'printf("%"..len(line("$")).."s", v:relnum)'
|
||||
.. ":"
|
||||
.. "v:lnum"
|
||||
.. ")"
|
||||
.. ":"
|
||||
.. '""'
|
||||
.. "%}"
|
||||
.. "%#FoldColumn#" -- highlight group for fold
|
||||
.. "%{" -- expression for showing fold expand/colapse
|
||||
.. "foldlevel(v:lnum) > foldlevel(v:lnum - 1)" -- any folds?
|
||||
.. "? (foldclosed(v:lnum) == -1" -- currently open?
|
||||
.. '? ""' -- point down
|
||||
.. ': ""' -- point to right
|
||||
.. ")"
|
||||
.. ': " "' -- blank for no fold, or inside fold
|
||||
.. "}"
|
||||
.. " "
|
||||
|
||||
local ftMap = {
|
||||
vim = "indent",
|
||||
|
|
22
modules/programs/nvim/plugins/statuscol-nvim.lua
Normal file
22
modules/programs/nvim/plugins/statuscol-nvim.lua
Normal file
|
@ -0,0 +1,22 @@
|
|||
vim.o.fillchars = [[eob: ,fold: ,foldopen:,foldsep: ,foldclose:]]
|
||||
local builtin = require("statuscol.builtin")
|
||||
require("statuscol").setup({
|
||||
segments = {
|
||||
{
|
||||
sign = { name = { ".*" }, auto = true },
|
||||
click = "v:lua.ScSa",
|
||||
},
|
||||
{
|
||||
text = { builtin.lnumfunc },
|
||||
click = "v:lua.ScLa",
|
||||
},
|
||||
{
|
||||
sign = { name = { "GitSigns" }, auto = true },
|
||||
click = "v:lua.ScSa",
|
||||
},
|
||||
{
|
||||
text = { builtin.foldfunc, " " },
|
||||
click = "v:lua.ScFa",
|
||||
},
|
||||
},
|
||||
})
|
Loading…
Reference in a new issue