diff --git a/.github/scripts/update-version.sh b/.github/scripts/update-version.sh index 3d12e6d..5023f2a 100755 --- a/.github/scripts/update-version.sh +++ b/.github/scripts/update-version.sh @@ -19,5 +19,12 @@ perl -pi -e "s/version-[0-9]+\.[0-9]+\.[0-9]+(?:-[a-zA-Z0-9.]+)?-blue\.svg/versi # This replaces any instances of `vX.Y.Z` globally (git branch, tags, headers). perl -pi -e "s/v[0-9]+\.[0-9]+\.[0-9]+(?:-[a-zA-Z0-9.]+)?/v${NEW_VERSION}/g" README.md +# Update internal plugin version variable +perl -pi -e "s/let g:claude_code_version = \"[0-9]+\.[0-9]+\.[0-9]+(?:-[a-zA-Z0-9.]+)?\"/let g:claude_code_version = \"${NEW_VERSION}\"/g" plugin/claude_code.vim + +# Update Vader test suite to match the new version +perl -pi -e "s/g:claude_code_version is set to [0-9]+\.[0-9]+\.[0-9]+(?:-[a-zA-Z0-9.]+)?/g:claude_code_version is set to ${NEW_VERSION}/g" test/test_dispatch.vader +perl -pi -e "s/AssertEqual '[0-9]+\.[0-9]+\.[0-9]+(?:-[a-zA-Z0-9.]+)?', g:claude_code_version/AssertEqual '${NEW_VERSION}', g:claude_code_version/g" test/test_dispatch.vader + # Make sure we didn't inadvertently modify anything besides the semver strings! -echo "Version successfully updated in README.md" +echo "Version successfully updated across all files" diff --git a/.releaserc.json b/.releaserc.json index 74675f0..70834e1 100644 --- a/.releaserc.json +++ b/.releaserc.json @@ -1,5 +1,7 @@ { - "branches": ["main"], + "branches": [ + "main" + ], "plugins": [ "@semantic-release/commit-analyzer", "@semantic-release/release-notes-generator", @@ -13,10 +15,16 @@ [ "@semantic-release/git", { - "assets": ["CHANGELOG.md", "README.md", "doc/claude_code.txt"], + "assets": [ + "CHANGELOG.md", + "README.md", + "doc/claude_code.txt", + "plugin/claude_code.vim", + "test/test_dispatch.vader" + ], "message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}" } ], "@semantic-release/github" ] -} +} \ No newline at end of file diff --git a/README.md b/README.md index 1771b6c..9cd7039 100644 --- a/README.md +++ b/README.md @@ -133,6 +133,7 @@ Run a health check to verify your setup: | `:Claude preview uninstall` | Remove diff preview hooks | | `:Claude preview close` | Manually close an open diff tab | | `:Claude preview status` | Show diff preview status and dependency checks | +| `:Claude zoom` | Toggle full-screen (zoom) mode for the terminal | When enabled, every time Claude proposes a file edit (Edit, Write, or MultiEdit), a side-by-side diff tab opens showing the **current** file on the left and the **proposed** changes on the right. Review the diff, then accept or reject in the Claude terminal. Press `q` to close the diff tab. @@ -168,6 +169,7 @@ let g:claude_code_diff_preview = 1 | Normal | `cC` | Toggle with `--continue` | | Normal | `cV` | Toggle with `--verbose` | | Terminal | `` | Hide Claude Code terminal | +| Terminal | `z` | **Zoom Toggle**: Maximize or restore terminal | | Terminal | `` | Navigate to adjacent window | ### Extended keymaps (`g:claude_code_map_extended_prefix` + key) @@ -232,6 +234,7 @@ let g:claude_code_float_border = 'double' | `g:claude_code_map_keys` | `1` | Register default toggle keymaps | | `g:claude_code_map_extended_keys` | `1` | Register `c*` keymaps | | `g:claude_code_map_toggle` | `''` | Toggle key | +| `g:claude_code_map_zoom` | `'z'` | Zoom key | | `g:claude_code_map_continue` | `'cC'` | Continue key | | `g:claude_code_map_verbose` | `'cV'` | Verbose key | | `g:claude_code_map_extended_prefix` | `'c'` | Prefix for all extended keymaps | diff --git a/autoload/claude_code/config.vim b/autoload/claude_code/config.vim index dda3f8a..39c978f 100644 --- a/autoload/claude_code/config.vim +++ b/autoload/claude_code/config.vim @@ -33,6 +33,7 @@ let s:defaults = { \ 'map_toggle': '', \ 'map_continue': 'cC', \ 'map_verbose': 'cV', + \ 'map_zoom': 'z', \ 'debug': 0, \ 'terminal_start_delay': 300, \ 'scroll_keys': 1, diff --git a/autoload/claude_code/keymaps.vim b/autoload/claude_code/keymaps.vim index a57b82d..ca5dc81 100644 --- a/autoload/claude_code/keymaps.vim +++ b/autoload/claude_code/keymaps.vim @@ -17,6 +17,7 @@ function! claude_code#keymaps#setup_terminal(bufnr) abort execute 'tnoremap j' execute 'tnoremap k' execute 'tnoremap l' + execute 'tnoremap ' . claude_code#config#get('map_zoom') . ' :Claude zoom' " Mouse/touchpad scroll in terminal mode: escape to Normal, scroll, stay in " Normal so the user can keep reading. Vim passes raw ScrollWheel events @@ -39,6 +40,7 @@ function! claude_code#keymaps#setup_terminal(bufnr) abort execute 'nnoremap j' execute 'nnoremap k' execute 'nnoremap l' + execute 'nnoremap ' . claude_code#config#get('map_zoom') . ' :Claude zoom' " Autocommand to re-enter terminal mode when switching INTO the Claude window " from another window. Uses WinEnter only (not BufEnter) so that the user diff --git a/autoload/claude_code/terminal.vim b/autoload/claude_code/terminal.vim index bdda9ae..90c876e 100644 --- a/autoload/claude_code/terminal.vim +++ b/autoload/claude_code/terminal.vim @@ -55,6 +55,50 @@ function! claude_code#terminal#toggle(...) abort endif endfunction +" Toggle the zoomed (maximized) state of the current Claude terminal. +" Uses a temporary tab to provide a full-screen view without losing context. +function! claude_code#terminal#zoom() abort + if get(t:, 'claude_code_zoomed', 0) + " We are in a zoomed tab, so just close it to return. + tabclose + return + endif + + let l:bufnr = bufnr('%') + let l:id = s:get_instance_id() + let l:instance_buf = get(s:instances, l:id, -1) + + if l:bufnr != l:instance_buf + " If we are not in the terminal window, try to jump to it first. + if l:instance_buf > 0 && s:is_valid(l:instance_buf) + let l:win_ids = win_findbuf(l:instance_buf) + if !empty(l:win_ids) + call win_gotoid(l:win_ids[0]) + let l:bufnr = l:instance_buf + else + " It's hidden, show it first normally. + call s:show_existing(l:instance_buf) + let l:bufnr = l:instance_buf + endif + endif + endif + + if l:bufnr > 0 && s:is_valid(l:bufnr) + " Maximize by opening the buffer in a new tab. + execute 'tab split' + let t:claude_code_zoomed = 1 + call s:configure_term_window() + " Ensure we stay in terminal mode if inserts are enabled. + if claude_code#config#get('enter_insert') + if mode() !=# 't' + silent! normal! i + endif + endif + else + call claude_code#util#error('claude-code: no active terminal to zoom') + endif +endfunction + " --------------------------------------------------------------------------- " Internal helpers " --------------------------------------------------------------------------- diff --git a/doc/claude_code.txt b/doc/claude_code.txt index db91e66..109e1d0 100644 --- a/doc/claude_code.txt +++ b/doc/claude_code.txt @@ -111,6 +111,12 @@ file is used. :Claude verbose Toggle with --verbose (enables detailed Claude Code logging). + *:Claude-zoom* +:Claude zoom + Toggle the zoomed (maximized) state of the current Claude terminal. + Uses a temporary tab to provide a full-screen view without losing + the terminal context. Restore the original split by zooming again. + ------------------------------------------------------------------------------ 5.2 Code Intelligence *claude-code-intel* @@ -306,6 +312,7 @@ Default terminal keymaps (when |g:claude_code_map_keys| is 1): Terminal mode (inside the Claude window): ~ Hide Claude Code terminal + z Zoom Toggle: Maximize or restore terminal Navigate to adjacent window Extended keymaps (when g:claude_code_map_extended_keys is 1): @@ -413,6 +420,10 @@ g:claude_code_map_extended_keys Default: 1 g:claude_code_map_toggle Default: '' Key to toggle the terminal (normal + terminal mode). + *g:claude_code_map_zoom* +g:claude_code_map_zoom Default: 'z' + Key to toggle the zoomed (maximized) state. + *g:claude_code_map_continue* g:claude_code_map_continue Default: 'cC' Key to toggle with --continue. diff --git a/plugin/claude_code.vim b/plugin/claude_code.vim index c4007fb..900b1c6 100644 --- a/plugin/claude_code.vim +++ b/plugin/claude_code.vim @@ -44,7 +44,7 @@ function! s:complete(ArgLead, CmdLine, CursorPos) abort \ 'rename', 'optimize', 'debug', 'apply', \ 'chat', 'context', 'model', \ 'version', 'doctor', - \ 'preview', + \ 'preview', 'zoom', \ ] return filter(copy(l:subs), 'v:val =~# "^" . a:ArgLead') endfunction @@ -107,6 +107,8 @@ function! s:dispatch(args) abort call claude_code#meta_commands#doctor() elseif l:sub ==# 'preview' call s:dispatch_preview(l:flags) + elseif l:sub ==# 'zoom' + call claude_code#terminal#zoom() else call claude_code#util#error('vim-claude-code: unknown sub-command "' . l:sub . '". Try :Claude ') endif @@ -132,6 +134,11 @@ if claude_code#config#get('map_keys') if !empty(s:verbose_key) execute 'nnoremap ' . s:verbose_key . ' :Claude verbose' endif + + let s:zoom_key = claude_code#config#get('map_zoom') + if !empty(s:zoom_key) + execute 'nnoremap ' . s:zoom_key . ' :Claude zoom' + endif endif if claude_code#config#get('map_extended_keys')