Files
dotfiles/config/nvim-old/lua/plugins/ui.lua
T

309 lines
12 KiB
Lua

return {
{ 'j-hui/fidget.nvim', lazy = true },
{
"utilyre/barbecue.nvim",
dependencies = {
{ 'SmiteshP/nvim-navic', lazy = true },
},
event = "VeryLazy",
opts = {},
},
{
"folke/flash.nvim",
event = "VeryLazy",
---@type Flash.Config
opts = {
modes = {
char = {
jump_labels = true,
search = { wrap = true },
highlight = { backdrop = false },
},
search = {
-- when `true`, flash will be activated during regular search by default.
-- You can always toggle when searching with `require("flash").toggle()`
enabled = true,
highlight = { backdrop = false },
jump = { history = true, register = true, nohlsearch = true, autojump = true },
search = {
wrap = true,
-- `forward` will be automatically set to the search direction
-- `mode` is always set to `search`
-- `incremental` is set to `true` when `incsearch` is enabled
},
},
treesitter = {
search = { wrap = true },
}
},
},
-- stylua: ignore
keys = {
{ "<leader>/", mode = { "n" }, function() require("flash").treesitter() end, desc = "Flash Treesitter" },
{ "s", mode = { "x", "o" }, function() require("flash").treesitter() end, desc = "Flash Treesitter" },
{ "r", mode = "o", function() require("flash").remote() end, desc = "Remote Flash" },
{ "R", mode = { "o", "x" }, function() require("flash").treesitter_search() end, desc = "Treesitter Search" },
{ "<c-s>", mode = { "c" }, function() require("flash").toggle() end, desc = "Toggle Flash Search" },
},
},
{
"folke/snacks.nvim",
opts = {
notifier = {
timeout = 4000,
},
picker = {
win = {
input = {
keys = {
["<a-s>"] = { "flash", mode = { "n", "i" } },
["s"] = { "flash" },
},
},
},
actions = {
flash = function(picker)
require("flash").jump({
pattern = "^",
label = { after = { 0, 0 } },
search = {
mode = "search",
exclude = {
function(win)
return vim.bo[vim.api.nvim_win_get_buf(win)].filetype ~= "snacks_picker_list"
end,
},
},
action = function(match)
local idx = picker.list:row2idx(match.pos[1])
picker.list:_move(idx, true, true)
end,
})
end,
},
},
},
},
{
'nvim-lualine/lualine.nvim',
event = "VeryLazy",
config = function()
local function truncate_branch_name(branch)
if not branch or branch == "" then
return ""
end
-- Match the branch name to the specified format
local _, _, ticket_number = string.find(branch, "skdillon/sko%-(%d+)%-")
-- If the branch name matches the format, display sko-{ticket_number}, otherwise display the full branch name
if ticket_number then
return "sko-" .. ticket_number
else
return branch
end
end
require("lualine").setup({
options = {
-- theme = "rose-pine",
globalstatus = true,
-- component_separators = { left = "", right = "" },
-- section_separators = { left = "█", right = "█" },
icons_enabled = true,
component_separators = { left = '', right = ''},
section_separators = { left = '', right = ''},
tabline = {
lualine_a = {},
lualine_b = {'branch'},
lualine_c = {'filename'},
lualine_x = {},
lualine_y = {},
lualine_z = {}
},
},
sections = {
lualine_b = {
{ "branch", icon = "", fmt = truncate_branch_name },
"diff",
"diagnostics",
},
lualine_c = {
{ 'lsp_progress' },
{
'buffers',
show_filename_only = true, -- Shows shortened relative path when set to false.
hide_filename_extension = false, -- Hide filename extension when set to true.
show_modified_status = true, -- Shows indicator when the buffer is modified.
mode = 0,
max_length = vim.o.columns * 2 / 3,
filetype_names = {
TelescopePrompt = ' ',
},
-- it can also be a function that returns
-- the value of `max_length` dynamically.
use_mode_colors = false,
symbols = {
modified = ' ●', -- Text to show when the buffer is modified
alternate_file = '#', -- Text to show to identify the alternate file
directory = '', -- Text to show when the buffer is a directory
},
},
},
lualine_x = {
"windows",
"fileformat",
"filetype",
},
},
})
end,
},
{
"hedyhli/outline.nvim",
lazy = true,
cmd = { "Outline", "OutlineOpen" },
keys = { -- Example mapping to toggle outline
{ "<leader>so", "<cmd>Outline<CR>", desc = "Toggle outline" },
},
opts = {
symbol_folding = {
-- Unfold entire symbol tree by default with false, otherwise enter a
-- number starting from 1
autofold_depth = false,
-- autofold_depth = 1,
},
},
},
{
'stevearc/quicker.nvim',
ft = "qf",
opts = {},
},
{
"christoomey/vim-tmux-navigator",
cmd = {
"TmuxNavigateLeft",
"TmuxNavigateDown",
"TmuxNavigateUp",
"TmuxNavigateRight",
"TmuxNavigatePrevious",
},
keys = {
{ "<c-h>", "<cmd><C-U>TmuxNavigateLeft<cr>" },
{ "<c-j>", "<cmd><C-U>TmuxNavigateDown<cr>" },
{ "<c-k>", "<cmd><C-U>TmuxNavigateUp<cr>" },
{ "<c-l>", "<cmd><C-U>TmuxNavigateRight<cr>" },
-- { "<c-\\>", "<cmd><C-U>TmuxNavigatePrevious<cr>" },
},
},
{
'akinsho/toggleterm.nvim',
lazy = false,
config = function()
require("toggleterm").setup({
-- highlights = require("rose-pine.plugins.toggleterm"),
size = 20,
open_mapping = [[<c-\>]],
hide_numbers = true,
shade_terminals = true,
shading_factor = 2,
start_in_insert = true,
insert_mappings = true,
persiste_size = true,
direction = 'horizontal',
close_on_exit = true,
float_opts = {
border = "curved",
}
})
end,
keys = {
{ "<Esc><Esc>", "<c-\\><c-n>", desc = "Escape input", mode = { "t" } }
},
},
{
'ten3roberts/window-picker.nvim',
opts = {
-- Default keys to annotate, keys will be used in order. The default uses the
-- most accessible keys from the home row and then top row.
keys = 'alskdjfhgwoeiruty',
-- Swap windows by holding shift + letter
swap_shift = true,
-- Windows containing filetype to exclude
exclude = { qf = true, NvimTree = true, aerial = true },
-- Flash the cursor line of the newly focused window for 300ms.
-- Set to 0 or false to disable.
flash_duration = 300,
},
keys = {
{ "<leader>a", "<cmd>WindowPick<cr>", desc = "Windows Pick"},
{ "<C-w>a", "<cmd>WindowPick<cr>", desc = "Windows Pick"},
{ "<C-w>D", "<cmd>WindowZap<cr>", desc = "Windows Delete"},
{ "<C-w>S", "<cmd>WindowSwap<cr>", desc = "Windows Swap"},
},
},
{
"folke/which-key.nvim",
event = "VimEnter",
opts = {
icons = {
-- set icon mappings to true if you have a Nerd Font
mappings = vim.g.have_nerd_font,
-- If you are using a Nerd Font: set icons.keys to an empty table which will use the
-- default whick-key.nvim defined Nerd Font icons, otherwise define a string table
keys = vim.g.have_nerd_font and {} or {
Up = '<Up> ',
Down = '<Down> ',
Left = '<Left> ',
Right = '<Right> ',
C = '<C-…> ',
M = '<M-…> ',
D = '<D-…> ',
S = '<S-…> ',
CR = '<CR> ',
Esc = '<Esc> ',
ScrollWheelDown = '<ScrollWheelDown> ',
ScrollWheelUp = '<ScrollWheelUp> ',
NL = '<NL> ',
BS = '<BS> ',
Space = '<Space> ',
Tab = '<Tab> ',
F1 = '<F1>',
F2 = '<F2>',
F3 = '<F3>',
F4 = '<F4>',
F5 = '<F5>',
F6 = '<F6>',
F7 = '<F7>',
F8 = '<F8>',
F9 = '<F9>',
F10 = '<F10>',
F11 = '<F11>',
F12 = '<F12>',
},
},
spec = {
{ "g", group = "+goto" },
{ "]", group = "+next" },
{ "[", group = "+prev" },
{ "<leader>c", group = "+code", mode = { 'n', 'x' } },
{ "<leader>b", group = "+buffer" },
{ "<leader>f", group = "+find" },
{ "<leader>g", group = "+goto" },
{ "<leader>k", group = "+obsidian" },
{ "<leader>l", group = "+lsp" },
{ "<leader>m", group = "+bookmark" },
{ "<leader>o", group = "+notes" },
{ "<leader>r", group = "+ai" },
{ "<leader>s", group = "+search" },
{ "<leader>t", group = "+trouble" },
{ "<leader>v", group = "+vcs", mode = { 'n', 'v' } },
{ "<leader>w", group = "+workspace" },
{ "<leader>x", group = "+extra" },
{ "<leader>u", group = "+toggle" },
},
},
},
}