From 13cc96c00b4bd26d451e49936ae039558333ebd7 Mon Sep 17 00:00:00 2001 From: jdhao Date: Sat, 21 Aug 2021 20:43:25 +0800 Subject: chore: nvim-bufferline.lua has been renamed to bufferline.nvim --- lua/config/bufferline.lua | 45 ++++++++++++++++++++++++++++++++++++++++++ lua/config/nvim-bufferline.lua | 45 ------------------------------------------ 2 files changed, 45 insertions(+), 45 deletions(-) create mode 100644 lua/config/bufferline.lua delete mode 100644 lua/config/nvim-bufferline.lua (limited to 'lua/config') diff --git a/lua/config/bufferline.lua b/lua/config/bufferline.lua new file mode 100644 index 0000000..772287c --- /dev/null +++ b/lua/config/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", + }, +}) diff --git a/lua/config/nvim-bufferline.lua b/lua/config/nvim-bufferline.lua deleted file mode 100644 index 772287c..0000000 --- a/lua/config/nvim-bufferline.lua +++ /dev/null @@ -1,45 +0,0 @@ -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", - }, -}) -- cgit v1.2.3