diff --git a/tools/nvim/lua/plugins/fileutils.lua b/tools/nvim/lua/plugins/fileutils.lua index b9e4232..3cac56d 100644 --- a/tools/nvim/lua/plugins/fileutils.lua +++ b/tools/nvim/lua/plugins/fileutils.lua @@ -25,24 +25,24 @@ return { dependencies = { "nvim-telescope/telescope.nvim" }, }, { import = "plugins.mod.hover-nvim" }, - { - "kdheepak/lazygit.nvim", - lazy = true, - cmd = { - "LazyGit", - "LazyGitConfig", - "LazyGitCurrentFile", - "LazyGitFilter", - "LazyGitFilterCurrentFile", - }, - -- optional for floating window border decoration - dependencies = { - "nvim-lua/plenary.nvim", - }, - -- setting the keybinding for LazyGit with 'keys' is recommended in - -- order to load the plugin when the command is run for the first time - keys = { - { "gg", "LazyGit", desc = "LazyGit" }, - }, - }, + -- { + -- "kdheepak/lazygit.nvim", + -- lazy = true, + -- cmd = { + -- "LazyGit", + -- "LazyGitConfig", + -- "LazyGitCurrentFile", + -- "LazyGitFilter", + -- "LazyGitFilterCurrentFile", + -- }, + -- -- optional for floating window border decoration + -- dependencies = { + -- "nvim-lua/plenary.nvim", + -- }, + -- -- setting the keybinding for LazyGit with 'keys' is recommended in + -- -- order to load the plugin when the command is run for the first time + -- keys = { + -- { "gg", "LazyGit", desc = "LazyGit" }, + -- }, + -- }, } diff --git a/tools/nvim/lua/plugins/misc.lua b/tools/nvim/lua/plugins/misc.lua index c4548c1..65714e5 100644 --- a/tools/nvim/lua/plugins/misc.lua +++ b/tools/nvim/lua/plugins/misc.lua @@ -1,17 +1,6 @@ return { - { "wakatime/vim-wakatime", lazy = false }, - { - "voldikss/vim-floaterm", - keys = { - { "!", ":FloatermToggle", desc = "Toggle Terminal" }, - { "tt", ":FloatermToggle", desc = "Toggle Terminal" }, - { "fT", ":FloatermNew", desc = "Spawn a float terminal" }, - }, - cmd = { - "FloatermToggle", - "FloatermNew", - }, - }, + { "wakatime/vim-wakatime", lazy = false }, + { import = "plugins.mod.toggleterm" }, { "CRAG666/code_runner.nvim", config = true, diff --git a/tools/nvim/lua/plugins/mod/bufferline.lua b/tools/nvim/lua/plugins/mod/bufferline.lua index e20c466..e6f5cfc 100644 --- a/tools/nvim/lua/plugins/mod/bufferline.lua +++ b/tools/nvim/lua/plugins/mod/bufferline.lua @@ -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(), }, } diff --git a/tools/nvim/lua/plugins/mod/lualine/init.lua b/tools/nvim/lua/plugins/mod/lualine/init.lua index 03fec6d..5944677 100644 --- a/tools/nvim/lua/plugins/mod/lualine/init.lua +++ b/tools/nvim/lua/plugins/mod/lualine/init.lua @@ -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, }, diff --git a/tools/nvim/lua/plugins/mod/toggleterm.lua b/tools/nvim/lua/plugins/mod/toggleterm.lua new file mode 100644 index 0000000..5b61c26 --- /dev/null +++ b/tools/nvim/lua/plugins/mod/toggleterm.lua @@ -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 = { + { "!", "ToggleTerm direction=float", desc = "Toggle Terminal" }, + { "tf", "ToggleTerm direction=float", desc = "Toggle Terminal" }, + { "tt", "ToggleTerm", desc = "Spawn a float terminal" }, + -- TODO: Implement lazygit + -- { + -- "gg", + -- "lua _lazygit_toggle()", + -- -- require("toggleterm.terminal").Terminal:new({ cmd = "lazygit", hidden = true }), + -- desc = "Toggle LazyGit", + -- }, + }, + event = "ColorScheme", + opts = { + highlights = get_highlight(), + }, + cmd = { + "ToggleTerm", + "LazyGit", + }, +}