From a7eb6600c4b633df791bb1df3e1a35f26fd22a84 Mon Sep 17 00:00:00 2001 From: Kyren223 Date: Fri, 25 Apr 2025 00:09:04 +0300 Subject: [PATCH] Added snacks terminal although I don't like it, I tried in the past some terminal plugins and I found them very lacking, I'll do more research tmr --- .config/nvim/lua/plugins/edgy.lua | 38 ++++++++++++----------------- .config/nvim/lua/plugins/snacks.lua | 24 +++++++++++++++++- 2 files changed, 38 insertions(+), 24 deletions(-) diff --git a/.config/nvim/lua/plugins/edgy.lua b/.config/nvim/lua/plugins/edgy.lua index 872247f..f84d0ba 100644 --- a/.config/nvim/lua/plugins/edgy.lua +++ b/.config/nvim/lua/plugins/edgy.lua @@ -1,28 +1,20 @@ return { 'folke/edgy.nvim', event = 'VeryLazy', - opts = { - bottom = { - 'Trouble', - { ft = 'qf', title = 'QuickFix' }, - { - ft = 'help', - size = { height = 20 }, - filter = function(buf) -- only show help buffers - return vim.bo[buf].buftype == 'help' + opts = function(_, opts) + for _, pos in ipairs({ 'top', 'bottom', 'left', 'right' }) do + opts[pos] = opts[pos] or {} + table.insert(opts[pos], { + ft = 'snacks_terminal', + size = { height = 0.4 }, + title = '%{b:snacks_terminal.id}: %{b:term_title}', + filter = function(_buf, win) + return vim.w[win].snacks_win + and vim.w[win].snacks_win.position == pos + and vim.w[win].snacks_win.relative == 'editor' + and not vim.w[win].trouble_preview end, - }, - { ft = 'spectre_panel', size = { height = 0.4 } }, - }, - left = { - { - title = 'Neo-Tree', - ft = 'neo-tree', - filter = function(buf) - return vim.b[buf].neo_tree_source == 'filesystem' - end, - size = { height = 0.5 }, - }, - }, - }, + }) + end + end, } diff --git a/.config/nvim/lua/plugins/snacks.lua b/.config/nvim/lua/plugins/snacks.lua index b86fafe..c64648f 100644 --- a/.config/nvim/lua/plugins/snacks.lua +++ b/.config/nvim/lua/plugins/snacks.lua @@ -54,6 +54,13 @@ return { }, }, }, + -- scroll = { + -- animate = { + -- duration = { step = 15, total = 50 }, + -- easing = 'linear', + -- }, + -- }, + terminal = {}, }, keys = { { @@ -229,7 +236,22 @@ return { function() Snacks.scratch.select() end, - desc = 'Select Scratch Buffer', + desc = 'Select [S]cratch Buffer', + }, + + { + 'nt', + function() + Snacks.terminal.open() + end, + desc = '[N]ew [T]erminal', + }, + { + 'T', + function() + Snacks.terminal.toggle() + end, + desc = 'Toggle [T]erminal', }, }, }