feat(nvim): Use toggleterm instead of floaterm

* Light scheme to rose-pine
This commit is contained in:
js0ny 2025-03-04 23:24:16 +00:00
parent 59cd198cfc
commit 5684ceaf0c
5 changed files with 66 additions and 35 deletions

View file

@ -1,3 +1,11 @@
local function get_highlight()
if vim.g.colors_name == "catppuccin" then
return require("catppuccin.groups.integrations.bufferline").get()
elseif vim.g.colors_name == "rose-pine" then
return require("rose-pine.plugins.bufferline")
end
end
return {
"akinsho/bufferline.nvim",
dependencies = "nvim-tree/nvim-web-devicons", -- 图标支持
@ -42,6 +50,6 @@ return {
},
separator_style = "thin",
},
highlights = require("catppuccin.groups.integrations.bufferline").get(),
highlights = get_highlight(),
},
}

View file

@ -19,7 +19,8 @@ local config = {
-- Disable sections and component separators
component_separators = { left = "", right = "" },
section_separators = { left = "", right = "" },
theme = "catppuccin",
-- theme = "catppuccin",
theme = vim.g.colors_name,
-- IDE-like Global Status
globalstaus = true,
},

View file

@ -0,0 +1,33 @@
local function get_highlight()
if vim.g.colors_name == "catppuccin" then
-- NOTE: This won't work since no integration is available
return require("catppuccin.groups.integrations.bufferline").get()
-- return require("rose-pine.plugins.toggleterm")
elseif vim.g.colors_name == "rose-pine" then
return require("rose-pine.plugins.toggleterm")
end
end
return {
"akinsho/toggleterm.nvim",
keys = {
{ "<leader>!", "<cmd>ToggleTerm direction=float<CR>", desc = "Toggle Terminal" },
{ "<leader>tf", "<cmd>ToggleTerm direction=float<CR>", desc = "Toggle Terminal" },
{ "<leader>tt", "<cmd>ToggleTerm<CR>", desc = "Spawn a float terminal" },
-- TODO: Implement lazygit
-- {
-- "<leader>gg",
-- "<cmd>lua _lazygit_toggle()<CR>",
-- -- require("toggleterm.terminal").Terminal:new({ cmd = "lazygit", hidden = true }),
-- desc = "Toggle LazyGit",
-- },
},
event = "ColorScheme",
opts = {
highlights = get_highlight(),
},
cmd = {
"ToggleTerm",
"LazyGit",
},
}