diff --git a/lua/plugins/misc.lua b/lua/plugins/misc.lua index a4c6ace..5e9443d 100644 --- a/lua/plugins/misc.lua +++ b/lua/plugins/misc.lua @@ -1,8 +1,65 @@ return { { 'jghauser/mkdir.nvim', lazy = false }, { - 'glepnir/dbsession.nvim', - cmd = { 'SessionSave', 'SessionDelete', 'SessionLoad' }, - opts = {}, - }, + "willothy/nvim-cokeline", + dependencies = { + "nvim-lua/plenary.nvim", -- Required for v0.4.0+ + "nvim-tree/nvim-web-devicons", -- If you want devicons + { + "stevearc/resession.nvim", + config = function() + local resession = require("resession") + resession.setup() + -- Resession does NOTHING automagically, so we have to set up some keymaps + vim.keymap.set("n", "ss", resession.save) + vim.keymap.set("n", "sl", resession.load) + vim.keymap.set("n", "sd", resession.delete) + end + } -- Optional, for persistent history + }, + event = "VeryLazy", + keys = { + { 'gp', "(cokeline-focus-prev)", desc = 'next buffer' }, + { 'gn', "(cokeline-focus-next)", desc = 'next buffer' }, + }, + -- opts = {}, + config = function() + local get_hex = require('cokeline.hlgroups').get_hl_attr + + require('cokeline').setup({ + default_hl = { + fg = function(buffer) + return + buffer.is_focused + and get_hex('Normal', 'fg') + or get_hex('Comment', 'fg') + end, + bg = 'NONE', + }, + components = { + { + text = function(buffer) return (buffer.index ~= 1) and '▏' or '' end, + fg = function() return get_hex('Normal', 'fg') end + }, + { + text = function(buffer) return ' ' .. buffer.devicon.icon end, + fg = function(buffer) return buffer.devicon.color end, + }, + { + text = function(buffer) return buffer.filename .. ' ' end, + bold = function(buffer) return buffer.is_focused end + }, + { + text = '󰖭', + on_click = function(_, _, _, _, buffer) + buffer:delete() + end + }, + { + text = ' ', + }, + }, + }) + end + } } diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter.lua index 0c956ad..49a7e19 100644 --- a/lua/plugins/treesitter.lua +++ b/lua/plugins/treesitter.lua @@ -5,7 +5,7 @@ return { -- dependencies = 'windwp/nvim-ts-autotag', event = 'VeryLazy', keys = { - { 's', desc = 'start incremental selection' }, + { 'v', desc = 'start incremental selection' }, { 'h', 'TSBufToggle highlight', desc = 'toggle TS highlight' }, }, -- init = function(plugin) diff --git a/lua/plugins/ui.lua b/lua/plugins/ui.lua index fdc50ef..ca05594 100644 --- a/lua/plugins/ui.lua +++ b/lua/plugins/ui.lua @@ -149,20 +149,4 @@ return { hooks.register(hooks.type.SCOPE_HIGHLIGHT, hooks.builtin.scope_highlight_from_extmark) end }, - { - 'akinsho/bufferline.nvim', - version = "*", - dependencies = 'nvim-tree/nvim-web-devicons', - event = "VeryLazy", - opts = { - options = { - hover = { - enabled = true, - delay = 10, - reveal = { 'close' } - } - } - - } - } } diff --git a/lua/plugins/buffer_manager.lua b/lua/plugins/unused/buffer_manager.lua.bak similarity index 100% rename from lua/plugins/buffer_manager.lua rename to lua/plugins/unused/buffer_manager.lua.bak