Commit graph dotfiles/neovim
Author SHA1 Message Date
Jonny Barnes
80683b82c1
Add git sync, and stop trusting the cached default branch
BuildEmpire/Totara renamed its default branch from main to totara-20.
Nothing local noticed, because refs/remotes/origin/HEAD is written once at
clone time and remote.<name>.followRemoteHEAD defaults to `create`, which
only fills the ref in when it is missing. So `git default-branch` still
said main, as did nvim's diff-against-branch prompt.

bin/git-sync does the start-of-work sequence for a fork - fast-forward the
default branch from upstream, push it to origin - and works out which
branch that is by asking the server, not the cache. It sets the cached
HEADs from the answer, so everything reading that ref agrees afterwards.
It lives in bin/ rather than as an alias because git picks up git-<name>
on the $PATH as a subcommand, and this is more shell than a gitconfig
alias should hold. followRemoteHEAD = always is set for origin as well, so
an ordinary fetch keeps the ref current without running the script.

The nvim prompt now prefers origin, then upstream, then the remaining
remotes. It took the first remote alphabetically before, which in
be-edition means kdog - a colleague's fork - rather than anything
authoritative.

Verified against a fixture of bare repos whose default branch is
totara-20 and whose cached HEAD is stale: the branch is created tracking
origin when absent, fast-forwarded when behind, pushed to the fork,
refuses to merge when the local copy has diverged, and is a no-op on a
second run. The nvim prompt was checked in three real repos.
2026-08-27 16:05:49 +01:00
Jonny Barnes
d4a4c68787
Replace diffview.nvim with codediff.nvim
diffview was doing the job for reviewing a branch before merging it, but
not well enough. codediff renders diffs the way VSCode does - light
line-level backgrounds with deeper character-level highlights on top of
them - so what actually changed within a line is legible rather than
inferred.

Keymaps carry over one for one: <leader>gd opens the status explorer,
<leader>gh/<leader>gH the file and branch history, and <leader>gm still
prompts for a base branch and diffs rev...HEAD against it. <leader>gc is
folded into codediff's own quit action alongside q, since there is no
close command to map it to.

Its diffing is done in C, and the library is downloaded prebuilt on
first use rather than compiled, so there is no build step for vim.pack
to worry about.
2026-08-27 15:42:08 +01:00
Jonny Barnes
2f1cd1a1c3
Add catppuccin colorscheme, latte in light mode and macchiato in dark
Installed via vim.pack, matching the other plugins here. The pack is
named explicitly ('catppuccin') because the repo is called 'nvim', which
would otherwise be the plugin's name in the lock file and on disk.

flavour = 'auto' with background = { light = 'latte', dark = 'macchiato' }
so the flavour follows 'background', which the TUI sets from the terminal
on startup. It is required first from config/plugins/init.lua so the other
plugins load with the colorscheme already applied.

Verified headlessly in a single nvim: `set background=light` gives
catppuccin-latte and `set background=dark` gives catppuccin-macchiato, so
a running instance can be switched by hand with `:set background=` as the
top-level README already suggests.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-27 11:54:06 +01:00
e7b1d3aa83
Add a diff-against-branch keymap to diffview.nvim
gd only diffs the working tree against the index, so it shows nothing
once a branch's work is already committed - found this reviewing a
fully-committed branch, where it just showed blank panes.

gm prompts for a rev and opens DiffviewOpen <rev>...HEAD instead. The
prompt defaults to whatever the first remote's HEAD points to, since
the base branch name isn't consistent across repos (main here,
develop in jonnybarnes.uk).

Verified against jonnybarnes.uk's micropub-token-revocation branch:
default_branch() correctly resolved forge/HEAD to develop there vs
main in this repo, and DiffviewOpen develop...HEAD listed all 25
changed files.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013t7aQbc4EyYtab1crvSFTd
2026-08-14 10:55:50 +01:00
37253c8a7b
Add diffview.nvim for reviewing diffs and file history
Installed via vim.pack, matching how the other plugins here are
managed. Adds a new <leader>g "diff" group: gd opens a Diffview
against the index, gc closes it, gh shows history for the current
file, gH for the branch.

