Files
lux/modules/capabilities/neovim/lua-config/lua/plugins/ui.lua
T

121 lines
3.2 KiB
Lua

require("lz.n").load({
{
"lualine.nvim",
event = "VimEnter",
after = function()
local navic = require("nvim-navic")
local breadcrumb = function()
if not navic.is_available() then
return ""
end
local location = navic.get_location()
if vim.fn.strdisplaywidth(location) <= 60 then
return location
end
while vim.fn.strdisplaywidth(location) > 59 do
location = vim.fn.strcharpart(location, 0, vim.fn.strchars(location) - 1)
end
return location .. "…"
end
require("lualine").setup({
options = {
theme = "auto",
component_separators = "",
section_separators = "",
globalstatus = true,
},
sections = {
lualine_a = { "mode" },
lualine_b = { "branch" },
lualine_c = { { "filename", path = 1 }, breadcrumb },
lualine_x = {
{ "kulala", icon = "HTTP" },
{
"db_ui#statusline",
type = "vim_fun",
cond = function()
return vim.fn.exists("*db_ui#statusline") == 1
end,
},
"diagnostics",
},
lualine_y = { "filetype" },
lualine_z = { "location" },
},
})
end,
},
{
"gitsigns.nvim",
event = { "BufReadPre", "BufNewFile" },
after = function()
require("gitsigns").setup({
signs = {
add = { text = "│" },
change = { text = "│" },
delete = { text = "_" },
topdelete = { text = "‾" },
},
on_attach = function(bufnr)
local gs = require("gitsigns")
local map_hunk = function(lhs, direction, desc)
vim.keymap.set("n", lhs, function()
if vim.wo.diff then
return lhs
end
vim.schedule(function()
gs.nav_hunk(direction)
end)
return "<Ignore>"
end, { buffer = bufnr, desc = desc, expr = true })
end
map_hunk("]h", "next", "Next git hunk")
map_hunk("[h", "prev", "Previous git hunk")
end,
})
end,
},
{
"zen-mode.nvim",
cmd = "ZenMode",
keys = {
{ "<leader>uz", "<cmd>ZenMode<cr>", desc = "Toggle zen mode" },
},
after = function()
require("zen-mode").setup({})
end,
},
{
"render-markdown.nvim",
ft = "markdown",
keys = {
{ "<leader>um", "<cmd>RenderMarkdown buf_toggle<cr>", desc = "Toggle Markdown rendering" },
},
after = function()
require("render-markdown").setup({})
end,
},
{
"which-key.nvim",
event = "VimEnter",
after = function()
require("which-key").setup({
preset = "helix",
spec = {
{ "<leader>b", group = "Buffers" },
{ "<leader>c", group = "Code" },
{ "<leader>d", group = "Diagnostics" },
{ "<leader>n", group = "Notes" },
{ "<leader>q", group = "Database" },
{ "<leader>r", group = "HTTP" },
{ "<leader>s", group = "Search" },
{ "<leader>u", group = "UI" },
},
})
end,
},
})