diff --git a/nvim/lua/plugins/claude-code.lua b/nvim/lua/plugins/claude-code.lua new file mode 100644 index 0000000..06ab8f3 --- /dev/null +++ b/nvim/lua/plugins/claude-code.lua @@ -0,0 +1,9 @@ +return { + "greggh/claude-code.nvim", + dependencies = { + "nvim-lua/plenary.nvim", -- Required for git operations + }, + config = function() + require("claude-code").setup() + end +} diff --git a/nvim/lua/plugins/lspconfig.lua b/nvim/lua/plugins/lspconfig.lua index c75f6eb..c9b11ae 100644 --- a/nvim/lua/plugins/lspconfig.lua +++ b/nvim/lua/plugins/lspconfig.lua @@ -86,7 +86,7 @@ return { settings = { gopls = { env = { - GOFLAGS = "-tags=integration,wireinject", + GOFLAGS = "-tags=integration,wireinject,!integration", }, gofumpt = true, analyses = { diff --git a/wezterm/wezterm.lua b/wezterm/wezterm.lua index 56ff900..48e51af 100644 --- a/wezterm/wezterm.lua +++ b/wezterm/wezterm.lua @@ -47,6 +47,24 @@ wezterm.on("format-tab-title", function(tab, tabs, panes, config, hover, max_wid } end) +-- Claude Code のタスクが完了したら OS 通知を飛ばす +wezterm.on('bell', function(window, pane) + local function get_tab_id(window, pane) + local mux_window = window:mux_window() + for i, tab_info in ipairs(mux_window:tabs_with_info()) do + for _, p in ipairs(tab_info.tab:panes()) do + if p:pane_id() == pane:pane_id() then + return i + end + end + end + end + local tab_title = pane:get_title() or "Unknown Tab" + + local tab_id = get_tab_id(window, pane) + window:toast_notification('Claude Code', 'Task completed (tab=' .. tab_title .. ', tab_id=' .. tab_id .. ')', nil, 4000) +end) + return { color_scheme = 'One Dark (Gogh)', use_ime = true, @@ -57,10 +75,10 @@ return { -- show_new_tab_button_in_tab_bar = false, -- show_close_tab_button_in_tabs = false, colors = { - tab_bar = { - inactive_tab_edge = "none", - }, - }, + tab_bar = { + inactive_tab_edge = "none", + }, + }, window_padding = { left = 0, right = 0, diff --git a/zsh/plugins/fzf_lazy.zsh b/zsh/plugins/fzf_lazy.zsh index 2dd0542..02aa038 100644 --- a/zsh/plugins/fzf_lazy.zsh +++ b/zsh/plugins/fzf_lazy.zsh @@ -34,10 +34,12 @@ ghq-fzf() { zle -N ghq-fzf bindkey '^p' ghq-fzf -# statingされていないfileをvimで楽に開けるようにする +# 現在のブランチで変更されたファイル(コミット済み含む)を選択 uncommited-staged-files() { # local f=$(git diff --name-only --diff-filter=d | awk '{print}' | fzf --preview 'f(){ sh -c "head -n 100 $1"}; f {}' | xargs echo) - local f=$(git status -s --no-renames | grep -v "D" | awk '{$1=$1};1' | cut -d " " -f 2 | fzf --preview 'f(){ sh -c "head -n 100 $1"}; f {}' | xargs echo) + # main/masterブランチとの差分 + 未コミットの変更を取得 + local base_branch=$(git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null | sed 's@^refs/remotes/origin/@@' || echo "master") + local f=$({ git diff --name-only ${base_branch}...HEAD --diff-filter=d; git status -s --no-renames | grep -v "D" | awk '{$1=$1};1' | cut -d " " -f 2; } | sort -u | fzf --preview 'f(){ sh -c "head -n 100 $1"}; f {}' | xargs echo) if [ -n "$f" ]; then BUFFER="vim ${f}" zle accept-line