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
Persistent adaptive terminal dock for Neovim.
每次按 `<c-t>` 打开 shell聊完 Reasonix 按 `<C-i>` 隐藏,再按回来——对话还在。横屏自动右侧分屏,竖屏自动下方分屏。
## 安装
```lua
-- lazy.nvim
{
'newbie/QQdock.nvim',
url = 'https://git.qyhhh.top/newbie/QQdock.nvim',
dependencies = { 'akinsho/toggleterm.nvim' },
config = function()
local Q = require('QQdock')
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)
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') -- 文件管理器
```
## API
| 函数 | 参数 | 作用 |
|------|------|------|
| `Q.shell()` | — | 打开/关闭持久 shell |
| `Q.open(cmd)` | cmd | 打开/关闭指定命令的持久终端 |
## 特性
- **持久化** — toggle 显隐,终端状态保留
- **自适应** — 横屏右侧 45%,竖屏下方 40%
- **轻量** — 仅依赖 toggleterm.nvim
## Development
### Run tests
```bash
luarocks test --local
# or
busted
```
## License
MIT