Compare commits

...
Author SHA1 Message Date
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
f8d525b7eb
Add a quick named-session binding and fix theme reload in tmux
prefix S now prompts for a name and runs new-session directly, replacing
the `<prefix> :` then `new -s name` command-mode round trip.

Session numbering in choose-tree (prefix s) turned out to be
session_id, an internal per-server counter with no base-index
equivalent, so it can't be made to start at 1 the way windows do;
named sessions plus C-s search in the tree are the workaround.

Also fixed a bug found while testing: `<prefix> r` re-sources the
whole config, and the trailing `source-file ~/.tmux-dark.conf` at the
end always ran, clobbering a light-themed session on every manual
reload. It now checks the invoking client's theme like the
client-attached hook already does.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013t7aQbc4EyYtab1crvSFTd
2026-08-14 09:36:27 +01:00
5 changed files with 26 additions and 2 deletions

View file

@ -0,0 +1,12 @@
vim.pack.add({ 'https://github.com/sindrets/diffview.nvim' })
require('diffview').setup()
local function map(lhs, rhs, desc)
vim.keymap.set('n', lhs, rhs, { desc = desc })
end
map('<leader>gd', '<Cmd>DiffviewOpen<CR>', 'Diff against index')
map('<leader>gc', '<Cmd>DiffviewClose<CR>', 'Close diff view')
map('<leader>gh', '<Cmd>DiffviewFileHistory %<CR>', 'File history')
map('<leader>gH', '<Cmd>DiffviewFileHistory<CR>', 'Branch history')

View file

@ -1,3 +1,4 @@
require('config.plugins.diffview')
require('config.plugins.fzf-lua') require('config.plugins.fzf-lua')
require('config.plugins.gitsigns') require('config.plugins.gitsigns')
require('config.plugins.nvim-tree') require('config.plugins.nvim-tree')

View file

@ -8,6 +8,7 @@ wk.setup()
wk.add({ wk.add({
{ '<leader>d', group = 'diagnostics' }, { '<leader>d', group = 'diagnostics' },
{ '<leader>f', group = 'find' }, { '<leader>f', group = 'find' },
{ '<leader>g', group = 'diff' },
{ '<leader>h', group = 'hunks' }, { '<leader>h', group = 'hunks' },
{ '<leader>t', group = 'toggles' }, { '<leader>t', group = 'toggles' },
}) })

View file

@ -1,5 +1,9 @@
{ {
"plugins": { "plugins": {
"diffview.nvim": {
"rev": "4516612fe98ff56ae0415a259ff6361a89419b0a",
"src": "https://github.com/sindrets/diffview.nvim"
},
"fzf-lua": { "fzf-lua": {
"rev": "8671012a7b2a1648595952c655039d51fb301c14", "rev": "8671012a7b2a1648595952c655039d51fb301c14",
"src": "https://github.com/ibhagwan/fzf-lua" "src": "https://github.com/ibhagwan/fzf-lua"

10
tmux
View file

@ -14,6 +14,10 @@ set -g renumber-windows on
# don't detach when closing a window if other windows remain # don't detach when closing a window if other windows remain
set -g detach-on-destroy off set -g detach-on-destroy off
# prompt for a name and create a session in one step, instead of
# `<prefix> :` then `new -s name`
bind-key S command-prompt -p "New session name:" "new-session -s '%%'"
# reload config file (change file location to your the tmux.conf you want to use) # reload config file (change file location to your the tmux.conf you want to use)
unbind r unbind r
bind r source-file ~/.tmux.conf bind r source-file ~/.tmux.conf
@ -51,5 +55,7 @@ set-hook -g client-dark-theme 'source-file ~/.tmux-dark.conf'
# client attaches. Sourcing is idempotent, so the overlap is harmless. # client attaches. Sourcing is idempotent, so the overlap is harmless.
set-hook -g client-attached 'if -F "#{==:#{client_theme},light}" "source-file ~/.tmux-light.conf" "source-file ~/.tmux-dark.conf"' set-hook -g client-attached 'if -F "#{==:#{client_theme},light}" "source-file ~/.tmux-light.conf" "source-file ~/.tmux-dark.conf"'
# Default before any client has attached and reported a theme. # Default before any client has attached and reported a theme. This also
source-file ~/.tmux-dark.conf # runs on manual reload (`r` below), so check the invoking client's theme
# rather than always falling back to dark and clobbering a light session.
if -F "#{==:#{client_theme},light}" "source-file ~/.tmux-light.conf" "source-file ~/.tmux-dark.conf"