Verified headlessly: config/plugins loads clean, :DiffviewOpen is
registered, and opening/closing a Diffview against this repo works
with no errors.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013t7aQbc4EyYtab1crvSFTd
2026-08-14 09:53:21 +01:00
Jonny Barnes
dda3868321
Show gitignored files in nvim-tree and follow the open buffer
Two nvim-tree defaults that were quietly getting in the way.

filters.git_ignored defaults to true, so gitignored files are hidden. The
symptom was .env being absent from a project while .env.example sat right
there, which reads as a dotfile filter but is not: filters.dotfiles is already
false, so dotfiles show. The filter is git-aware, and .env was simply reported
ignored. Verified in a throwaway repo ignoring .env and vendor/ — both appear
now, and neither did before, with the ignored glyph to distinguish them.

The trade-off is real and is the reason for the default: vendor/ and
node_modules/ now show too. filters.exclude = { '.env' } was the narrower
option, exempting one name while keeping the rest hidden. Chose the broad
setting deliberately; `I` in the tree hides them again per session.

update_focused_file.enable defaults to false, so the tree never moved when a
file was opened from fzf-lua. Enabling it reveals the current buffer on
BufEnter, uncollapsing folders to reach it. Verified on a nested fixture:
opening src/deep/nested/target.php expanded all three folders and put the tree
cursor on the file. Focus stays in the file window, so it reveals rather than
steals, and it follows every buffer switch, not just fzf-lua.

Left update_root off. It would re-root the tree at files outside the current
root, which makes the tree wander into vendor/ — worse now that ignored files
are visible and easier to open by accident.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-12 21:18:55 +01:00
Jonny Barnes
f5ae360e7e
Document the neovim setup in its own README
Keymaps are discoverable in-editor by pressing <Space> and pausing, and are
written down separately, so they are deliberately not duplicated here. What was
not recorded anywhere was the surrounding context.

Covers the 0.12 floor, since autocomplete, pumborder, pummaxwidth, the nearest
completeopt value and vim.pack all require it; what bootstrap.sh symlinks where,
and why config/ is linked in as lua/config; and the vim.pack convention of one
file per plugin with versions pinned in the tracked lock file.

The rest is the behaviours that read as bugs until you know they are deliberate.
A standalone .php file gets no LSP at all, because phpactor sets
workspace_required and wants a project marker. Spell checking is on globally, in
code buffers too. netrw is disabled so `nvim .` opens nvim-tree, on the right.
Diagnostic signs are letters rather than icons.

Also restates the gitsigns global-mapping rationale already in the source, since
folding those maps into on_attach is the obvious tidy-up and it silently stops
them appearing in the which-key popup.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-09 17:06:52 +01:00
Jonny Barnes
d245a83f2c
Add nvim-tree, on the right, toggled with <leader>e
Netrw is disabled, as nvim-tree needs to own directory buffers so
`nvim .` opens the tree rather than the two fighting over it. That
removes :Ex, so the Obsidian guide has been updated to point at
<leader>e instead.

No auto-open autocmd: `nvim <path>` opens just the file, and the tree
is there on <leader>e when it is wanted. Placing it on the right also
flips the split direction, so opening a file from the tree puts it to
the left rather than displacing the tree.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-08 20:36:39 +01:00
Jonny Barnes
865b52c2e5
Add fzf-lua for project navigation
Wraps the fzf binary already installed via brew, alongside rg and fd,
so it needs no plugin dependencies - unlike telescope, which would
also pull in plenary. Picks up nvim-web-devicons for file icons, which
is the first thing actually using that plugin.

Maps live under <leader>f: files, live grep, buffers, grep the word
under the cursor, and help tags. The intent is to stop treating netrw
as the way into a project and switch to jumping by name, leaving
buffers open and bouncing between them, rather than quitting out of
nvim to change file.

