diff --git a/home/dot_claude/commands/commit-staged.md b/home/dot_claude/commands/commit-staged.md index 8bd63cf..a76226e 100644 --- a/home/dot_claude/commands/commit-staged.md +++ b/home/dot_claude/commands/commit-staged.md @@ -1,5 +1,5 @@ --- -allowed-tools: Bash(git commit:*) +allowed-tools: Bash(git commit:*), Bash(commit-helper:*) argument-hint: [optional custom instructions] description: Commit currently staged changes with an appropriate message --- diff --git a/home/dot_config/kitty/buffer-select.lua b/home/dot_config/kitty/buffer-select.lua new file mode 100644 index 0000000..322442e --- /dev/null +++ b/home/dot_config/kitty/buffer-select.lua @@ -0,0 +1,42 @@ +-- Simple buffer selection mode for Kitty + +-- Function to copy selection via xclip and quit +local function copy_and_quit() + -- Yank to default register + vim.cmd('normal! y') + -- Get yanked text + local text = vim.fn.getreg('"') + -- Send to xclip + vim.fn.system('xclip -selection clipboard', text) + -- Quit + vim.cmd('quit!') +end + +-- Visual mode: y copies selection and quits +vim.keymap.set('v', 'y', copy_and_quit) + +-- Normal mode: y copies current line and quits +vim.keymap.set('n', 'y', function() + vim.cmd('normal! V') + copy_and_quit() +end) + +-- Quit bindings +vim.keymap.set({'n', 'v'}, 'q', function() vim.cmd('quit!') end) +vim.keymap.set({'n', 'v'}, '', function() vim.cmd('quit!') end) + +-- Quick select-all and copy: 'a' in normal mode +vim.keymap.set('n', 'a', function() + vim.cmd('normal! ggVG') + copy_and_quit() +end) + +-- Disable line numbers +vim.opt.number = false +vim.opt.relativenumber = false + +-- Go to bottom +vim.cmd('normal! G') + +-- Show help +print('j/k move, V select, / search, y copy+quit, a all+copy, q/Esc quit') diff --git a/home/dot_config/kitty/private_kitty.conf b/home/dot_config/kitty/private_kitty.conf index 031ccfe..7ccf02c 100644 --- a/home/dot_config/kitty/private_kitty.conf +++ b/home/dot_config/kitty/private_kitty.conf @@ -11,3 +11,15 @@ notify_on_cmd_finish never # Claude Code: Enable Shift+Enter for multi-line prompts map shift+enter send_text all \n + +# Copy last command output directly to clipboard +map ctrl+shift+o launch --stdin-source=@last_cmd_output --type=overlay bash -c "xclip -selection clipboard && echo 'Copied last command output to clipboard!'" + +# Copy visible screen content to clipboard (works in any window including overlays) +map ctrl+shift+y launch --allow-remote-control --type=background bash -c "kitten @ get-text --match state:focused --extent screen | xclip -selection clipboard" + +# Open last command output in Neovim for easy selection (starts in visual line mode) +map ctrl+shift+g launch --stdin-source=@last_cmd_output --type=overlay nvim -u NONE -c "luafile ~/.config/kitty/buffer-select.lua" - + +# Open full scrollback in Neovim for easy selection (starts in visual line mode) +map ctrl+shift+f launch --stdin-source=@screen_scrollback --type=overlay nvim -u NONE -c "luafile ~/.config/kitty/buffer-select.lua" -