From a5db2b738211cba55675756ef423cf33536e31b0 Mon Sep 17 00:00:00 2001 From: Niels Mokkenstorm Date: Mon, 29 Dec 2025 21:51:04 +0100 Subject: [PATCH] Update dotfiles: tmux prefix, neovim improvements, and zsh completion fix - Change tmux prefix from Ctrl+b to Ctrl+s - Hide tmux pane borders - Add auto-open Trouble for diagnostics with debouncing - Enhance Trouble.nvim configuration (auto_close, auto_preview, focus) - Comment out LuaSnip build step - Add claudecode.nvim plugin - Fix zsh completion initialization for Claude Code sessions --- .config/nvim/init.lua | 83 +++++++++++++++++------- .config/nvim/lua/custom/plugins/init.lua | 14 +++- .tmux.conf | 10 +++ .zshrc | 4 ++ 4 files changed, 87 insertions(+), 24 deletions(-) diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index d1232a2..e90bdcc 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -122,12 +122,29 @@ vim.api.nvim_create_autocmd('TextYankPost', { end, }) +-- Auto-open Trouble for quickfix/location list operations vim.api.nvim_create_autocmd('QuickFixCmdPost', { callback = function() vim.cmd [[Trouble qflist open]] end, }) +-- Auto-open Trouble when diagnostics are found (debounced) +local diagnostic_timer = nil +vim.api.nvim_create_autocmd({ 'DiagnosticChanged' }, { + callback = function() + if diagnostic_timer then + vim.fn.timer_stop(diagnostic_timer) + end + diagnostic_timer = vim.fn.timer_start(1000, function() + local diagnostics = vim.diagnostic.get(0) + if #diagnostics > 0 then + vim.cmd [[Trouble diagnostics open filter.buf=0]] + end + end) + end, +}) + -- [[ Install `lazy.nvim` plugin manager ]] -- See `:help lazy.nvim.txt` or https://github.com/folke/lazy.nvim for more info local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim' @@ -661,15 +678,15 @@ require('lazy').setup({ -- Snippet Engine & its associated nvim-cmp source { 'L3MON4D3/LuaSnip', - build = (function() - -- Build Step is needed for regex support in snippets. - -- This step is not supported in many windows environments. - -- Remove the below condition to re-enable on windows. - if vim.fn.has 'win32' == 1 or vim.fn.executable 'make' == 0 then - return - end - return 'make install_jsregexp' - end)(), + -- build = (function() + -- -- Build Step is needed for regex support in snippets. + -- -- This step is not supported in many windows environments. + -- -- Remove the below condition to re-enable on windows. + -- if vim.fn.has 'win32' == 1 or vim.fn.executable 'make' == 0 then + -- return + -- end + -- return 'make install_jsregexp' + -- end)(), dependencies = { -- `friendly-snippets` contains a variety of premade snippets. -- See the README about individual language/framework/plugin snippets: @@ -879,23 +896,29 @@ require('lazy').setup({ }, { 'folke/trouble.nvim', - opts = {}, - cmd = 'Trouble', - modes = { - preview_float = { - mode = 'diagnostics', - preview = { - type = 'float', - relative = 'editor', - border = 'rounded', - title = 'Preview', - title_pos = 'center', - position = { 0, -2 }, - size = { width = 0.3, height = 0.3 }, - zindex = 200, + opts = { + auto_close = true, -- Auto-close when no items + auto_preview = true, -- Auto-preview item under cursor + focus = true, -- Focus Trouble window when opened + follow = true, -- Follow current file in Trouble + restore = true, -- Restore last Trouble window position + modes = { + preview_float = { + mode = 'diagnostics', + preview = { + type = 'float', + relative = 'editor', + border = 'rounded', + title = 'Preview', + title_pos = 'center', + position = { 0, -2 }, + size = { width = 0.3, height = 0.3 }, + zindex = 200, + }, }, }, }, + cmd = 'Trouble', keys = { { 'xx', @@ -927,6 +950,20 @@ require('lazy').setup({ 'Trouble qflist toggle', desc = 'Quickfix List (Trouble)', }, + { + ']t', + function() + require('trouble').next { skip_groups = true, jump = true } + end, + desc = 'Next trouble item', + }, + { + '[t', + function() + require('trouble').prev { skip_groups = true, jump = true } + end, + desc = 'Previous trouble item', + }, }, }, diff --git a/.config/nvim/lua/custom/plugins/init.lua b/.config/nvim/lua/custom/plugins/init.lua index be0eb9d..a65f8ac 100644 --- a/.config/nvim/lua/custom/plugins/init.lua +++ b/.config/nvim/lua/custom/plugins/init.lua @@ -2,4 +2,16 @@ -- I promise not to create any merge conflicts in this directory :) -- -- See the kickstart.nvim README for more information -return {} +return { + { + 'coder/claudecode.nvim', + config = function() + require('claudecode').setup { + keymaps = { + toggle_chat = 'ac', + send_selection = 'as', + }, + } + end, + }, +} diff --git a/.tmux.conf b/.tmux.conf index c7254ab..769632d 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -1,3 +1,8 @@ +# Change prefix from Ctrl+b to Ctrl+s +unbind C-b +set -g prefix C-s +bind C-s send-prefix + set -g mouse on set -ga terminal-overrides ',*256color*:smcup@:rmcup@' set -g history-limit 100000 @@ -68,5 +73,10 @@ set -g @rose_pine_status_right_append_section '#(cd #{pane_current_path} && git # Window configuration set -g @rose_pine_window_status_separator " | " +# Hide pane borders completely (must be after theme to override) +set -g pane-border-style fg=default,bg=default +set -g pane-active-border-style fg=default,bg=default +set -g pane-border-lines single + # Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf) run '~/.tmux/plugins/tpm/tpm' diff --git a/.zshrc b/.zshrc index 7edffa0..5900f1b 100644 --- a/.zshrc +++ b/.zshrc @@ -91,6 +91,10 @@ plugins=(git colorize github jira vagrant virtualenv pip python brew macos docke source $ZSH/oh-my-zsh.sh +# Force completion initialization (fixes Claude Code sessions) +autoload -Uz compinit +compinit + # Load zsh-syntax-highlighting if available if [ -f "${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" ]; then source "${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" -- 2.51.2