From aca1bc55637f25076037bd6d51e5b943de87c0b8 Mon Sep 17 00:00:00 2001 From: aguil Date: Mon, 8 Jun 2026 14:36:30 -0600 Subject: [PATCH 1/5] fix(tmux): use plain session picker shortcuts Override choose-tree session shortcuts so entries after 9 use plain letter keys instead of tmux's default Meta-letter chords. This keeps prefix+s usable when terminal Meta handling does not select rows. --- dot_tmux.conf | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dot_tmux.conf b/dot_tmux.conf index dec84d9..cec7003 100644 --- a/dot_tmux.conf +++ b/dot_tmux.conf @@ -50,7 +50,9 @@ bind % split-window -h -c "#{pane_current_path}" # Quick config reload and scrollback clear. bind-key r source-file ~/.tmux.conf \; display-message "tmux config reloaded" bind-key b send-keys -R \; clear-history -bind-key s choose-tree -sZ +# Use explicit choose-tree shortcuts so sessions after 9 use plain letters. +# tmux's default Meta-letter shortcuts can be swallowed by terminal settings. +bind-key s choose-tree -sZ -K "#{?#{==:#{line},0},0,#{?#{==:#{line},1},1,#{?#{==:#{line},2},2,#{?#{==:#{line},3},3,#{?#{==:#{line},4},4,#{?#{==:#{line},5},5,#{?#{==:#{line},6},6,#{?#{==:#{line},7},7,#{?#{==:#{line},8},8,#{?#{==:#{line},9},9,#{?#{==:#{line},10},a,#{?#{==:#{line},11},b,#{?#{==:#{line},12},c,#{?#{==:#{line},13},d,#{?#{==:#{line},14},e,#{?#{==:#{line},15},g,#{?#{==:#{line},16},i,#{?#{==:#{line},17},o,#{?#{==:#{line},18},p,#{?#{==:#{line},19},u,}}}}}}}}}}}}}}}}}}}}" bind-key w choose-tree -wZ # Neovim-aware pane switching (no prefix; -n). From 4abed68baa887b8d2feae61187e0160edbea4be6 Mon Sep 17 00:00:00 2001 From: aguil Date: Mon, 8 Jun 2026 14:44:34 -0600 Subject: [PATCH 2/5] feat(nvim): add jj signs base toggle Add a jjsigns toggle that switches between the default @- base and the detected default branch for branch-level review. Refresh attached buffers after switching so gutter signs update immediately. --- dot_config/nvim/lua/custom/plugins/git.lua | 31 ++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/dot_config/nvim/lua/custom/plugins/git.lua b/dot_config/nvim/lua/custom/plugins/git.lua index b62bcf0..6287497 100644 --- a/dot_config/nvim/lua/custom/plugins/git.lua +++ b/dot_config/nvim/lua/custom/plugins/git.lua @@ -366,6 +366,34 @@ return { return vim.fs.normalize(path:sub(1, #path - #suffix - 1)) end + local function toggle_jj_signs_base() + local bufname = vim.api.nvim_buf_get_name(0) + local path = bufname ~= '' and vim.fs.normalize(bufname) or vim.fn.getcwd(0) + local root = vcs.find_root(path) + if not root or not vim.uv.fs_stat(root .. '/.jj') then + vim.notify('Not inside a jj repository.', vim.log.levels.WARN) + return + end + + local config = require 'jjsigns.config' + if config.config.base ~= '@-' then + config.config.base = '@-' + require('jjsigns.attach').refresh_all() + vim.notify('jjsigns base: @-') + return + end + + local base = find_jj_default_branch(root) + if not base then + vim.notify('Could not find default branch. Set vim.g.dot_vcs_default_branches.', vim.log.levels.WARN) + return + end + + config.config.base = base + require('jjsigns.attach').refresh_all() + vim.notify('jjsigns base: ' .. base) + end + local function map_jj_change_navigation(bufnr) if vcs.workspace_kind(bufnr) ~= 'jj' then return @@ -432,6 +460,7 @@ return { end require('jjsigns').setup { + base = '@-', signs = { add = { text = '+' }, change = { text = '~' }, @@ -464,6 +493,8 @@ return { end end, }) + + vim.keymap.set('n', 'tJ', toggle_jj_signs_base, { desc = 'Toggle jj signs base' }) end, }, From 3a30b3ee335dc42fe473ad59dbc2b351a2f7ce23 Mon Sep 17 00:00:00 2001 From: aguil Date: Mon, 8 Jun 2026 15:00:07 -0600 Subject: [PATCH 3/5] fix(nvim): keep Kotlin references in picker Send the ReferenceParams context required by kotlin-lsp and route Kotlin reference lookups through Telescope with auto-jump disabled. This keeps grr usable when multiple references are returned. --- dot_config/nvim/init.lua | 45 ++++++++++++++++++++++++++++++++++------ 1 file changed, 39 insertions(+), 6 deletions(-) diff --git a/dot_config/nvim/init.lua b/dot_config/nvim/init.lua index 2a4d8ee..2eea20a 100644 --- a/dot_config/nvim/init.lua +++ b/dot_config/nvim/init.lua @@ -463,6 +463,9 @@ require('lazy').setup({ local offset_encoding = (client and client.offset_encoding) or 'utf-16' local symbol_under_cursor = vim.fn.expand '' local params = vim.lsp.util.make_position_params(nil, offset_encoding) + if method == 'textDocument/references' then + params.context = { includeDeclaration = true } + end vim.lsp.buf_request(event.buf, method, params, function(err, result, context) if err then vim.notify(string.format('[kotlin] %s request failed: %s', label, err.message or tostring(err)), vim.log.levels.ERROR) @@ -874,12 +877,19 @@ require('lazy').setup({ return end - local saw_jar_target = false - for _, item in ipairs(items) do + local function format_location_item(item) + local filename = item.filename or item.uri or '' + local display = filename + if not is_jar_reference(display) then + display = vim.fn.fnamemodify(display, ':~:.') + end + return string.format('%s:%d:%d', display, item.lnum or 1, item.col or 1) + end + + local function jump_to_item(item) if is_jar_reference(item.filename) or is_jar_reference(item.uri) then - saw_jar_target = true if jump_to_jar_reference(item, label) then - return + return true end else local bufnr = vim.fn.bufnr(item.filename, false) @@ -916,10 +926,31 @@ require('lazy').setup({ new_col = 0 end vim.api.nvim_win_set_cursor(0, { line, new_col }) - return + return true end end end + return false + end + + if method == 'textDocument/references' and #items > 1 then + vim.ui.select(items, { + prompt = '[kotlin] references', + format_item = format_location_item, + }, function(item) + if item and not jump_to_item(item) then + vim.notify(string.format('[kotlin] %s target was not jumpable', label), vim.log.levels.INFO) + end + end) + return + end + + local saw_jar_target = false + for _, item in ipairs(items) do + saw_jar_target = saw_jar_target or is_jar_reference(item.filename) or is_jar_reference(item.uri) + if jump_to_item(item) then + return + end end if saw_jar_target then @@ -969,7 +1000,9 @@ require('lazy').setup({ vim.keymap.set('n', 'grd', safe_jump('textDocument/definition', 'definition'), { buffer = buf, desc = '[Kotlin] [G]oto [D]efinition' }) vim.keymap.set('n', 'gri', safe_jump('textDocument/implementation', 'implementation'), { buffer = buf, desc = '[Kotlin] [G]oto [I]mplementation' }) vim.keymap.set('n', 'grt', safe_jump('textDocument/typeDefinition', 'type definition'), { buffer = buf, desc = '[Kotlin] [G]oto [T]ype Definition' }) - vim.keymap.set('n', 'grr', safe_jump('textDocument/references', 'references'), { buffer = buf, desc = '[Kotlin] [G]oto [R]eferences' }) + vim.keymap.set('n', 'grr', function() + builtin.lsp_references { include_declaration = true, jump_type = 'never' } + end, { buffer = buf, desc = '[Kotlin] [G]oto [R]eferences' }) end end, }) From 60180eaedbb36c519b2c2710744315c87df5e09f Mon Sep 17 00:00:00 2001 From: aguil Date: Mon, 8 Jun 2026 15:23:54 -0600 Subject: [PATCH 4/5] feat(nvim): default jj signs to branch base Initialize jjsigns against the detected default branch for jj buffers, falling back to @- when no branch can be resolved. Keep the toggle so working-copy signs remain available when refining a single jj change. --- dot_config/nvim/lua/custom/plugins/git.lua | 51 +++++++++++++++++----- 1 file changed, 39 insertions(+), 12 deletions(-) diff --git a/dot_config/nvim/lua/custom/plugins/git.lua b/dot_config/nvim/lua/custom/plugins/git.lua index 6287497..06cceb6 100644 --- a/dot_config/nvim/lua/custom/plugins/git.lua +++ b/dot_config/nvim/lua/custom/plugins/git.lua @@ -366,6 +366,21 @@ return { return vim.fs.normalize(path:sub(1, #path - #suffix - 1)) end + local jj_signs_base_mode = 'default_branch' + + local function resolve_jj_signs_base(root) + if jj_signs_base_mode == 'working_copy' then + return '@-' + end + return find_jj_default_branch(root) or '@-' + end + + local function set_jj_signs_base(root) + local base = resolve_jj_signs_base(root) + require('jjsigns.config').config.base = base + return base + end + local function toggle_jj_signs_base() local bufname = vim.api.nvim_buf_get_name(0) local path = bufname ~= '' and vim.fs.normalize(bufname) or vim.fn.getcwd(0) @@ -375,23 +390,31 @@ return { return end - local config = require 'jjsigns.config' - if config.config.base ~= '@-' then - config.config.base = '@-' - require('jjsigns.attach').refresh_all() - vim.notify('jjsigns base: @-') - return + if jj_signs_base_mode == 'default_branch' then + jj_signs_base_mode = 'working_copy' + else + jj_signs_base_mode = 'default_branch' + if not find_jj_default_branch(root) then + vim.notify('Could not find default branch. Falling back to @-. Set vim.g.dot_vcs_default_branches.', vim.log.levels.WARN) + end + end + + local base = set_jj_signs_base(root) + require('jjsigns.attach').refresh_all() + vim.notify('jjsigns base: ' .. base) + end + + local function default_jj_signs_base() + local root = vcs.find_root(vim.fn.getcwd(0)) + if not root or not vim.uv.fs_stat(root .. '/.jj') then + return '@-' end local base = find_jj_default_branch(root) if not base then - vim.notify('Could not find default branch. Set vim.g.dot_vcs_default_branches.', vim.log.levels.WARN) return end - - config.config.base = base - require('jjsigns.attach').refresh_all() - vim.notify('jjsigns base: ' .. base) + return base end local function map_jj_change_navigation(bufnr) @@ -452,6 +475,10 @@ return { if filepath:match '^jar://' then return end + local root = vcs.find_root(filepath) + if root and vim.uv.fs_stat(root .. '/.jj') then + set_jj_signs_base(root) + end orig_attach_to_buffer(bufnr) if attach.is_attached(bufnr) then map_jj_change_navigation(bufnr) @@ -460,7 +487,7 @@ return { end require('jjsigns').setup { - base = '@-', + base = default_jj_signs_base(), signs = { add = { text = '+' }, change = { text = '~' }, From be90fee55aa1729b28337ae39deafb0a8ffcb27b Mon Sep 17 00:00:00 2001 From: aguil Date: Mon, 8 Jun 2026 15:27:31 -0600 Subject: [PATCH 5/5] feat(nvim): show jj inline blame Add a jj-backed current-line blame fallback for jj workspaces where gitsigns does not attach. Use jj file annotate with a compatible template and keep tb as the toggle in jj buffers. --- dot_config/nvim/lua/custom/plugins/git.lua | 76 ++++++++++++++++++++++ 1 file changed, 76 insertions(+) diff --git a/dot_config/nvim/lua/custom/plugins/git.lua b/dot_config/nvim/lua/custom/plugins/git.lua index 06cceb6..9040e76 100644 --- a/dot_config/nvim/lua/custom/plugins/git.lua +++ b/dot_config/nvim/lua/custom/plugins/git.lua @@ -367,6 +367,9 @@ return { end local jj_signs_base_mode = 'default_branch' + local jj_blame_enabled = true + local jj_blame_ns = vim.api.nvim_create_namespace 'dot-jj-current-line-blame' + local jj_blame_group = vim.api.nvim_create_augroup('dot-jj-current-line-blame', { clear = true }) local function resolve_jj_signs_base(root) if jj_signs_base_mode == 'working_copy' then @@ -417,6 +420,69 @@ return { return base end + local function clear_jj_blame(bufnr) + vim.api.nvim_buf_clear_namespace(bufnr, jj_blame_ns, 0, -1) + end + + local function jj_relative_path(filepath, root) + if filepath:sub(1, #root + 1) == root .. '/' then + return filepath:sub(#root + 2) + end + return nil + end + + local function update_jj_blame(bufnr) + if not jj_blame_enabled or not vim.api.nvim_buf_is_valid(bufnr) then + return + end + + clear_jj_blame(bufnr) + local filepath = vim.api.nvim_buf_get_name(bufnr) + local root = vcs.find_root(filepath) + if not root or not vim.uv.fs_stat(root .. '/.jj') then + return + end + + local relpath = jj_relative_path(filepath, root) + if not relpath then + return + end + + local line = vim.api.nvim_win_get_cursor(0)[1] + local template = 'self.commit().change_id().short(8) ++ " " ++ self.commit().author().name() ++ " " ++ self.commit().description().first_line() ++ "\\n"' + system_async({ 'jj', '--ignore-working-copy', 'file', 'annotate', '-r', '@', '-T', template, relpath }, root, function(lines, code) + if code ~= 0 or not vim.api.nvim_buf_is_valid(bufnr) or not jj_blame_enabled then + return + end + + local blame = lines[line] + if not blame or blame == '' then + return + end + + clear_jj_blame(bufnr) + vim.api.nvim_buf_set_extmark(bufnr, jj_blame_ns, line - 1, 0, { + virt_text = { { ' ' .. blame, 'Comment' } }, + virt_text_pos = 'eol', + hl_mode = 'combine', + }) + end) + end + + local function toggle_jj_blame() + jj_blame_enabled = not jj_blame_enabled + if not jj_blame_enabled then + for _, bufnr in ipairs(vim.api.nvim_list_bufs()) do + if vim.api.nvim_buf_is_loaded(bufnr) then + clear_jj_blame(bufnr) + end + end + else + update_jj_blame(vim.api.nvim_get_current_buf()) + end + vim.notify('jj line blame: ' .. (jj_blame_enabled and 'on' or 'off')) + end + local function map_jj_change_navigation(bufnr) if vcs.workspace_kind(bufnr) ~= 'jj' then return @@ -465,6 +531,7 @@ return { vim.keymap.set('n', '[c', function() jump_to_jj_change 'prev' end, { buffer = bufnr, desc = 'jj: previous change' }) + vim.keymap.set('n', 'tb', toggle_jj_blame, { buffer = bufnr, desc = 'Toggle jj line blame' }) end local attach = require 'jjsigns.attach' @@ -521,6 +588,15 @@ return { end, }) + vim.api.nvim_create_autocmd({ 'CursorHold', 'CursorHoldI', 'BufEnter' }, { + group = jj_blame_group, + callback = function(args) + if vcs.workspace_kind(args.buf) == 'jj' then + update_jj_blame(args.buf) + end + end, + }) + vim.keymap.set('n', 'tJ', toggle_jj_signs_base, { desc = 'Toggle jj signs base' }) end, },