From 93650204df1fca1da9028c2a1fe6568481256a9c Mon Sep 17 00:00:00 2001 From: newbieQQ Date: Thu, 11 Jun 2026 19:52:07 +0800 Subject: [PATCH] switch QQdock from local module to lazy spec --- lua/QQdock/init.lua | 37 ------------------------------------- lua/keymap.lua | 9 --------- lua/plugs.lua | 4 +--- 3 files changed, 1 insertion(+), 49 deletions(-) delete mode 100644 lua/QQdock/init.lua diff --git a/lua/QQdock/init.lua b/lua/QQdock/init.lua deleted file mode 100644 index 9510918..0000000 --- a/lua/QQdock/init.lua +++ /dev/null @@ -1,37 +0,0 @@ --- addons/QQdock.lua — 持久化自适应终端 --- --- 注意:这是 QQdock.nvim 插件的本地副本(根分区只读,无法通过 lazy 装远程插件) --- 远程仓库:https://git.qyhhh.top/newbie/QQdock.nvim --- --- 用法: --- local Q = require('addons.QQdock') --- Q.shell() -- 普通终端 --- Q.open('reasonix') -- Reasonix --- Q.open('lazygit') -- gg lazygit - -local M = {} - -local terms = {} - -function M.open(cmd) - local ui = vim.api.nvim_list_uis()[1] - if not ui then return end - local tall = ui.height > ui.width - local name = cmd or '__shell__' - - if not terms[name] or not terms[name]:is_open() then - terms[name] = require('toggleterm.terminal').Terminal:new({ - direction = tall and 'horizontal' or 'vertical', - cmd = cmd, - size = tall and math.floor(ui.height * 0.4) or math.floor(ui.width * 0.45), - }) - end - - terms[name]:toggle() -end - -function M.shell() - M.open(nil) -end - -return M diff --git a/lua/keymap.lua b/lua/keymap.lua index c3ed04b..8f30f02 100644 --- a/lua/keymap.lua +++ b/lua/keymap.lua @@ -38,12 +38,3 @@ G.map({ { 'n', '', ':vertical resize +5' }, }) --- 终端 / Reasonix / lazygit(QQdock.nvim:持久化 + 自适应分屏) --- TODO: 根分区恢复读写后改为 lazy spec 引用 git.qyhhh.top/newbie/QQdock.nvim,删本地 lua/QQdock/ -local Q = require('QQdock') -G.map({ - { 'n', '', Q.shell, { noremap = true } }, - { 'i', '', Q.shell, { noremap = true } }, - { 'n', '', function() Q.open('reasonix') end, { noremap = true } }, - { 'n', 'gg', function() Q.open('lazygit') end, { noremap = true } }, -}) diff --git a/lua/plugs.lua b/lua/plugs.lua index 8fed9e8..8665e53 100644 --- a/lua/plugs.lua +++ b/lua/plugs.lua @@ -9,7 +9,5 @@ return { require('plugs.theme'), require('plugs.edit-plugs'), require('plugs.dev'), - -- TODO: 根分区恢复读写后启用 ↓ - -- require('plugs.QQdock'), - -- 同时删 lua/QQdock/ 目录、删 keymap.lua 中的 QQdock 映射段 + require('plugs.QQdock'), }