Add coder/claudecode.nvim and improve terminal experience#71
Draft
Add coder/claudecode.nvim and improve terminal experience#71
Conversation
Add claudecode.nvim and its dependency snacks.nvim to the Neovim-only plugin section. Include Lua setup block after plug#end(). Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
ambiwidth=double causes E1512 error when snacks.nvim tries to set listchars with ambiguous-width Unicode characters. Modern terminals handle character widths correctly without this setting. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
- Disable line numbers in terminal buffers - Clear match highlights (trailing spaces, zenspace) on terminal enter - Disable indent guides in terminal buffers to fix grey background - Auto-enter insert mode when opening/entering terminal buffers Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Define TermNormal highlight group with no background color and apply it to terminal windows via winhighlight. This lets the terminal emulator's native background show through instead of desert colorscheme's grey. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Use ModeChanged autocmd to immediately re-enter insert mode when terminal mode switches to terminal-normal mode, effectively preventing normal mode in terminal buffers. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
clearmatches and IndentGuidesDisable were only triggered on TermOpen and BufEnter, so window resize (which fires WinEnter) allowed HighlightTrailingSpaces and indent guides to re-apply. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
- Re-define TermNormal on ColorScheme event to survive reloads - Re-apply winhighlight on BufEnter/WinEnter, not just TermOpen - Clear matches on VimResized for terminal buffers Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
winhighlight set by autocmd was being overridden by snacks.nvim's window configuration. Pass it through snacks_win_opts so snacks.nvim applies it natively. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
In Neovim terminal mode, C-w is sent to the terminal process by default. Add tnoremap mappings using <Cmd>wincmd to enable window navigation without leaving terminal mode. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
The t:nt ModeChanged autocmd caused rapid mode switching when scrolling with mouse. Removing it allows normal mode for scrolling while BufEnter auto-insert is still active. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Set unfocused-split-opacity to 1 so inactive panes are not dimmed. Active pane is still identifiable by cursor visibility. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
coder/claudecode.nvimと依存のfolke/snacks.nvimを追加詳細
プラグインの追加
.vimrcのhas('nvim')セクションにcoder/claudecode.nvimとfolke/snacks.nvimを追加plug#end()の後に Lua setup ブロックを追加(pcallでプラグイン未インストール時のエラー回避)ambiwidth=double の削除
ambiwidth=doubleがsnacks.nvimのlistchars設定でE1512: Wrong character width for field "extends"エラーを引き起こすため削除ambiwidth=doubleなしでも問題なく動作するターミナルバッファの表示改善
vim-zenspaceとHighlightTrailingSpacesによる全角空白・末尾空白のハイライトをターミナルバッファで無効化(clearmatches()をTermOpen/BufEnter/WinEnterで実行)vim-indent-guidesをターミナルバッファで無効化TermNormalハイライトグループをguibg=NONEで定義winhighlight設定はsnacks.nvimのウィンドウ設定に上書きされるため、snacks_win_opts.wo.winhighlight経由で設定する必要があったColorSchemeイベントとVimResizedイベントでも再適用してリサイズ時の表示崩れを防止ターミナルバッファの操作性改善
TermOpen/BufEnterで自動的に insert mode に入るよう設定<C-w>h/j/k/lでターミナルモードから直接ウィンドウ移動できるようtnoremapを追加<C-w>がターミナルプロセスに送信されるため、明示的なマッピングが必要<Cmd>wincmd<CR>を使うことでモード変更なしにウィンドウ操作を実行Ghostty設定
unfocused-split-opacity = 1で非アクティブpaneのdimを無効化注意点/ハマりどころ
snacks.nvimはambiwidth=doubleと互換性がない(listcharsのUnicode文字がエラーになる)winhighlightは autocmd で設定してもsnacks.nvimのウィンドウ作成時に上書きされる。claudecode.nvimのsnacks_win_opts.wo経由で渡す必要があるModeChanged t:ntによる normal mode 無効化はマウススクロール時にモードが高速で切り替わる問題を引き起こすため不採用としたTest plan
:PlugInstallでプラグインがインストールされることを確認:ClaudeCodeでClaude Codeターミナルが開くことを確認<C-w>hでターミナルから左のペインに移動できることを確認🤖 Generated with Claude Code