slot.nvim/README.md

62 lines
1.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# QQdock.nvim
持久化自适应浮动终端管理器。
每次按 `<c-t>` 打开 shell聊完 Reasonix 按 `<C-i>` 隐藏,再按回来——对话还在。横屏自动右侧分屏,竖屏自动下方分屏。
## 安装
```lua
-- lazy.nvim
{
'newbie/QQdock.nvim',
dependencies = { 'akinsho/toggleterm.nvim' },
config = function()
-- QQdock 无全局配置,直接用
end,
}
```
## 用法
```lua
local Q = require('QQdock')
Q.shell() -- 普通 shell
Q.open('reasonix') -- Reasonix AI agent
Q.open('lazygit') -- lazygit
Q.open('btm') -- 系统监控
Q.open('yazi') -- 文件管理器
```
## 推荐键位
```lua
vim.keymap.set({ 'n', 'i' }, '<c-t>', Q.shell, { noremap = true })
vim.keymap.set('n', '<C-i>', function() Q.open('reasonix') end)
vim.keymap.set('n', '<leader>gg', function() Q.open('lazygit') end)
```
## API
| 函数 | 参数 | 作用 |
|------|------|------|
| `Q.shell()` | — | 打开/关闭持久 shell |
| `Q.open(cmd)` | cmd | 打开/关闭指定命令的持久终端 |
## 特性
- **持久化** — toggle 显隐,终端状态保留
- **自适应** — 横屏右侧 45%,竖屏下方 40%
- **轻量** — 仅依赖 toggleterm.nvim无其他依赖
## TODO
- [ ] 翻译trans
- [ ] 系统监控btop
- [ ] 文件管理器yazi
## 协议
MIT