diff --git a/bin/tmux-edit-helper b/bin/tmux-edit-helper index f9c06c0..6a3644e 100755 --- a/bin/tmux-edit-helper +++ b/bin/tmux-edit-helper @@ -11,8 +11,9 @@ else fre --store_name "$_store" --add "$_file" fi -tmux new-window -S -n nvim \ - -e "GOPACKAGESDRIVER=$GOPACKAGESDRIVER" \ - nvim --listen "$XDG_RUNTIME_DIR/nvim.sock" +tmux select-window -t nvim 2>/dev/null || + tmux new-window -S -n nvim \ + -e "GOPACKAGESDRIVER=$GOPACKAGESDRIVER" \ + nvim --listen "$XDG_RUNTIME_DIR/nvim.sock" nvim --server "$XDG_RUNTIME_DIR/nvim.sock" --remote "$_file"