feat(nvim): switch to coder/claudecode.nvim, document all keybinds
Replace greggh/claude-code.nvim (bare terminal wrapper) with coder/claudecode.nvim's native WebSocket bridge — inline diff review, buffer/selection context, model switching. Runs with terminal.provider = "native" to avoid pulling in snacks.nvim. New commands are bound under the previously-unused <leader>a prefix, so none of the existing single-key app toggles are disturbed. Move the alot floating-terminal toggle from bare "n" to "m", freeing "n" back to Vim's default repeat-search behavior. Document the full Neovim keybind set (window nav, app toggles, Claude Code, insert-mode completion, misc) in docs/md/editors.md — previously undocumented. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>main
parent
1faec197a7
commit
1135d22b39
|
|
@ -67,6 +67,12 @@ Config lives in `nvim/`. Deployed to `~/.config/nvim/` during `shell` module ins
|
|||
|--------|---------|
|
||||
| `the_miro/cyberqueer.nvim` | CyberQueer colour scheme (local) |
|
||||
|
||||
#### AI
|
||||
|
||||
| Plugin | Purpose |
|
||||
|--------|---------|
|
||||
| `coder/claudecode.nvim` | Native WebSocket bridge to the Claude Code CLI — inline diff review, buffer/selection context, model switching. Runs with `terminal.provider = "native"` (no `snacks.nvim` dependency). Replaces the older `greggh/claude-code.nvim` terminal-only wrapper. |
|
||||
|
||||
### CoC LSP Settings
|
||||
|
||||
`nvim/coc-settings.json` configures language servers for:
|
||||
|
|
@ -78,6 +84,72 @@ Config lives in `nvim/`. Deployed to `~/.config/nvim/` during `shell` module ins
|
|||
|
||||
`nvim/cyberqueer-airline.vim` — a custom vim-airline theme using the CyberQueer palette, providing hot-pink/violet segments in the status bar.
|
||||
|
||||
### Keybindings
|
||||
|
||||
All custom bindings live in `nvim/init.lua`. Leader is the Vim default (`\`), unchanged.
|
||||
|
||||
#### Window navigation
|
||||
|
||||
| Key | Mode | Action |
|
||||
|-----|------|--------|
|
||||
| `Ctrl+h` / `Ctrl+j` / `Ctrl+k` | Normal, Terminal | Move to the split left/below/above |
|
||||
| `Ctrl+l` | Normal, Terminal | Cycle to the next split (wraps) |
|
||||
|
||||
Also restored inside `calendar.vim` buffers, which otherwise steal `Ctrl+hjkl` for month navigation.
|
||||
|
||||
#### Quick app toggles (single key, normal mode)
|
||||
|
||||
| Key | Action |
|
||||
|-----|--------|
|
||||
| `t` | Open a new floating terminal (`vim-floaterm`) |
|
||||
| `e` | Toggle the NERDTree file-tree sidebar |
|
||||
| `s` | Toggle the `vim-dadbod-ui` database browser |
|
||||
| `q` | Save & quit; falls back to force-quit on unsaved/read-only buffers |
|
||||
| `m` | Toggle a centered floating `alot` (email) terminal |
|
||||
| `g` | Toggle a centered floating `khal interactive` (calendar) terminal |
|
||||
| `f` | Toggle a centered floating `abook` (contacts) terminal |
|
||||
| `x` | Toggle the sideward-T PIM overlay (`alot` + `abook` + `khal` panes at once) |
|
||||
|
||||
`m` was previously `n` — moved to free up `n` for its default Vim meaning (repeat last search).
|
||||
|
||||
#### Claude Code (`coder/claudecode.nvim`)
|
||||
|
||||
All under the `<leader>a` ("AI") prefix — a namespace that was otherwise completely unused, so nothing above was disturbed.
|
||||
|
||||
| Key | Mode | Action |
|
||||
|-----|------|--------|
|
||||
| `<leader>ac` | Normal | Toggle the Claude Code terminal |
|
||||
| `<leader>af` | Normal | Focus the Claude Code terminal |
|
||||
| `<leader>ar` | Normal | Resume the last Claude session (`--resume`) |
|
||||
| `<leader>aC` | Normal | Continue the last Claude session (`--continue`) |
|
||||
| `<leader>am` | Normal | Select the Claude model |
|
||||
| `<leader>ab` | Normal | Add the current buffer to Claude's context |
|
||||
| `<leader>as` | Visual | Send the selection to Claude as context |
|
||||
| `<leader>ay` | Normal | Accept the proposed diff |
|
||||
| `<leader>an` | Normal | Deny the proposed diff |
|
||||
| `<leader>aq` | Normal | Close all pending diffs |
|
||||
| `<leader>aS` | Normal | Show Claude connection status |
|
||||
|
||||
#### Insert mode
|
||||
|
||||
| Key | Action |
|
||||
|-----|--------|
|
||||
| `Tab` | Next completion entry (CoC popup menu if visible, else built-in keyword completion) |
|
||||
| `Shift+Tab` | Previous completion entry (CoC popup menu if visible, else literal tab) |
|
||||
| `Enter` | Confirm the CoC completion if the popup menu is visible |
|
||||
| `Ctrl+Tab` | Expand an UltiSnips snippet trigger |
|
||||
| `Ctrl+b` / `Ctrl+z` | Jump forward/backward through UltiSnips snippet placeholders |
|
||||
| `Ctrl+l` | Expand a CoC snippet |
|
||||
| `Ctrl+j` | Expand-and-jump a CoC snippet |
|
||||
|
||||
#### Other
|
||||
|
||||
| Key | Mode | Action |
|
||||
|-----|------|--------|
|
||||
| `<leader>x` | Visual/Select | Convert selection to a UltiSnips snippet (via CoC) |
|
||||
| `:Vb` | Command | Enter visual-block mode (alternative to `Ctrl+v`, which some terminals intercept) |
|
||||
| `:w!!` | Command | Save the current file through `sudo tee`, for read-only files |
|
||||
|
||||
---
|
||||
|
||||
## Micro
|
||||
|
|
|
|||
|
|
@ -50,12 +50,37 @@ require("lazy").setup({
|
|||
-- glow.nvim: render Markdown in a floating window via the `glow` CLI
|
||||
{ "ellisonleao/glow.nvim", config = true },
|
||||
"itchyny/calendar.vim", -- Interactive calendar; used in the PIM overlay (key "g")
|
||||
-- claude-code.nvim: Claude Code integration (opens/communicates with the `claude` CLI)
|
||||
-- claudecode.nvim: native WebSocket bridge to the Claude Code CLI (inline
|
||||
-- diff review, buffer/selection context, model switching) — replaces the
|
||||
-- older greggh/claude-code.nvim terminal-only wrapper.
|
||||
-- terminal.provider = "native" avoids pulling in folke/snacks.nvim just
|
||||
-- for a terminal split; everything else uses defaults.
|
||||
-- All bindings live under <leader>a ("AI"), previously untouched, so
|
||||
-- none of the single-key app toggles above (t/e/s/q/m/g/f/x) are disturbed.
|
||||
{
|
||||
"greggh/claude-code.nvim",
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
"coder/claudecode.nvim",
|
||||
cmd = {
|
||||
"ClaudeCode", "ClaudeCodeFocus", "ClaudeCodeSelectModel",
|
||||
"ClaudeCodeAdd", "ClaudeCodeSend", "ClaudeCodeStatus",
|
||||
"ClaudeCodeDiffAccept", "ClaudeCodeDiffDeny", "ClaudeCodeCloseAllDiffs",
|
||||
},
|
||||
keys = {
|
||||
{ "<leader>ac", "<cmd>ClaudeCode<cr>", desc = "Claude: toggle" },
|
||||
{ "<leader>af", "<cmd>ClaudeCodeFocus<cr>", desc = "Claude: focus" },
|
||||
{ "<leader>ar", "<cmd>ClaudeCode --resume<cr>", desc = "Claude: resume session" },
|
||||
{ "<leader>aC", "<cmd>ClaudeCode --continue<cr>", desc = "Claude: continue session" },
|
||||
{ "<leader>am", "<cmd>ClaudeCodeSelectModel<cr>", desc = "Claude: select model" },
|
||||
{ "<leader>ab", "<cmd>ClaudeCodeAdd %<cr>", desc = "Claude: add current buffer" },
|
||||
{ "<leader>as", "<cmd>ClaudeCodeSend<cr>", mode = "v", desc = "Claude: send selection" },
|
||||
{ "<leader>ay", "<cmd>ClaudeCodeDiffAccept<cr>", desc = "Claude: accept diff" },
|
||||
{ "<leader>an", "<cmd>ClaudeCodeDiffDeny<cr>", desc = "Claude: deny diff" },
|
||||
{ "<leader>aq", "<cmd>ClaudeCodeCloseAllDiffs<cr>", desc = "Claude: close all diffs" },
|
||||
{ "<leader>aS", "<cmd>ClaudeCodeStatus<cr>", desc = "Claude: connection status" },
|
||||
},
|
||||
config = function()
|
||||
require("claude-code").setup()
|
||||
require("claudecode").setup({
|
||||
terminal = { provider = "native" },
|
||||
})
|
||||
end,
|
||||
},
|
||||
}, {
|
||||
|
|
@ -245,7 +270,7 @@ local function _pim_float(row, col, height, width, border)
|
|||
return win
|
||||
end
|
||||
|
||||
-- n/g/f: individual centered floating windows
|
||||
-- m/g/f: individual centered floating windows
|
||||
local _solo = {}
|
||||
|
||||
local function toggle_solo(key, cmd, label)
|
||||
|
|
@ -268,7 +293,7 @@ local function toggle_solo(key, cmd, label)
|
|||
_solo[key] = win_id
|
||||
end
|
||||
|
||||
vim.keymap.set("n", "n", function() toggle_solo("n", "terminal alot", "alot") end, { silent = true })
|
||||
vim.keymap.set("n", "m", function() toggle_solo("m", "terminal alot", "alot") end, { silent = true })
|
||||
vim.keymap.set("n", "g", function() toggle_solo("g", "terminal khal interactive", "khal") end, { silent = true })
|
||||
vim.keymap.set("n", "f", function() toggle_solo("f", "terminal abook", "abook") end, { silent = true })
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue