diff --git a/lazy-lock.json b/lazy-lock.json index 7112d0b..d0d3f63 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -46,7 +46,7 @@ "onedark.nvim": { "branch": "master", "commit": "1230aaf2a427b2c5b73aba6e4a9a5881d3e69429" }, "plenary.nvim": { "branch": "master", "commit": "50012918b2fc8357b87cff2a7f7f0446e47da174" }, "smart-splits.nvim": { "branch": "master", "commit": "f6fcb79527872e9330c554915af2ca511c388390" }, - "telescope.nvim": { "branch": "master", "commit": "5730b950d9e4dc0c3633c1c1a2cb2612069ef480" }, + "telescope.nvim": { "branch": "master", "commit": "c816406bd50ade6ec754474f08974154487d417c" }, "toggleterm.nvim": { "branch": "main", "commit": "193786e0371e3286d3bc9aa0079da1cd41beaa62" }, "vim-illuminate": { "branch": "master", "commit": "305bf07b919ac526deb5193280379e2f8b599926" }, "vim-startuptime": { "branch": "master", "commit": "97a88e688482a09c3c4b777d07b509b328a5ec29" }, diff --git a/lua/custom/plugins/bufferline.lua b/lua/custom/plugins/bufferline.lua index 27b0789..ca7678f 100644 --- a/lua/custom/plugins/bufferline.lua +++ b/lua/custom/plugins/bufferline.lua @@ -1,161 +1,167 @@ return { - "akinsho/bufferline.nvim", - event = "VeryLazy", - config = function() - local status_ok, bufferline = pcall(require, "bufferline") - if not status_ok then - return - end - - local icons = require("user.icons") - local use_icons = true - - local function diagnostics_indicator(num, _, diagnostics, _) - local result = {} - local symbols = { - error = icons.diagnostics.Error, - warning = icons.diagnostics.Warning, - info = icons.diagnostics.Information, - } - if not use_icons then - return "(" .. num .. ")" - end - for name, count in pairs(diagnostics) do - if symbols[name] and count > 0 then - table.insert(result, symbols[name] .. " " .. count) - end - end - result = table.concat(result, " ") - return #result > 0 and result or "" - end - - vim.opt.termguicolors = true - - bufferline.setup({ - options = { - color_icons = true, - numbers = "none", -- | "ordinal" | "buffer_id" | "both" | function({ ordinal, id, lower, raise }): string, - close_command = function(bufnum) - require("bufdelete").bufdelete(bufnum, true) - end, - right_mouse_command = function(bufnum) - require("bufdelete").bufdelete(bufnum, true) - end, - -- close_command = "bdelete! %d", - -- right_mouse_command = "bdelete! %d", - left_mouse_command = "buffer %d", - middle_mouse_command = nil, - - indicator_icon = nil, - indicator = { style = "icon", icon = "▎" }, - buffer_close_icon = icons.ui.Close, - modified_icon = icons.ui.Circle, - close_icon = icons.ui.BoldClose, - left_trunc_marker = icons.ui.ArrowCircleLeft, - right_trunc_marker = icons.ui.ArrowCircleRight, - max_name_length = 30, - max_prefix_length = 30, - tab_size = 21, - diagnostics = false, -- | "nvim_lsp" | "coc", - diagnostics_update_in_insert = false, - diagnostics_indicator = diagnostics_indicator, - offsets = { - { - filetype = "NvimTree", - text = "Explorer", - highlight = "Directory", - text_align = "left", - padding = 1, - }, - { - filetype = "neo-tree", - text = "Explorer", - highlight = "Directory", - text_align = "left", - padding = 1, - }, - }, - show_buffer_icons = true, - 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 = { "", "" }, -- | "thick" | "thin" | { 'any', 'any' }, - enforce_regular_tabs = true, - always_show_bufferline = true, - }, - highlights = { - background = { - fg = { attribute = "fg", highlight = "TabLine" }, - bg = { attribute = "none", highlight = "TabLine" }, - }, - buffer_visible = { - fg = { attribute = "fg", highlight = "TabLine" }, - bg = { attribute = "none", highlight = "TabLine" }, - }, - close_button = { - fg = { attribute = "fg", highlight = "TabLine" }, - bg = { attribute = "none", highlight = "TabLine" }, - }, - close_button_visible = { - fg = { attribute = "fg", highlight = "TabLine" }, - bg = { attribute = "none", highlight = "TabLine" }, - }, - tab_selected = { - fg = { attribute = "fg", highlight = "Normal" }, - bg = { attribute = "bg", highlight = "Normal" }, - }, - tab = { - fg = { attribute = "fg", highlight = "TabLine" }, - bg = { attribute = "bg", highlight = "TabLine" }, - }, - tab_close = { - -- fg = {attribute='fg',highlight='LspDiagnosticsDefaultError'}, - fg = { attribute = "fg", highlight = "TabLineSel" }, - bg = { attribute = "bg", highlight = "Normal" }, - }, - duplicate_selected = { - fg = { attribute = "fg", highlight = "TabLineSel" }, - bg = { attribute = "bg", highlight = "TabLineSel" }, - underline = true, - }, - duplicate_visible = { - fg = { attribute = "fg", highlight = "TabLine" }, - bg = { attribute = "bg", highlight = "TabLine" }, - underline = true, - }, - duplicate = { - fg = { attribute = "fg", highlight = "TabLine" }, - bg = { attribute = "bg", highlight = "TabLine" }, - underline = true, - }, - - modified = { - fg = { attribute = "fg", highlight = "TabLine" }, - bg = { attribute = "bg", highlight = "TabLine" }, - }, - modified_selected = { - fg = { attribute = "fg", highlight = "Normal" }, - bg = { attribute = "bg", highlight = "Normal" }, - }, - modified_visible = { - fg = { attribute = "fg", highlight = "TabLine" }, - bg = { attribute = "bg", highlight = "TabLine" }, - }, - - separator = { - fg = { attribute = "bg", highlight = "TabLine" }, - bg = { attribute = "bg", highlight = "TabLine" }, - }, - separator_selected = { - fg = { attribute = "bg", highlight = "Normal" }, - bg = { attribute = "bg", highlight = "Normal" }, - }, - indicator_selected = { - fg = { attribute = "fg", highlight = "LspDiagnosticsDefaultHint" }, - bg = { attribute = "bg", highlight = "Normal" }, - }, - }, - }) - end, + -- "akinsho/bufferline.nvim", + -- event = "VeryLazy", + -- config = function() + -- local status_ok, bufferline = pcall(require, "bufferline") + -- if not status_ok then + -- return + -- end + -- + -- local icons = require("user.icons") + -- local use_icons = true + -- + -- -- get folder name from current directory + -- local _get_folder_name = function() + -- local str = vim.fn.fnamemodify(vim.fn.getcwd(), ":t") + -- return " 󱧶 " .. str:lower():gsub("^%l", string.upper) .. " " + -- end + -- + -- local function diagnostics_indicator(num, _, diagnostics, _) + -- local result = {} + -- local symbols = { + -- error = icons.diagnostics.Error, + -- warning = icons.diagnostics.Warning, + -- info = icons.diagnostics.Information, + -- } + -- if not use_icons then + -- return "(" .. num .. ")" + -- end + -- for name, count in pairs(diagnostics) do + -- if symbols[name] and count > 0 then + -- table.insert(result, symbols[name] .. " " .. count) + -- end + -- end + -- result = table.concat(result, " ") + -- return #result > 0 and result or "" + -- end + -- + -- vim.opt.termguicolors = true + -- + -- bufferline.setup({ + -- options = { + -- color_icons = true, + -- numbers = "none", -- | "ordinal" | "buffer_id" | "both" | function({ ordinal, id, lower, raise }): string, + -- close_command = function(bufnum) + -- require("bufdelete").bufdelete(bufnum, true) + -- end, + -- right_mouse_command = function(bufnum) + -- require("bufdelete").bufdelete(bufnum, true) + -- end, + -- -- close_command = "bdelete! %d", + -- -- right_mouse_command = "bdelete! %d", + -- left_mouse_command = "buffer %d", + -- middle_mouse_command = nil, + -- + -- indicator_icon = nil, + -- indicator = { style = "icon", icon = "▎" }, + -- buffer_close_icon = icons.ui.Close, + -- modified_icon = icons.ui.Circle, + -- close_icon = icons.ui.BoldClose, + -- left_trunc_marker = icons.ui.ArrowCircleLeft, + -- right_trunc_marker = icons.ui.ArrowCircleRight, + -- max_name_length = 30, + -- max_prefix_length = 30, + -- tab_size = 21, + -- diagnostics = false, -- | "nvim_lsp" | "coc", + -- diagnostics_update_in_insert = false, + -- diagnostics_indicator = diagnostics_indicator, + -- offsets = { + -- { + -- filetype = "NvimTree", + -- text = _get_folder_name(), + -- highlight = "Directory", + -- text_align = "left", + -- padding = 1, + -- }, + -- { + -- filetype = "neo-tree", + -- text = _get_folder_name(), + -- highlight = "Directory", + -- text_align = "left", + -- padding = 1, + -- }, + -- }, + -- show_buffer_icons = true, + -- 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 = { "", "" }, -- | "thick" | "thin" | { 'any', 'any' }, + -- enforce_regular_tabs = true, + -- always_show_bufferline = true, + -- }, + -- highlights = { + -- background = { + -- fg = { attribute = "fg", highlight = "TabLine" }, + -- bg = { attribute = "none", highlight = "TabLine" }, + -- }, + -- buffer_visible = { + -- fg = { attribute = "fg", highlight = "TabLine" }, + -- bg = { attribute = "none", highlight = "TabLine" }, + -- }, + -- close_button = { + -- fg = { attribute = "fg", highlight = "TabLine" }, + -- bg = { attribute = "none", highlight = "TabLine" }, + -- }, + -- close_button_visible = { + -- fg = { attribute = "fg", highlight = "TabLine" }, + -- bg = { attribute = "none", highlight = "TabLine" }, + -- }, + -- tab_selected = { + -- fg = { attribute = "fg", highlight = "Normal" }, + -- bg = { attribute = "bg", highlight = "Normal" }, + -- }, + -- tab = { + -- fg = { attribute = "fg", highlight = "TabLine" }, + -- bg = { attribute = "bg", highlight = "TabLine" }, + -- }, + -- tab_close = { + -- -- fg = {attribute='fg',highlight='LspDiagnosticsDefaultError'}, + -- fg = { attribute = "fg", highlight = "TabLineSel" }, + -- bg = { attribute = "bg", highlight = "Normal" }, + -- }, + -- duplicate_selected = { + -- fg = { attribute = "fg", highlight = "TabLineSel" }, + -- bg = { attribute = "bg", highlight = "TabLineSel" }, + -- underline = true, + -- }, + -- duplicate_visible = { + -- fg = { attribute = "fg", highlight = "TabLine" }, + -- bg = { attribute = "bg", highlight = "TabLine" }, + -- underline = true, + -- }, + -- duplicate = { + -- fg = { attribute = "fg", highlight = "TabLine" }, + -- bg = { attribute = "bg", highlight = "TabLine" }, + -- underline = true, + -- }, + -- + -- modified = { + -- fg = { attribute = "fg", highlight = "TabLine" }, + -- bg = { attribute = "bg", highlight = "TabLine" }, + -- }, + -- modified_selected = { + -- fg = { attribute = "fg", highlight = "Normal" }, + -- bg = { attribute = "bg", highlight = "Normal" }, + -- }, + -- modified_visible = { + -- fg = { attribute = "fg", highlight = "TabLine" }, + -- bg = { attribute = "bg", highlight = "TabLine" }, + -- }, + -- + -- separator = { + -- fg = { attribute = "bg", highlight = "TabLine" }, + -- bg = { attribute = "bg", highlight = "TabLine" }, + -- }, + -- separator_selected = { + -- fg = { attribute = "bg", highlight = "Normal" }, + -- bg = { attribute = "bg", highlight = "Normal" }, + -- }, + -- indicator_selected = { + -- fg = { attribute = "fg", highlight = "LspDiagnosticsDefaultHint" }, + -- bg = { attribute = "bg", highlight = "Normal" }, + -- }, + -- }, + -- }) + -- end, } diff --git a/lua/plugins/colorscheme.lua b/lua/plugins/colorscheme.lua index 15df007..d8938bf 100644 --- a/lua/plugins/colorscheme.lua +++ b/lua/plugins/colorscheme.lua @@ -372,6 +372,7 @@ return { NvimTreeNormal = { fg = "$fg", bg = "$bg0" }, NvimTreeIndentMarker = { fg = "#3E4450" }, IblIndent = { fg = "#3E4450" }, + NvimTreeFolderIcon = { bg = "NONE", fg = "$blue" }, ["@markup.link.url"] = { fg = "$cyan", fmt = "italic" }, ["@text.uri"] = { fg = "$cyan", fmt = "none" }, ["@tag.delimiter"] = { fg = "$gray" }, diff --git a/lua/user/bufferline.lua b/lua/user/bufferline.lua index 0b21003..8cd28b1 100644 --- a/lua/user/bufferline.lua +++ b/lua/user/bufferline.lua @@ -6,6 +6,12 @@ end local icons = require("user.icons") local use_icons = true +-- get folder name from current directory +local _get_folder_name = function() + local str = vim.fn.fnamemodify(vim.fn.getcwd(), ":t") + return " 󱧶 " .. str:lower():gsub("^%l", string.upper) .. " " +end + local function diagnostics_indicator(num, _, diagnostics, _) local result = {} local symbols = { @@ -58,14 +64,14 @@ bufferline.setup({ offsets = { { filetype = "NvimTree", - text = "Explorer", + text = _get_folder_name(), highlight = "Directory", text_align = "left", padding = 1, }, { filetype = "neo-tree", - text = "Explorer", + text = _get_folder_name(), highlight = "Directory", text_align = "left", padding = 1, diff --git a/lua/user/nvim-tree.lua b/lua/user/nvim-tree.lua index 328dd30..a297025 100644 --- a/lua/user/nvim-tree.lua +++ b/lua/user/nvim-tree.lua @@ -103,7 +103,8 @@ nvim_tree.setup({ args = {}, }, renderer = { - root_folder_modifier = ":t", + -- root_folder_modifier = ":t", + root_folder_label = false, indent_markers = { enable = true, inline_arrows = true,