Commit Graph

47 Commits

Author SHA1 Message Date
QQ 25ea356161 refactor: dynamic keymap registration from config.commands
Replace hardcoded reasonix/lazygit keymap blocks with a single
loop over config.commands. Adding a new tool (e.g. codex) now only
requires two lines in user config:

  commands = { codex = 'codex' },
  keymaps  = { codex = { 'n', '<leader>cx' } },

Commands can be strings or functions for lazy evaluation.
2026-06-17 15:44:16 +08:00
QQ 718ce9036f fix: detect buffer mismatch on toggle (e.g. :e opened file over terminal)
When terminal occupies main window and user directly opens a file
(:e somefile) in that window, the window's buffer no longer matches
term.bufnr. Previously this caused the hide path to incorrectly swap
back original_bufnr, wiping the user's file. Now we detect mismatch,
clear winid/borrowed, and re-evaluate use_main — which will correctly
fall through to a split when a real file is present.
2026-06-17 15:21:53 +08:00
QQ 81d623c5c0 feat: occupy main window when no file is open
When Neovim is launched without a file (empty unnamed buffer),
QQdock now reuses the current window instead of creating a split.
Toggle hide swaps back to the original empty buffer.

Detection: buffer name is empty, buftype empty, not modified.
Cache tracks borrowed flag and original_bufnr for restore.
2026-06-17 15:17:01 +08:00
QQ ae1d2146c6 fix: replace toggleterm split with native rightbelow terminal
Root cause: toggleterm uses botright split (tabpage-level) and
find_open_windows() jumps to existing terminals across tabpages,
destroying window layouts. persist_size=false in Terminal opts was
never consumed by toggleterm's ui.get_size().

Changes:
- Replace toggleterm Terminal cache with own {bufnr, winid, job_id, cmd}
- Use rightbelow {size}split/vsplit (current-window-local)
- Three-path open: hide (close win), restore (assign buf to new split), create
- winfixwidth/winfixheight to protect terminal window size
- bufhidden=hide to keep process alive on window close
- <C-\><C-\> hide keymap on terminal buffers
- config.debug flag for layout diagnostics
- pcall toggleterm setup(persist_size=false) as safety net
2026-06-17 15:10:34 +08:00
QQ a3dfc7e01c update 2026-06-17 15:01:48 +08:00
QQ 0f036b6b58 feat: configurable keymaps + commands, README with examples 2026-06-11 21:13:58 +08:00
QQ a169b3139c fix: <C-\><C-\> toggles in ALL terminals, no Esc override needed 2026-06-11 21:07:21 +08:00
QQ a26dc1a51a fix: only bind Esc→normal in shell, not TUI programs (Reasonix/lazygit) 2026-06-11 21:01:03 +08:00
QQ 23984f2756 fix: map <Esc> to <C-\><C-n> in terminal buffers so Esc exits to normal mode 2026-06-11 20:56:56 +08:00
QQ 977384ccda fix: Terminal hidden=true — keep process alive across toggle 2026-06-11 20:53:27 +08:00
QQ bf7bd9fe42 fix: reuse terminal instance after hide (is_open returns false on toggle) 2026-06-11 20:09:25 +08:00
QQ 898ab9caaa feat: expose size config via M.setup({size={horizontal,vertical}}) 2026-06-11 20:00:05 +08:00
QQ 8981eebd1a fix: remove custom size, use toggleterm defaults 2026-06-11 19:55:09 +08:00
QQ 2611de78f2 init: QQdock.nvim — persistent adaptive terminal dock 2026-06-11 19:16:35 +08:00
github-actions[bot] ad055fa487 chore(doc): auto generate docs 2025-02-12 03:32:26 +00:00
glepnir 17e7b830d2
Merge pull request #4 from sh1nez/main
Fix file name
2025-02-12 11:32:07 +08:00
2happy d9c579601d fix file name 2025-02-12 00:33:15 +03:00
github-actions[bot] cc51672ded chore(doc): auto generate docs 2025-02-05 04:24:05 +00:00
glepnir b7ba151630 update 2025-02-05 12:23:46 +08:00
glepnir 5a5b349c31 update 2025-02-05 12:23:34 +08:00
github-actions[bot] a029d3a982 chore(doc): auto generate docs 2025-01-19 11:59:22 +00:00
glepnir 6af2c7463c update CI 2025-01-19 19:58:59 +08:00
github-actions[bot] 3db95f2ba7 chore(doc): auto generate docs 2024-12-16 05:09:15 +00:00
glepnir 51cbb2853e
Merge pull request #3 from lienzhuzhu/main
Corrects plugin/ removal in rename.py
2024-12-16 13:08:55 +08:00
Lien Zhu 904e1e5c6c Corrects plugin/ removal in rename.py 2024-12-15 17:45:58 -06:00
github-actions[bot] acfc1b8d91 chore(doc): auto generate docs 2024-08-27 10:36:42 +00:00
glepnir 7e016682c6 update ci 2024-08-27 18:36:17 +08:00
github-actions[bot] 20198fe3c3 chore(doc): auto generate docs 2024-06-08 05:35:50 +00:00
glepnir 2192aa6753 better script file 2024-06-08 13:35:22 +08:00
github-actions[bot] ab08be3530 chore(doc): auto generate docs 2024-05-28 05:48:43 +00:00
glepnir f2c0102af8
Merge pull request #1 from jam1015/patch-1
Update README.md for grammar/clarity
2024-05-28 13:48:19 +08:00
Jordan Mandel 6ceea579b9
Update README.md 2024-05-27 21:21:48 -04:00
Jordan Mandel 8c95941003
Update README.md for grammar/clarity
Glad this template exists, just wanted to improve the README
2024-05-27 21:17:25 -04:00
github-actions[bot] e47c235aa4 chore(doc): auto generate docs 2023-08-05 08:33:38 +00:00
mathew 380da6a3e5 fix rename.py 2023-08-05 16:33:14 +08:00
github-actions[bot] 41add0f7d1 chore(doc): auto generate docs 2023-06-18 06:39:11 +00:00
mathew ab9a28a3e1 improve script and add example codes 2023-06-18 14:38:43 +08:00
github-actions[bot] aeb066f1f4 chore(doc): auto generate docs 2023-06-16 08:22:43 +00:00
mathew bfa7836cdb update for test 2023-06-16 16:22:17 +08:00
github-actions[bot] 8b4b4acfd8 chore(doc): auto generate docs 2023-06-16 08:18:59 +00:00
mathew ba6cb491d2 update for test 2023-06-16 16:18:29 +08:00
mathew 2983d96fb8 update 2023-06-16 16:13:19 +08:00
github-actions[bot] 1a39327bbf chore(doc): auto generate docs 2023-06-16 08:13:11 +00:00
mathew 51c571835c update 2023-06-16 16:12:35 +08:00
github-actions[bot] cf56ef533a chore(doc): auto generate docs 2023-06-16 08:11:16 +00:00
mathew df1565e80c update 2023-06-16 16:10:41 +08:00
Raphael fbb9b1248d
Initial commit 2023-06-16 15:04:43 +08:00