From b40cbb40eaafd104671bbf997cc69655f8d2865e Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Fri, 25 Apr 2025 20:05:41 +0300 Subject: Update --- dotfiles/helix/config.toml | 2 +- dotfiles/scripts/copilot | 32 -------------------------------- dotfiles/scripts/hx.nvim-copilot-prompt | 32 ++++++++++++++++++++++++++++++++ 3 files changed, 33 insertions(+), 33 deletions(-) delete mode 100755 dotfiles/scripts/copilot create mode 100755 dotfiles/scripts/hx.nvim-copilot-prompt diff --git a/dotfiles/helix/config.toml b/dotfiles/helix/config.toml index d5fcc0a..1893b94 100644 --- a/dotfiles/helix/config.toml +++ b/dotfiles/helix/config.toml @@ -58,7 +58,7 @@ C-s = { e = ":set-option soft-wrap.enable true", d = ":set-option soft-wrap.enab C-q = ":buffer-close" # AI commands are good here. -C-p = { c = ":pipe aichat correct this sentence and only print out the corrected text", r = ":pipe aichat restructure and reword the input and dont leave information out and only print out the new text", a = ":pipe aichat rewrite this in a more casual style", n = ":pipe aichat these are book notes of mine. correct the grammar and re-organize the notes. use bullet points for short information and whole paragraphs for longer one. the output must be in Gemini Gemtext format with the star * as the bullet point symbol and not the minus - . dont leave out any content.", p = ":pipe hx.aichat-prompt" } +C-p = { c = ":pipe ai correct this sentence and only print out the corrected text", r = ":pipe ai restructure and reword the input and dont leave information out and only print out the new text", a = ":pipe ai rewrite this in a more casual style", n = ":pipe ai these are book notes of mine. correct the grammar and re-organize the notes. use bullet points for short information and whole paragraphs for longer one. the output must be in Gemini Gemtext format with the star * as the bullet point symbol and not the minus - . dont leave out any content.", p = ":pipe ai" } # Git commands C-g = { d = ":run-shell-command git diff", p = ":run-shell-command git pull", u = ":run-shell-command git push", t = ":run-shell-command tmux new-window -n hx-git-tig tig", c = ":run-shell-command tmux split-window -v 'git commit -a'" } diff --git a/dotfiles/scripts/copilot b/dotfiles/scripts/copilot deleted file mode 100755 index dcb2837..0000000 --- a/dotfiles/scripts/copilot +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/env zsh - -declare -r STDIN_FILE=~/.copilot_prompt_stdin.txt -declare -r INPUT_FILE=~/.copilot_chat_input.txt -declare -r OUTPUT_FILE=~/.copilot_chat_output.txt -declare INPUT_PROMPT - -if [ -f $OUTPUT_FILE.done ]; then - rm $OUTPUT_FILE.done -fi -cat > $STDIN_FILE &>/dev/null - -if [ $# -eq 0 ]; then - INPUT_PROMPT="$(hx.prompt)" -else - INPUT_PROMPT="$@" -fi - -cat < $INPUT_FILE -$INPUT_PROMPT for the following: - -$(cat $STDIN_FILE) - -If the result is code, print out the code only, don't print the \`\`\`-markers around the code block. -INPUT_FILE - -tmux split-window -v "nvim +':CopilotAsk'; mv $OUTPUT_FILE $OUTPUT_FILE.done" - -while [ ! -f "$OUTPUT_FILE.done" ]; do - sleep 0.2 -done -sed -n '/^## Copilot/,/^## User/ { /^## Copilot/d; /\[file:/d; /^## User/d; p; }' $OUTPUT_FILE.done diff --git a/dotfiles/scripts/hx.nvim-copilot-prompt b/dotfiles/scripts/hx.nvim-copilot-prompt new file mode 100755 index 0000000..dcb2837 --- /dev/null +++ b/dotfiles/scripts/hx.nvim-copilot-prompt @@ -0,0 +1,32 @@ +#!/usr/bin/env zsh + +declare -r STDIN_FILE=~/.copilot_prompt_stdin.txt +declare -r INPUT_FILE=~/.copilot_chat_input.txt +declare -r OUTPUT_FILE=~/.copilot_chat_output.txt +declare INPUT_PROMPT + +if [ -f $OUTPUT_FILE.done ]; then + rm $OUTPUT_FILE.done +fi +cat > $STDIN_FILE &>/dev/null + +if [ $# -eq 0 ]; then + INPUT_PROMPT="$(hx.prompt)" +else + INPUT_PROMPT="$@" +fi + +cat < $INPUT_FILE +$INPUT_PROMPT for the following: + +$(cat $STDIN_FILE) + +If the result is code, print out the code only, don't print the \`\`\`-markers around the code block. +INPUT_FILE + +tmux split-window -v "nvim +':CopilotAsk'; mv $OUTPUT_FILE $OUTPUT_FILE.done" + +while [ ! -f "$OUTPUT_FILE.done" ]; do + sleep 0.2 +done +sed -n '/^## Copilot/,/^## User/ { /^## Copilot/d; /\[file:/d; /^## User/d; p; }' $OUTPUT_FILE.done -- cgit v1.2.3