From 2fba1f0bebc542751b045248ab8180ae9a832190 Mon Sep 17 00:00:00 2001 From: pika Date: Sun, 25 Aug 2024 14:08:55 +0200 Subject: [PATCH] addet mousemode for hover to bufferline --- lua/pika/core/options.lua | 1 + lua/pika/plugins/bufferline.lua | 35 +++++- lua/pika/plugins/dashboard.lua | 196 +++++++++++++++++--------------- lua/pika/plugins/lf.lua | 1 - 4 files changed, 136 insertions(+), 97 deletions(-) diff --git a/lua/pika/core/options.lua b/lua/pika/core/options.lua index f105ab1..15f178f 100644 --- a/lua/pika/core/options.lua +++ b/lua/pika/core/options.lua @@ -16,6 +16,7 @@ o.expandtab = true -- expand tab to spaces o.autoindent = true -- copy indent from current line when starting new one o.mouse = "a" +o.mousemoveevent = true o.wrap = false -- search settings diff --git a/lua/pika/plugins/bufferline.lua b/lua/pika/plugins/bufferline.lua index e4fa7dd..05550ac 100644 --- a/lua/pika/plugins/bufferline.lua +++ b/lua/pika/plugins/bufferline.lua @@ -4,13 +4,39 @@ return { version = "*", opts = { options = { - show_buffer_icons = true, + underline_indicator = true, diagnostics = "nvim_lsp", + diagnostics_update_on_event = true, -- use nvim's diagnostic handler + diagnostics_indicator = function(count, level) + local icon = level:match("error") and " " or "" + return " " .. icon .. count + end, offsets = { { filetype = "neo-tree", text = "File Explorer", highlight = "Directory" } }, - buffers = { - -- You can set buffer_mode to "list" or "tabbed" based on your preference. - buffer_mode = "list", + indicator = { + icon = "▎", -- this should be omitted if indicator style is not 'icon' + style = "icon", }, + move_wraps_at_ends = true, -- whether or not the move command "wraps" at the first or last position + separator_style = "slope", + modified_icon = "󱞇", + left_trunc_marker = "󰬩", + right_trunc_marker = "󰬫", + themable = true, -- allows highlight groups to be overriden i.e. sets highlights as default + close_icon = "󱄊", + buffer_close_icon = "󱄊", + show_buffer_icons = true, -- disable filetype icons for buffers + show_buffer_close_icons = true, + show_close_icon = true, + show_tab_indicators = true, + hover = { + enabled = true, + delay = 80, + reveal = { "close" }, + hide = { "nvim_lsp" }, + }, + -- You can set buffer_mode to "list" or "tabbed" based on your preference. + buffer_mode = "list", + color_icons = true, -- whether or not to add the filetype icon highlights }, }, config = function(_, opts) @@ -20,4 +46,3 @@ return { vim.keymap.set("n", "", "BufferLineCyclePrev") end, } - diff --git a/lua/pika/plugins/dashboard.lua b/lua/pika/plugins/dashboard.lua index 2d8640d..1646807 100644 --- a/lua/pika/plugins/dashboard.lua +++ b/lua/pika/plugins/dashboard.lua @@ -1,17 +1,17 @@ -return{ -{ - "nvimdev/dashboard-nvim", - lazy = false, -- As https://github.com/nvimdev/dashboard-nvim/pull/450, dashboard-nvim shouldn't be lazy-loaded to properly handle stdin. - opts = function() - -- local logo = [[ - -- ▐ ▄ ▄▄▄ . ▌ ▐·▪ • ▌ ▄ ·. - -- •█▌▐█▀▄.▀·▪ ▪█·█▌██ ·██ ▐███▪ - -- ▐█▐▐▌▐▀▀▪▄ ▄█▀▄ ▐█▐█•▐█·▐█ ▌▐▌▐█· - -- ██▐█▌▐█▄▄▌▐█▌.▐▌ ███ ▐█▌██ ██▌▐█▌ - -- ▀▀ █▪ ▀▀▀ ▀█▄▀▪. ▀ ▀▀▀▀▀ █▪▀▀▀ - -- ]] +return { + { + "nvimdev/dashboard-nvim", + lazy = false, -- As https://github.com/nvimdev/dashboard-nvim/pull/450, dashboard-nvim shouldn't be lazy-loaded to properly handle stdin. + opts = function() + -- local logo = [[ + -- ▐ ▄ ▄▄▄ . ▌ ▐·▪ • ▌ ▄ ·. + -- •█▌▐█▀▄.▀·▪ ▪█·█▌██ ·██ ▐███▪ + -- ▐█▐▐▌▐▀▀▪▄ ▄█▀▄ ▐█▐█•▐█·▐█ ▌▐▌▐█· + -- ██▐█▌▐█▄▄▌▐█▌.▐▌ ███ ▐█▌██ ██▌▐█▌ + -- ▀▀ █▪ ▀▀▀ ▀█▄▀▪. ▀ ▀▀▀▀▀ █▪▀▀▀ + -- ]] - local logo = [[ + local logo = [[  ████ ██████ █████ ██ ███████████ █████  @@ -22,87 +22,100 @@ return{ ██████ █████████████████████ ████ █████ █████ ████ ██████ ]] - logo = string.rep("\n", 8) .. logo .. "\n\n" + logo = string.rep("\n", 8) .. logo .. "\n\n" -local opts = { - theme = "doom", - hide = { - statusline = false, - }, - config = { - header = vim.split(logo, "\n"), - center = { - { - action = function() - require("telescope.builtin").find_files() - end, - desc = " Find File", - icon = " ", - key = "f" - }, - { action = "ene | startinsert", desc = " New File", icon = " ", key = "n" }, - { - action = function() - require("telescope.builtin").oldfiles() - end, - desc = " Recent Files", - icon = " ", - key = "r" - }, - { - action = function() - require("telescope.builtin").live_grep() - end, - desc = " Find Text", - icon = " ", - key = "g" - }, - { - action = function() - require("telescope.builtin").find_files({ cwd = vim.fn.stdpath("config") }) - end, - desc = " Search Neovim files", - icon = " ", - key = "c" - }, - { action = 'lua require("persistence").load()', desc = " Restore Session", icon = " ", key = "s" }, - { action = "LazyExtras", desc = " Lazy Extras", icon = " ", key = "x" }, - { action = "Lazy", desc = " Lazy", icon = "󰒲 ", key = "l" }, - { action = function() vim.api.nvim_input("qa") end, desc = " Quit", icon = " ", key = "q" }, - }, - footer = function() - local stats = require("lazy").stats() - local ms = (math.floor(stats.startuptime * 100 + 0.5) / 100) - return { "⚡ Neovim loaded " .. stats.loaded .. "/" .. stats.count .. " plugins in " .. ms .. "ms" } - end, - }, -} + local opts = { + theme = "doom", + hide = { + statusline = false, + }, + config = { + header = vim.split(logo, "\n"), + center = { + { + action = function() + require("telescope.builtin").find_files() + end, + desc = " Find File", + icon = " ", + key = "f", + }, + { action = "ene | startinsert", desc = " New File", icon = " ", key = "n" }, + { + action = function() + require("telescope.builtin").oldfiles() + end, + desc = " Recent Files", + icon = " ", + key = "r", + }, + { + action = function() + require("telescope.builtin").live_grep() + end, + desc = " Find Text", + icon = " ", + key = "g", + }, + { + action = function() + require("telescope.builtin").find_files({ cwd = vim.fn.stdpath("config") }) + end, + desc = " Search Neovim files", + icon = " ", + key = "c", + }, + { + action = 'lua require("persistence").load()', + desc = " Restore Session", + icon = " ", + key = "s", + }, + -- { action = "LazyExtras", desc = " Lazy Extras", icon = " ", key = "x" }, + { action = "Lazy", desc = " Lazy", icon = "󰒲 ", key = "l" }, + { + action = function() + vim.api.nvim_input("qa") + end, + desc = " Quit", + icon = " ", + key = "q", + }, + }, + footer = function() + local stats = require("lazy").stats() + local ms = (math.floor(stats.startuptime * 100 + 0.5) / 100) + return { + "⚡ Neovim loaded " .. stats.loaded .. "/" .. stats.count .. " plugins in " .. ms .. "ms", + } + end, + }, + } - for _, button in ipairs(opts.config.center) do - button.desc = button.desc .. string.rep(" ", 43 - #button.desc) - button.key_format = " %s" - end + for _, button in ipairs(opts.config.center) do + button.desc = button.desc .. string.rep(" ", 43 - #button.desc) + button.key_format = " %s" + end - -- open dashboard after closing lazy - if vim.o.filetype == "lazy" then - vim.api.nvim_create_autocmd("WinClosed", { - pattern = tostring(vim.api.nvim_get_current_win()), - once = true, - callback = function() - vim.schedule(function() - vim.api.nvim_exec_autocmds("UIEnter", { group = "dashboard" }) - end) - end, - }) - end + -- open dashboard after closing lazy + if vim.o.filetype == "lazy" then + vim.api.nvim_create_autocmd("WinClosed", { + pattern = tostring(vim.api.nvim_get_current_win()), + once = true, + callback = function() + vim.schedule(function() + vim.api.nvim_exec_autocmds("UIEnter", { group = "dashboard" }) + end) + end, + }) + end - return opts - end, -}, -{ - "folke/persistence.nvim", - event = "BufReadPre", - opts = {}, + return opts + end, + dependencies = { + "folke/persistence.nvim", + event = "BufReadPre", + opts = {}, -- stylua: ignore keys = { { "qs", function() require("persistence").load() end, desc = "Restore Session" }, @@ -110,5 +123,6 @@ local opts = { { "qd", function() require("persistence").stop() end, desc = "Don't Save Current Session" }, { "db", ":Dashboard", desc = "Dashboard"} }, -} + }, + }, } diff --git a/lua/pika/plugins/lf.lua b/lua/pika/plugins/lf.lua index 95cf162..e4ee215 100644 --- a/lua/pika/plugins/lf.lua +++ b/lua/pika/plugins/lf.lua @@ -16,7 +16,6 @@ return { [""] = "tab drop", }, winblend = 10, -- psuedotransparency level - dir = "", -- directory where `lf` starts ('gwd' is git-working-directory, ""/nil is CWD) direction = "float", -- window type: float horizontal vertical border = "shadow", -- border kind: single double shadow curved -- height = fn.float2nr(fn.round(0.75 * o.lines)), -- height of the *floating* window