refactor nvim: 調整 scrollbar.lua

This commit is contained in:
Yuan Chiu 2025-05-31 12:58:38 +08:00
parent 37292668f4
commit 363bf9ce3d
Signed by: yuan
GPG Key ID: 50FBE4156404B98D

View File

@ -1,171 +1,172 @@
-- if true then return {} end -- 先停用 -- if true then return {} end -- 先停用
return { return {
{
'dstein64/nvim-scrollview', 'dstein64/nvim-scrollview',
config = function() opts = {
require('scrollview').setup({
current_only = true, current_only = true,
-- base = 'buffer', -- base = 'buffer',
-- column = 80, -- 註解掉這行,讓它自己決定位置 -- column = 80, -- 註解掉這行,讓它自己決定位置
-- excluded_filetypes = { 'neo-tree', 'help' }, -- excluded_filetypes = { 'neo-tree', 'help' },
signs_on_startup = { 'all' }, signs_on_startup = { 'all' },
diagnostics_severities = { vim.diagnostic.severity.ERROR }, diagnostics_severities = { vim.diagnostic.severity.ERROR },
}) },
config = function(_, opts)
require('scrollview').setup(opts)
end, end,
} },
-- return { -- { "petertriho/nvim-scrollbar",
-- { "petertriho/nvim-scrollbar", -- cond = true,
-- cond = true, -- config = function()
-- config = function() -- require("scrollbar").setup({
-- require("scrollbar").setup({ -- show = true,
-- show = true, -- show_in_active_only = false,
-- show_in_active_only = false, -- set_highlights = true,
-- set_highlights = true, -- folds = 1000, -- handle folds, set to number to disable folds if no. of lines in buffer exceeds this
-- folds = 1000, -- handle folds, set to number to disable folds if no. of lines in buffer exceeds this -- max_lines = false, -- disables if no. of lines in buffer exceeds this
-- max_lines = false, -- disables if no. of lines in buffer exceeds this -- hide_if_all_visible = false, -- Hides everything if all lines are visible
-- hide_if_all_visible = false, -- Hides everything if all lines are visible -- throttle_ms = 100,
-- throttle_ms = 100, -- handle = {
-- handle = { -- text = " ",
-- text = " ", -- blend = 30, -- Integer between 0 and 100. 0 for fully opaque and 100 to full transparent. Defaults to 30.
-- blend = 30, -- Integer between 0 and 100. 0 for fully opaque and 100 to full transparent. Defaults to 30. -- color = nil,
-- color = nil, -- color_nr = nil, -- cterm
-- color_nr = nil, -- cterm -- highlight = "CursorColumn",
-- highlight = "CursorColumn", -- hide_if_all_visible = true, -- Hides handle if all lines are visible
-- hide_if_all_visible = true, -- Hides handle if all lines are visible -- },
-- }, -- marks = {
-- marks = { -- Cursor = {
-- Cursor = { -- text = "•",
-- text = "•", -- priority = 0,
-- priority = 0, -- gui = nil,
-- gui = nil, -- color = nil,
-- color = nil, -- cterm = nil,
-- cterm = nil, -- color_nr = nil, -- cterm
-- color_nr = nil, -- cterm -- highlight = "Normal",
-- highlight = "Normal", -- },
-- }, -- Search = {
-- Search = { -- text = { "-", "=" },
-- text = { "-", "=" }, -- priority = 1,
-- priority = 1, -- gui = nil,
-- gui = nil, -- color = nil,
-- color = nil, -- cterm = nil,
-- cterm = nil, -- color_nr = nil, -- cterm
-- color_nr = nil, -- cterm -- highlight = "Search",
-- highlight = "Search", -- },
-- }, -- Error = {
-- Error = { -- text = { "-", "=" },
-- text = { "-", "=" }, -- priority = 2,
-- priority = 2, -- gui = nil,
-- gui = nil, -- color = nil,
-- color = nil, -- cterm = nil,
-- cterm = nil, -- color_nr = nil, -- cterm
-- color_nr = nil, -- cterm -- highlight = "DiagnosticVirtualTextError",
-- highlight = "DiagnosticVirtualTextError", -- },
-- }, -- Warn = {
-- Warn = { -- text = { "-", "=" },
-- text = { "-", "=" }, -- priority = 3,
-- priority = 3, -- gui = nil,
-- gui = nil, -- color = nil,
-- color = nil, -- cterm = nil,
-- cterm = nil, -- color_nr = nil, -- cterm
-- color_nr = nil, -- cterm -- highlight = "DiagnosticVirtualTextWarn",
-- highlight = "DiagnosticVirtualTextWarn", -- },
-- }, -- Info = {
-- Info = { -- text = { "-", "=" },
-- text = { "-", "=" }, -- priority = 4,
-- priority = 4, -- gui = nil,
-- gui = nil, -- color = nil,
-- color = nil, -- cterm = nil,
-- cterm = nil, -- color_nr = nil, -- cterm
-- color_nr = nil, -- cterm -- highlight = "DiagnosticVirtualTextInfo",
-- highlight = "DiagnosticVirtualTextInfo", -- },
-- }, -- Hint = {
-- Hint = { -- text = { "-", "=" },
-- text = { "-", "=" }, -- priority = 5,
-- priority = 5, -- gui = nil,
-- gui = nil, -- color = nil,
-- color = nil, -- cterm = nil,
-- cterm = nil, -- color_nr = nil, -- cterm
-- color_nr = nil, -- cterm -- highlight = "DiagnosticVirtualTextHint",
-- highlight = "DiagnosticVirtualTextHint", -- },
-- }, -- Misc = {
-- Misc = { -- text = { "-", "=" },
-- text = { "-", "=" }, -- priority = 6,
-- priority = 6, -- gui = nil,
-- gui = nil, -- color = nil,
-- color = nil, -- cterm = nil,
-- cterm = nil, -- color_nr = nil, -- cterm
-- color_nr = nil, -- cterm -- highlight = "Normal",
-- highlight = "Normal", -- },
-- }, -- GitAdd = {
-- GitAdd = { -- text = "┆",
-- text = "┆", -- priority = 7,
-- priority = 7, -- gui = nil,
-- gui = nil, -- color = nil,
-- color = nil, -- cterm = nil,
-- cterm = nil, -- color_nr = nil, -- cterm
-- color_nr = nil, -- cterm -- highlight = "GitSignsAdd",
-- highlight = "GitSignsAdd", -- },
-- }, -- GitChange = {
-- GitChange = { -- text = "┆",
-- text = "┆", -- priority = 7,
-- priority = 7, -- gui = nil,
-- gui = nil, -- color = nil,
-- color = nil, -- cterm = nil,
-- cterm = nil, -- color_nr = nil, -- cterm
-- color_nr = nil, -- cterm -- highlight = "GitSignsChange",
-- highlight = "GitSignsChange", -- },
-- }, -- GitDelete = {
-- GitDelete = { -- text = "▁",
-- text = "▁", -- priority = 7,
-- priority = 7, -- gui = nil,
-- gui = nil, -- color = nil,
-- color = nil, -- cterm = nil,
-- cterm = nil, -- color_nr = nil, -- cterm
-- color_nr = nil, -- cterm -- highlight = "GitSignsDelete",
-- highlight = "GitSignsDelete", -- },
-- }, -- },
-- }, -- excluded_buftypes = {
-- excluded_buftypes = { -- "terminal",
-- "terminal", -- },
-- }, -- excluded_filetypes = {
-- excluded_filetypes = { -- "dropbar_menu",
-- "dropbar_menu", -- "dropbar_menu_fzf",
-- "dropbar_menu_fzf", -- "DressingInput",
-- "DressingInput", -- "cmp_docs",
-- "cmp_docs", -- "cmp_menu",
-- "cmp_menu", -- "noice",
-- "noice", -- "prompt",
-- "prompt", -- "TelescopePrompt",
-- "TelescopePrompt", -- },
-- }, -- autocmd = {
-- autocmd = { -- render = {
-- render = { -- "BufWinEnter",
-- "BufWinEnter", -- "TabEnter",
-- "TabEnter", -- "TermEnter",
-- "TermEnter", -- "WinEnter",
-- "WinEnter", -- "CmdwinLeave",
-- "CmdwinLeave", -- "TextChanged",
-- "TextChanged", -- "VimResized",
-- "VimResized", -- "WinScrolled",
-- "WinScrolled", -- },
-- }, -- clear = {
-- clear = { -- "BufWinLeave",
-- "BufWinLeave", -- "TabLeave",
-- "TabLeave", -- "TermLeave",
-- "TermLeave", -- "WinLeave",
-- "WinLeave", -- },
-- }, -- },
-- }, -- handlers = {
-- handlers = { -- cursor = true,
-- cursor = true, -- diagnostic = true,
-- diagnostic = true, -- gitsigns = false, -- Requires gitsigns
-- gitsigns = false, -- Requires gitsigns -- handle = true,
-- handle = true, -- search = false, -- Requires hlslens
-- search = false, -- Requires hlslens -- ale = false, -- Requires ALE
-- ale = false, -- Requires ALE -- },
-- }, -- })
-- }) -- end
-- end -- },
-- }, }
-- }