diff options
| author | bh <qn+git@excalibur.computer> | 2025-11-12 23:57:20 +0800 |
|---|---|---|
| committer | bh <qn+git@excalibur.computer> | 2025-11-12 23:57:20 +0800 |
| commit | cc5ca2e8c8fa3cf2e60321fdb0cb4ddb66551ff2 (patch) | |
| tree | f6173f63d1bd48710728817bd338838654ec60de /lua/config/tabs.lua | |
Initial Commit
Diffstat (limited to 'lua/config/tabs.lua')
| -rw-r--r-- | lua/config/tabs.lua | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/lua/config/tabs.lua b/lua/config/tabs.lua new file mode 100644 index 0000000..82e9e8f --- /dev/null +++ b/lua/config/tabs.lua @@ -0,0 +1,81 @@ +-- ~/.config/nvim/lua/config/tabs.lua +return function() + -- Disable auto-setup + vim.g.barbar_auto_setup = false -- disable auto-setup + + require'barbar'.setup { + -- WARN: do not copy everything below into your config! + -- It is just an example of what configuration options there are. + -- The defaults are suitable for most people. + + -- Enable/disable animations + animation = true, + + -- Automatically hide the tabline when there are this many buffers left. + -- Set to any value >=0 to enable. + auto_hide = 1, + + -- Set the filetypes which barbar will offset itself for + sidebar_filetypes = { + -- Use the default values: {event = 'BufWinLeave', text = '', align = 'left'} + NvimTree = true, + -- Or, specify the text used for the offset: + undotree = { + text = 'undotree', + align = 'center', -- *optionally* specify an alignment (either 'left', 'center', or 'right') + }, + -- Or, specify the event which the sidebar executes when leaving: + ['neo-tree'] = {event = 'BufWipeout'}, + -- Or, specify all three + Outline = {event = 'BufWinLeave', text = 'symbols-outline', align = 'right'}, + }, + + -- icons = { + -- -- Configure the base icons on the bufferline. + -- -- Valid options to display the buffer index and -number are `true`, 'superscript' and 'subscript' + -- buffer_index = false, + -- buffer_number = false, + -- button = '', + -- -- Enables / disables diagnostic symbols + -- diagnostics = { + -- [vim.diagnostic.severity.ERROR] = {enabled = true, icon = 'ff'}, + -- [vim.diagnostic.severity.WARN] = {enabled = false}, + -- [vim.diagnostic.severity.INFO] = {enabled = false}, + -- [vim.diagnostic.severity.HINT] = {enabled = true}, + -- }, + -- gitsigns = { + -- added = {enabled = true, icon = '+'}, + -- changed = {enabled = true, icon = '~'}, + -- deleted = {enabled = true, icon = '-'}, + -- }, + -- filetype = { + -- -- Sets the icon's highlight group. + -- -- If false, will use nvim-web-devicons colors + -- custom_colors = false, + + -- -- Requires `nvim-web-devicons` if `true` + -- enabled = true, + -- }, + -- separator = {left = '▎', right = ''}, + + -- -- If true, add an additional separator at the end of the buffer list + -- separator_at_end = true, + + -- -- Configure the icons on the bufferline when modified or pinned. + -- -- Supports all the base icon options. + -- modified = {button = '●'}, + -- pinned = {button = '', filename = true}, + + -- -- Use a preconfigured buffer appearance— can be 'default', 'powerline', or 'slanted' + -- preset = 'default', + + -- -- Configure the icons on the bufferline based on the visibility of a buffer. + -- -- Supports all the base icon options, plus `modified` and `pinned`. + -- alternate = {filetype = {enabled = false}}, + -- current = {buffer_index = true}, + -- inactive = {button = '×'}, + -- visible = {modified = {buffer_number = false}}, + -- }, + } +end + |
