aboutsummaryrefslogtreecommitdiff
path: root/lua/config/nvim-bufferline.lua
diff options
context:
space:
mode:
authorjdhao <jdhao@hotmail.com>2021-08-15 00:41:05 +0800
committerjdhao <jdhao@hotmail.com>2021-08-15 00:41:05 +0800
commit9f0fe3972747f51c7ed7cd6bfb8dd02ca7b3fb8f (patch)
tree7051555fc3303da67d2bfc0c1f35b58f5f96bd71 /lua/config/nvim-bufferline.lua
parent07c80f948df52deff38f5b838b4a0dc42b683cdb (diff)
Change bufferline plugin to nvim-bufferline
It looks better than barbar.nvim, IMO.
Diffstat (limited to 'lua/config/nvim-bufferline.lua')
-rw-r--r--lua/config/nvim-bufferline.lua45
1 files changed, 45 insertions, 0 deletions
diff --git a/lua/config/nvim-bufferline.lua b/lua/config/nvim-bufferline.lua
new file mode 100644
index 0000000..8697030
--- /dev/null
+++ b/lua/config/nvim-bufferline.lua
@@ -0,0 +1,45 @@
+require('bufferline').setup {
+ options = {
+ numbers = "buffer_id",
+ number_style = "superscript",
+ mappings = false,
+ close_command = "bdelete! %d",
+ right_mouse_command = nil,
+ left_mouse_command = "buffer %d",
+ middle_mouse_command = nil,
+ indicator_icon = '▎',
+ buffer_close_icon = '',
+ modified_icon = '●',
+ close_icon = '',
+ left_trunc_marker = '',
+ right_trunc_marker = '',
+ max_name_length = 18,
+ max_prefix_length = 15,
+ tab_size = 10,
+ diagnostics = false,
+ custom_filter = function(bufnr)
+ -- if the result is false, this buffer will be shown, otherwise, this
+ -- buffer will be hidden.
+
+ -- filter out filetypes you don't want to see
+ local exclude_ft = {'qf', 'fugitive', 'git'}
+ local cur_ft = vim.bo[bufnr].filetype
+ local should_filter = vim.tbl_contains(exclude_ft, cur_ft)
+
+ if should_filter then
+ return false
+ end
+
+ return true
+ end,
+ show_buffer_icons = false,
+ show_buffer_close_icons = true,
+ show_close_icon = true,
+ show_tab_indicators = true,
+ persist_buffer_sort = true, -- whether or not custom sorted buffers should persist
+ separator_style = "slant",
+ enforce_regular_tabs = false,
+ always_show_bufferline = true,
+ sort_by = 'id'
+ }
+}