addet mousemode for hover to bufferline

This commit is contained in:
pika 2024-08-25 14:08:55 +02:00
parent ead9a06e79
commit 2fba1f0beb
4 changed files with 136 additions and 97 deletions

View file

@ -16,6 +16,7 @@ o.expandtab = true -- expand tab to spaces
o.autoindent = true -- copy indent from current line when starting new one o.autoindent = true -- copy indent from current line when starting new one
o.mouse = "a" o.mouse = "a"
o.mousemoveevent = true
o.wrap = false o.wrap = false
-- search settings -- search settings

View file

@ -4,13 +4,39 @@ return {
version = "*", version = "*",
opts = { opts = {
options = { options = {
show_buffer_icons = true, underline_indicator = true,
diagnostics = "nvim_lsp", 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" } }, offsets = { { filetype = "neo-tree", text = "File Explorer", highlight = "Directory" } },
buffers = { indicator = {
-- You can set buffer_mode to "list" or "tabbed" based on your preference. icon = "", -- this should be omitted if indicator style is not 'icon'
buffer_mode = "list", 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) config = function(_, opts)
@ -20,4 +46,3 @@ return {
vim.keymap.set("n", "<S-Tab>", "<cmd>BufferLineCyclePrev<CR>") vim.keymap.set("n", "<S-Tab>", "<cmd>BufferLineCyclePrev<CR>")
end, end,
} }

View file

@ -1,17 +1,17 @@
return{ return {
{ {
"nvimdev/dashboard-nvim", "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. lazy = false, -- As https://github.com/nvimdev/dashboard-nvim/pull/450, dashboard-nvim shouldn't be lazy-loaded to properly handle stdin.
opts = function() opts = function()
-- local logo = [[ -- 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 = { local opts = {
theme = "doom", theme = "doom",
hide = { hide = {
statusline = false, statusline = false,
}, },
config = { config = {
header = vim.split(logo, "\n"), header = vim.split(logo, "\n"),
center = { center = {
{ {
action = function() action = function()
require("telescope.builtin").find_files() require("telescope.builtin").find_files()
end, end,
desc = " Find File", desc = " Find File",
icon = " ", icon = " ",
key = "f" key = "f",
}, },
{ action = "ene | startinsert", desc = " New File", icon = " ", key = "n" }, { action = "ene | startinsert", desc = " New File", icon = " ", key = "n" },
{ {
action = function() action = function()
require("telescope.builtin").oldfiles() require("telescope.builtin").oldfiles()
end, end,
desc = " Recent Files", desc = " Recent Files",
icon = " ", icon = " ",
key = "r" key = "r",
}, },
{ {
action = function() action = function()
require("telescope.builtin").live_grep() require("telescope.builtin").live_grep()
end, end,
desc = " Find Text", desc = " Find Text",
icon = " ", icon = " ",
key = "g" key = "g",
}, },
{ {
action = function() action = function()
require("telescope.builtin").find_files({ cwd = vim.fn.stdpath("config") }) require("telescope.builtin").find_files({ cwd = vim.fn.stdpath("config") })
end, end,
desc = " Search Neovim files", desc = " Search Neovim files",
icon = " ", icon = " ",
key = "c" key = "c",
}, },
{ action = 'lua require("persistence").load()', desc = " Restore Session", icon = " ", key = "s" }, {
{ action = "LazyExtras", desc = " Lazy Extras", icon = " ", key = "x" }, action = 'lua require("persistence").load()',
{ action = "Lazy", desc = " Lazy", icon = "󰒲 ", key = "l" }, desc = " Restore Session",
{ action = function() vim.api.nvim_input("<cmd>qa<cr>") end, desc = " Quit", icon = " ", key = "q" }, icon = " ",
}, key = "s",
footer = function() },
local stats = require("lazy").stats() -- { action = "LazyExtras", desc = " Lazy Extras", icon = " ", key = "x" },
local ms = (math.floor(stats.startuptime * 100 + 0.5) / 100) { action = "Lazy", desc = " Lazy", icon = "󰒲 ", key = "l" },
return { "⚡ Neovim loaded " .. stats.loaded .. "/" .. stats.count .. " plugins in " .. ms .. "ms" } {
end, action = function()
}, vim.api.nvim_input("<cmd>qa<cr>")
} 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 for _, button in ipairs(opts.config.center) do
button.desc = button.desc .. string.rep(" ", 43 - #button.desc) button.desc = button.desc .. string.rep(" ", 43 - #button.desc)
button.key_format = " %s" button.key_format = " %s"
end end
-- open dashboard after closing lazy -- open dashboard after closing lazy
if vim.o.filetype == "lazy" then if vim.o.filetype == "lazy" then
vim.api.nvim_create_autocmd("WinClosed", { vim.api.nvim_create_autocmd("WinClosed", {
pattern = tostring(vim.api.nvim_get_current_win()), pattern = tostring(vim.api.nvim_get_current_win()),
once = true, once = true,
callback = function() callback = function()
vim.schedule(function() vim.schedule(function()
vim.api.nvim_exec_autocmds("UIEnter", { group = "dashboard" }) vim.api.nvim_exec_autocmds("UIEnter", { group = "dashboard" })
end) end)
end, end,
}) })
end end
return opts return opts
end, end,
}, dependencies = {
{ "folke/persistence.nvim",
"folke/persistence.nvim", event = "BufReadPre",
event = "BufReadPre", opts = {},
opts = {},
-- stylua: ignore -- stylua: ignore
keys = { keys = {
{ "<leader>qs", function() require("persistence").load() end, desc = "Restore Session" }, { "<leader>qs", function() require("persistence").load() end, desc = "Restore Session" },
@ -110,5 +123,6 @@ local opts = {
{ "<leader>qd", function() require("persistence").stop() end, desc = "Don't Save Current Session" }, { "<leader>qd", function() require("persistence").stop() end, desc = "Don't Save Current Session" },
{ "<leader>db", "<cmd>:Dashboard<CR>", desc = "Dashboard"} { "<leader>db", "<cmd>:Dashboard<CR>", desc = "Dashboard"}
}, },
} },
},
} }

View file

@ -16,7 +16,6 @@ return {
["<C-o>"] = "tab drop", ["<C-o>"] = "tab drop",
}, },
winblend = 10, -- psuedotransparency level winblend = 10, -- psuedotransparency level
dir = "", -- directory where `lf` starts ('gwd' is git-working-directory, ""/nil is CWD)
direction = "float", -- window type: float horizontal vertical direction = "float", -- window type: float horizontal vertical
border = "shadow", -- border kind: single double shadow curved border = "shadow", -- border kind: single double shadow curved
-- height = fn.float2nr(fn.round(0.75 * o.lines)), -- height of the *floating* window -- height = fn.float2nr(fn.round(0.75 * o.lines)), -- height of the *floating* window