Netrw is untouched and still on :Ex for browsing an unfamiliar tree.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-08 18:39:48 +01:00
Jonny Barnes
e8e9bf0663
Fix which-key not seeing gitsigns maps, add diagnostic maps
The gitsigns keymaps were defined in on_attach, so they were
buffer-local and created asynchronously - gitsigns shells out to git
before attaching. which-key had already built its keymap tree for the
buffer by then, and it only invalidates that cache on BufReadPost,
BufNew and LspAttach, so maps added afterwards stayed invisible.
Buf:get() returns cached mode state unless explicitly passed `update`,
which is why re-entering the buffer didn't help either.

Mapping globally instead means the maps exist before which-key builds
any tree. The gitsigns API no-ops in buffers it hasn't attached to
(checked stage/reset/preview/blame/nav in a non-git directory), so the
only change is that the maps now exist everywhere rather than just in
git-tracked buffers.

Also puts the diagnostic float and quickfix list on <leader>d. Nvim
already binds <C-W>d and ]d/[d for these, so this is a rebinding for
discoverability rather than new capability.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-08 17:27:37 +01:00
Jonny Barnes
5d0688c827
Add which-key and nvim-web-devicons, tidy brew casks
which-key needs an icon backend and treats mini.icons and
nvim-web-devicons as equally viable optional deps, so devicons covers
it. Both are pure APIs with no visible effect on their own; devicons
self-initialises on require, so no setup() call.

Group labels for the <leader>h and <leader>t prefixes live in the
which-key config rather than next to the gitsigns maps they describe,
keeping which-key's config in one place. Worth moving if more plugins
start contributing prefixes.

The Nerd Font the glyphs need was installed by hand on this machine
but missing from brew.sh, so a fresh bootstrap would have rendered
every icon as tofu. Records it as a cask alongside the ghostty
font-family setting that already expects it.

Also drops the claude-code cask, which was never actually installed
here: brew tracks stable releases, and we want newer ones, so it comes
from Claude's own installer instead. Left a comment so it doesn't get
re-added.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-08 14:26:59 +01:00
Jonny Barnes
509b16f543
Add gitsigns via vim.pack, track the pack lockfile
Restores plugin management after the v0.12 config rewrite dropped the
earlier `vim.pack.add` calls. Plugins now live in `config/plugins/`,
one file per plugin, so adding the next is a single require.

Sets `<leader>` to Space for the gitsigns hunk mappings, and pins
'signcolumn' open so git and diagnostic signs don't shift text.

The lockfile moves into the repo and is symlinked by bootstrap.sh, as
the vim.pack docs recommend, giving reproducible plugin revisions
across machines and a rollback path via git. vim.pack writes it with a
truncating open, so it follows the symlink rather than replacing it.

Drops the orphaned nvim-tree entry, unreferenced since the rewrite.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-08 13:57:02 +01:00
Jonny Barnes
d3b54ea921
Updated neovim config for v0.12 2026-05-31 20:33:23 +01:00
6d645999f2
Add phpactor support to neovim with default settings 2026-02-15 17:03:34 +00:00
ffd895b1fe
Use pack.add for plugns
Needs neovim >= 0.12
2026-02-13 22:25:08 +00:00
5ad13bcd09
Initial tidy up of neovim config 2026-02-13 21:06:00 +00:00
00898fae4c
Updated neovim config 2024-11-21 19:54:54 +00:00
5a4ce9b2aa
Trying out a file tree plugin for neovim 2024-11-21 19:54:08 +00:00
bcd3112ec9
Add phpactor support for neovim 2024-09-21 09:02:04 +01:00
a2b2db8757
Add line numbers in NeoVim 2024-07-13 17:04:18 +01:00
753f55ce44
Added some NeoVim modules
- Oil: file listings
  - Nvim Web Devicons: adds some icons for Oil
  - gitsigns: show git modifications inside nvim
2024-07-12 13:07:43 +01:00