fix nvim: barbar

This commit is contained in:
Yuan Chiu 2025-05-06 04:57:02 +08:00
parent fe668d4424
commit 3e138a5f5e

View File

@ -5,16 +5,21 @@ return {
-- 'lewis6991/gitsigns.nvim', -- OPTIONAL: for git status -- 'lewis6991/gitsigns.nvim', -- OPTIONAL: for git status
'nvim-tree/nvim-web-devicons', -- OPTIONAL: for file icons 'nvim-tree/nvim-web-devicons', -- OPTIONAL: for file icons
}, },
lazy = false,
init = function() vim.g.barbar_auto_setup = false end, init = function() vim.g.barbar_auto_setup = false end,
-- opts = { opts = {
-- -- lazy.nvim will automatically call setup for you. put your options here, anything missing will use the default: -- lazy.nvim will automatically call setup for you. put your options here, anything missing will use the default:
-- -- animation = false, auto_hide = -1,
-- -- insert_at_start = true, clickable = true,
-- -- …etc. icons = {
-- }, buffer_index = false,
config = function(_, opts) buffer_number = false,
require'bufferline'.setup { button = '',
-- animation = false, -- 禁用動畫效果 diagnostics = {{enabled = true}, {enabled = true}},
filetype = {enabled = true},
separator = {left = '', right = ''},
-- separator = {left = '', right = ''},
},
sidebar_filetypes = { sidebar_filetypes = {
['neo-tree'] = {event = 'BufWipeout'}, ['neo-tree'] = {event = 'BufWipeout'},
undotree = { undotree = {
@ -22,7 +27,24 @@ return {
align = 'center', -- *optionally* specify an alignment (either 'left', 'center', or 'right') align = 'center', -- *optionally* specify an alignment (either 'left', 'center', or 'right')
}, },
}, },
} -- icons = {current = {filetype = {enabled = false}}},
-- maximum_padding = math.huge,
-- animation = false,
-- insert_at_start = true,
-- …etc.
},
config = function(_, opts)
-- require'bufferline'.setup {
-- -- animation = false, -- 禁用動畫效果
-- sidebar_filetypes = {
-- ['neo-tree'] = {event = 'BufWipeout'},
-- undotree = {
-- text = 'undotree',
-- align = 'center', -- *optionally* specify an alignment (either 'left', 'center', or 'right')
-- },
-- },
-- }
require('barbar').setup(opts)
-- 重定義 :q 命令為僅關閉當前 Buffer -- 重定義 :q 命令為僅關閉當前 Buffer
vim.api.nvim_create_user_command('Q', function() vim.api.nvim_create_user_command('Q', function()