feat: set up 'claude-code.nvim' plugin

This commit is contained in:
2025-12-18 15:34:49 +01:00
parent 0233c339aa
commit 2030093433
6 changed files with 176 additions and 15 deletions

View 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
},
})

View File

@@ -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": {

View File

@@ -152,6 +152,7 @@
fidget-nvim
rustaceanvim
pkgs.neovimPlugins.m-taskwarrior-d-nvim
claude-code-nvim
];
};

View File

@@ -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" },
})

24
flake.lock generated
View File

@@ -29,11 +29,11 @@
},
"locked": {
"dir": "pkgs/firefox-addons",
"lastModified": 1765771449,
"narHash": "sha256-ZoHRPmTzwC1ndX3NQB/b/WKtU1WduAJdLI4j8eW/QFM=",
"lastModified": 1766046711,
"narHash": "sha256-PijxRQcvSgQae3qBdY4+IGMsMFL67N3D7sBJdZxDii4=",
"owner": "rycee",
"repo": "nur-expressions",
"rev": "5bcf9a2aeb4d361c2ff918a146b3fcc1e136b9ca",
"rev": "7163ab9a8e64cd29c45e8f93fbc038b12056e6fc",
"type": "gitlab"
},
"original": {
@@ -68,11 +68,11 @@
]
},
"locked": {
"lastModified": 1765682243,
"narHash": "sha256-yeCxFV/905Wr91yKt5zrVvK6O2CVXWRMSrxqlAZnLp0=",
"lastModified": 1765980955,
"narHash": "sha256-rB45jv4uwC90vM9UZ70plfvY/2Kdygs+zlQ07dGQFk4=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "58bf3ecb2d0bba7bdf363fc8a6c4d49b4d509d03",
"rev": "89c9508bbe9b40d36b3dc206c2483ef176f15173",
"type": "github"
},
"original": {
@@ -153,11 +153,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1765472234,
"narHash": "sha256-9VvC20PJPsleGMewwcWYKGzDIyjckEz8uWmT0vCDYK0=",
"lastModified": 1765779637,
"narHash": "sha256-KJ2wa/BLSrTqDjbfyNx70ov/HdgNBCBBSQP3BIzKnv4=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "2fbfb1d73d239d2402a8fe03963e37aab15abe8b",
"rev": "1306659b587dc277866c7b69eb97e5f07864d8c4",
"type": "github"
},
"original": {
@@ -340,11 +340,11 @@
]
},
"locked": {
"lastModified": 1765684837,
"narHash": "sha256-fJCnsYcpQxxy/wit9EBOK33c0Z9U4D3Tvo3gf2mvHos=",
"lastModified": 1765836173,
"narHash": "sha256-hWRYfdH2ONI7HXbqZqW8Q1y9IRbnXWvtvt/ONZovSNY=",
"owner": "Mic92",
"repo": "sops-nix",
"rev": "94d8af61d8a603d33d1ed3500a33fcf35ae7d3bc",
"rev": "443a7f2e7e118c4fc63b7fae05ab3080dd0e5c63",
"type": "github"
},
"original": {

View File

@@ -0,0 +1,98 @@
{
inputs,
config,
pkgs,
...
}:
with pkgs;
[
age
aider-chat
argocd
azure-cli
bat
biome
(config.lib.nixGL.wrap bruno)
chromium
clang
claude-code
(config.lib.nixGL.wrap code-cursor)
curl
dconf2nix
dive
emmet-language-server
eslint_d
flameshot
fluxcd
fzf
fzf-git-sh
git-machete
github-copilot-cli
glab
go
hadolint
hello
helm-ls
htop
input-leap
jira-cli-go
jq
k3d
(config.lib.nixGL.wrap kitty)
kubectl
kubernetes
kubernetes-helm
kustomize
lua
lua-language-server
minikube
ncspot
nil
nixd
nixfmt-rfc-style
# nodejs
nodejs_24
nvimpager
(config.lib.nixGL.wrap obsidian)
pavucontrol
# pgadmin4
prettierd
responder
ripgrep
rust-analyzer
rustlings
shellcheck
(config.lib.nixGL.wrap signal-desktop)
silver-searcher
sleuthkit
spotify
starship
stylua
taskopen
taskwarrior3
(config.lib.nixGL.wrap teams-for-linux)
opentofu
sops
tldr
tmux
tree
tree-sitter
tsx
upbound
vault-bin
(config.lib.nixGL.wrap vscode)
vscode-langservers-extracted
vtsls
yaml-language-server
xclip
xmage
yamllint
yarn
(python311.withPackages (ppkgs: [
ppkgs.plyer
ppkgs.dbus-python
]))
# flakes
inputs.nvim.packages.x86_64-linux.nvim
]