Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: test

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
neovim-plugins:
name: Neovim plugins
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v6
- name: Install Nix
uses: NixOS/nix-installer-action@main
with:
extra-conf: |
accept-flake-config = true
experimental-features = pipe-operators
- name: Setup Nix cache
uses: sub60/setup-cache@main
- name: Test the Neovim plugins
run: nix run .#tests.neovim-plugins
1 change: 1 addition & 0 deletions modules/flake/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
imports = [
./checks
./machines
./tests
];
}
5 changes: 5 additions & 0 deletions modules/flake/tests/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
imports = [
./neovim-plugins.nix
];
}
13 changes: 13 additions & 0 deletions modules/flake/tests/neovim-plugins.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
inputs,
...
}:

{
perSystem =
{ system, ... }:
{
# Run with `nix run .#tests.neovim-plugins`.
legacyPackages.tests.neovim-plugins = inputs.neovim.tests.${system}.plugins;
};
}
23 changes: 23 additions & 0 deletions modules/home/claude/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,18 @@
with lib;
let
cfg = config.modules.claude;

# Agents running in a Neovim terminal reach that Neovim through `$NVIM`.
refresh-nvim-hunks = pkgs.writeShellApplication {
name = "refresh-nvim-hunks";
runtimeInputs = [ config.neovim.package ];
text = ''
if [ -n "''${NVIM:-}" ]; then
nvim --server "$NVIM" --remote-expr "v:lua.require'nvim_hunks'.refresh()" \
>/dev/null 2>&1 || true
fi
'';
};
in
{
options.modules.claude = {
Expand Down Expand Up @@ -48,6 +60,17 @@ in
ANTHROPIC_BASE_URL = config.modules.cli-proxy-api.endpoint;
ANTHROPIC_AUTH_TOKEN = config.modules.cli-proxy-api.apiKey;
};
hooks.PostToolUse = [
{
matcher = "Edit|MultiEdit|Write|NotebookEdit";
hooks = [
{
type = "command";
command = lib.getExe refresh-nvim-hunks;
}
];
}
];
permissions = {
defaultMode = "acceptEdits";
allow = [
Expand Down
278 changes: 0 additions & 278 deletions modules/home/neovim/config/lua/plugins/codediff.lua

This file was deleted.

24 changes: 0 additions & 24 deletions modules/home/neovim/config/lua/plugins/gitsigns.lua

This file was deleted.

Loading
Loading