feat: set up 'claude-code.nvim' plugin
This commit is contained in:
61
dots/.config/nvim/after/plugin/claude-code.nvim.lua
Normal file
61
dots/.config/nvim/after/plugin/claude-code.nvim.lua
Normal file
@@ -0,0 +1,61 @@
|
||||
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 = "<C-,>", -- Normal mode keymap for toggling Claude Code, false to disable
|
||||
terminal = "<C-,>", -- Terminal mode keymap for toggling Claude Code, false to disable
|
||||
variants = {
|
||||
continue = "<leader>cC", -- Normal mode keymap for Claude Code with continue flag
|
||||
verbose = "<leader>cV", -- Normal mode keymap for Claude Code with verbose flag
|
||||
},
|
||||
},
|
||||
window_navigation = true, -- Enable window navigation keymaps (<C-h/j/k/l>)
|
||||
scrolling = true, -- Enable scrolling keymaps (<C-f/b>) for page up/down
|
||||
},
|
||||
})
|
||||
6
dots/.config/nvim/flake.lock
generated
6
dots/.config/nvim/flake.lock
generated
@@ -17,11 +17,11 @@
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1765644376,
|
||||
"narHash": "sha256-yqHBL2wYGwjGL2GUF2w3tofWl8qO9tZEuI4wSqbCrtE=",
|
||||
"lastModified": 1765934234,
|
||||
"narHash": "sha256-pJjWUzNnjbIAMIc5gRFUuKCDQ9S1cuh3b2hKgA7Mc4A=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "23735a82a828372c4ef92c660864e82fbe2f5fbe",
|
||||
"rev": "af84f9d270d404c17699522fab95bbf928a2d92f",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
||||
@@ -152,6 +152,7 @@
|
||||
fidget-nvim
|
||||
rustaceanvim
|
||||
pkgs.neovimPlugins.m-taskwarrior-d-nvim
|
||||
claude-code-nvim
|
||||
];
|
||||
};
|
||||
|
||||
|
||||
@@ -43,4 +43,5 @@ require("nixCatsUtils.catPacker").setup({
|
||||
{ "zbirenbaum/copilot-cmp" },
|
||||
{ "qvalentin/helm-ls.nvim", ft = "helm" },
|
||||
{ "mikesmithgh/kitty-scrollback.nvim" },
|
||||
{ "greggh/claude-code.nvim" },
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user