From 65a659ca91e5c0182e1b19699e026664a349848e Mon Sep 17 00:00:00 2001 From: Hektor Misplon Date: Tue, 9 Jun 2026 15:20:35 +0200 Subject: [PATCH] feat(nvim): migrate 'claude-code.nvim' to 'claudecode.nvim' --- .../nvim/after/plugin/claude-code.nvim.lua | 61 ------------------- .../nvim/after/plugin/claudecode.nvim.lua | 26 ++++++++ dots/.config/nvim/flake.nix | 3 +- dots/.config/nvim/lua/keymaps.lua | 3 - 4 files changed, 28 insertions(+), 65 deletions(-) delete mode 100644 dots/.config/nvim/after/plugin/claude-code.nvim.lua create mode 100644 dots/.config/nvim/after/plugin/claudecode.nvim.lua diff --git a/dots/.config/nvim/after/plugin/claude-code.nvim.lua b/dots/.config/nvim/after/plugin/claude-code.nvim.lua deleted file mode 100644 index 07d8295..0000000 --- a/dots/.config/nvim/after/plugin/claude-code.nvim.lua +++ /dev/null @@ -1,61 +0,0 @@ -require("claude-code").setup({ - -- Terminal window settings - window = { - split_ratio = 0.3, -- Percentage of screen for the terminal window (height for horizontal, width for vertical splits) - position = "vertical", -- Position of the window: "botright", "topleft", "vertical", "float", etc. - enter_insert = true, -- Whether to enter insert mode when opening Claude Code - hide_numbers = true, -- Hide line numbers in the terminal window - hide_signcolumn = true, -- Hide the sign column in the terminal window - - -- Floating window configuration (only applies when position = "float") - float = { - width = "80%", -- Width: number of columns or percentage string - height = "80%", -- Height: number of rows or percentage string - row = "center", -- Row position: number, "center", or percentage string - col = "center", -- Column position: number, "center", or percentage string - relative = "editor", -- Relative to: "editor" or "cursor" - border = "rounded", -- Border style: "none", "single", "double", "rounded", "solid", "shadow" - }, - }, - -- File refresh settings - refresh = { - enable = true, -- Enable file change detection - updatetime = 100, -- updatetime when Claude Code is active (milliseconds) - timer_interval = 1000, -- How often to check for file changes (milliseconds) - show_notifications = true, -- Show notification when files are reloaded - }, - -- Git project settings - git = { - use_git_root = true, -- Set CWD to git root when opening Claude Code (if in git project) - }, - -- Shell-specific settings - shell = { - separator = "&&", -- Command separator used in shell commands - pushd_cmd = "pushd", -- Command to push directory onto stack (e.g., 'pushd' for bash/zsh, 'enter' for nushell) - popd_cmd = "popd", -- Command to pop directory from stack (e.g., 'popd' for bash/zsh, 'exit' for nushell) - }, - -- Command settings - command = "claude", -- Command used to launch Claude Code - -- Command variants - command_variants = { - -- Conversation management - continue = "--continue", -- Resume the most recent conversation - resume = "--resume", -- Display an interactive conversation picker - - -- Output options - verbose = "--verbose", -- Enable verbose logging with full turn-by-turn output - }, - -- Keymaps - keymaps = { - toggle = { - normal = "", -- Normal mode keymap for toggling Claude Code, false to disable - terminal = "", -- Terminal mode keymap for toggling Claude Code, false to disable - variants = { - continue = "cC", -- Normal mode keymap for Claude Code with continue flag - verbose = "cV", -- Normal mode keymap for Claude Code with verbose flag - }, - }, - window_navigation = true, -- Enable window navigation keymaps () - scrolling = true, -- Enable scrolling keymaps () for page up/down - }, -}) diff --git a/dots/.config/nvim/after/plugin/claudecode.nvim.lua b/dots/.config/nvim/after/plugin/claudecode.nvim.lua new file mode 100644 index 0000000..3934c57 --- /dev/null +++ b/dots/.config/nvim/after/plugin/claudecode.nvim.lua @@ -0,0 +1,26 @@ +require("claudecode").setup({ + -- terminal = { + -- provider = "snacks", + -- snacks_win_opts = { + -- position = "float", + -- width = 0.8, + -- height = 0.8, + -- border = "rounded", + -- }, + -- }, + -- diff_opts = { + -- layout = "vertical", + -- }, +}) + +local map = vim.keymap.set + +map({ "n", "t" }, "", "ClaudeCode", { desc = "Toggle Claude Code" }) +map("n", "cf", "ClaudeCodeFocus", { desc = "Focus Claude Code" }) +map("n", "cC", "ClaudeCode --continue", { desc = "Claude Code (continue)" }) +map("n", "cr", "ClaudeCode --resume", { desc = "Claude Code (resume)" }) +map("n", "cm", "ClaudeCodeSelectModel", { desc = "Claude Code select model" }) +map("n", "cb", "ClaudeCodeAdd %", { desc = "Add buffer to Claude Code" }) +map("v", "cs", "ClaudeCodeSend", { desc = "Send selection to Claude Code" }) +map("n", "co", "ClaudeCodeDiffAccept", { desc = "Accept Claude Code diff" }) +map("n", "cd", "ClaudeCodeDiffDeny", { desc = "Deny Claude Code diff" }) diff --git a/dots/.config/nvim/flake.nix b/dots/.config/nvim/flake.nix index d0c6ab4..6046d8c 100644 --- a/dots/.config/nvim/flake.nix +++ b/dots/.config/nvim/flake.nix @@ -183,7 +183,8 @@ fidget-nvim rustaceanvim # pkgs.neovimPlugins.m-taskwarrior-d-nvim - claude-code-nvim + claudecode-nvim + snacks-nvim ] ++ themes.${categories.colorscheme or "zenwritten"}; }; diff --git a/dots/.config/nvim/lua/keymaps.lua b/dots/.config/nvim/lua/keymaps.lua index a922869..08fef52 100644 --- a/dots/.config/nvim/lua/keymaps.lua +++ b/dots/.config/nvim/lua/keymaps.lua @@ -34,9 +34,6 @@ set("i", "", "") set("i", "", "") set("i", "", "") --- search -set("n", "", ":noh", { desc = "clear search highlight" }) - -- line numbers set("n", "n", ":set nu! rnu!", { desc = "toggle line numbers" })