From eb1f6b2e8bc037c6aa3eb30bad014dd0c5b3b671 Mon Sep 17 00:00:00 2001 From: Hadi <112569860+anotherhadi@users.noreply.github.com> Date: Tue, 1 Apr 2025 20:22:23 +0200 Subject: [PATCH] new function for copying text to chatgpt --- home/programs/shell/zsh.nix | 52 +++++++++++++++++++++++-------------- 1 file changed, 32 insertions(+), 20 deletions(-) diff --git a/home/programs/shell/zsh.nix b/home/programs/shell/zsh.nix index fd430f7..76e0793 100644 --- a/home/programs/shell/zsh.nix +++ b/home/programs/shell/zsh.nix @@ -17,28 +17,40 @@ in { }; historySubstringSearch.enable = true; - initExtraFirst = '' - bindkey -e - ${if fetch == "neofetch" then - pkgs.neofetch + "/bin/neofetch" - else if fetch == "nerdfetch" then - "nerdfetch" - else if fetch == "pfetch" then - "echo; ${pkgs.pfetch}/bin/pfetch" - else - ""} + initExtraFirst = + #bash + '' + bindkey -e + ${if fetch == "neofetch" then + pkgs.neofetch + "/bin/neofetch" + else if fetch == "nerdfetch" then + "nerdfetch" + else if fetch == "pfetch" then + "echo; ${pkgs.pfetch}/bin/pfetch" + else + ""} - function sesh-sessions() { - session=$(sesh list -t -c | fzf --height 70% --reverse) - [[ -z "$session" ]] && return - sesh connect $session - } + function sesh-sessions() { + session=$(sesh list -t -c | fzf --height 70% --reverse) + [[ -z "$session" ]] && return + sesh connect $session + } - zle -N sesh-sessions - bindkey -M emacs '\es' sesh-sessions - bindkey -M vicmd '\es' sesh-sessions - bindkey -M viins '\es' sesh-sessions - ''; + function chatgptlist(){ + for arg in "$@"; do + echo "$arg:" + echo "\`\`\`" + cat "$arg" + echo "\`\`\`" + echo + done + } + + zle -N sesh-sessions + bindkey -M emacs '\es' sesh-sessions + bindkey -M vicmd '\es' sesh-sessions + bindkey -M viins '\es' sesh-sessions + ''; history = { ignoreDups = true;