Add two optional plugins; luukvbaal/statuscol.nvim and kevinhwang91/nvim-ufo

This commit is contained in:
name 2024-10-18 14:02:24 +09:00
parent 4120893b8a
commit 730e87f485
3 changed files with 52 additions and 0 deletions

View File

@ -922,6 +922,8 @@ require('lazy').setup({
-- require 'kickstart.plugins.lint', -- require 'kickstart.plugins.lint',
-- require 'kickstart.plugins.autopairs', -- require 'kickstart.plugins.autopairs',
-- require 'kickstart.plugins.neo-tree', -- require 'kickstart.plugins.neo-tree',
-- require 'kickstart.plugins.statuscol',
-- require 'kickstart.plugins.nvim-ufo',
-- require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps -- require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps
-- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua` -- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua`

View File

@ -0,0 +1,19 @@
-- Makes folding look modern and keep high performance
return {
'kevinhwang91/nvim-ufo',
dependencies = { 'kevinhwang91/promise-async' },
config = function()
vim.opt.foldlevel = 99 -- Using ufo provider need a large value, feel free to decrease the value
vim.opt.foldlevelstart = 99
-- treesitter as a main provider instead
-- (Note: the `nvim-treesitter` plugin is *not* needed.)
-- ufo uses the same query files for folding (queries/<lang>/folds.scm)
-- performance and stability are better than `foldmethod=nvim_treesitter#foldexpr()`
require('ufo').setup {
provider_selector = function(bufnr, filetype, buftype)
return { 'treesitter', 'indent' }
end,
}
end,
}

View File

@ -0,0 +1,31 @@
-- Provide a configurable 'statuscolumn' and click handlers
return {
'luukvbaal/statuscol.nvim',
config = function()
vim.opt.fillchars = vim.g.have_nerd_font and { foldclose = '', foldopen = '', foldsep = ' ' } or { foldclose = '˃', foldopen = '˅', foldsep = ' ' }
vim.opt.foldcolumn = '1'
local builtin = require 'statuscol.builtin'
require('statuscol').setup {
-- configuration goes here, for example:
relculright = true, -- whether to right-align the cursor line number with 'relativenumber' set
segments = {
{
sign = { namespace = { 'diagnostic/signs' } },
click = 'v:lua.ScSa',
},
{
sign = { name = { '.*' }, colwidth = 1 }, -- signs like breakpoints, etc.
click = 'v:lua.ScSa',
},
{ text = { builtin.lnumfunc }, click = 'v:lua.ScLa' }, -- line number that can be configured through a few options
{
sign = { namespace = { 'gitsigns' }, colwidth = 1 },
click = 'v:lua.ScSa',
},
{ text = { builtin.foldfunc }, click = 'v:lua.ScFa' }, -- fold column that does not print the fold depth digits
{ text = { ' ' } }, -- whitespace padding
},
}
end,
}