From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 19726 invoked from network); 29 Oct 2020 11:07:59 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 29 Oct 2020 11:07:59 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1603969679; b=LXCavcSvLr1oLCjC8QArylMmNHVOIXrSVDyHFaNUz2w12PeqnJORovKQOm6lliCAdwx7TiNnfl eNwY6KNeEqZ02jxYBFJMTfOT4f5KLVIUiInva4jrVrNgTUkitvLHQdS+883a2JnU3ndevJGRkf xR5R3dQSYvcjz+jPqssWgedYpW+WAsmnXgH8uQ6JcnbP+1gEv+MYVSw98faxnhc6TTPanhgsmN fazzsTNloH7fTQepEG5ck+9oBzkJ5dKNICmzC+OPeoDbEBKmT8pfCtZpx2GVK8EsDFB3ZLPei/ qi3m2Ly5NmMVKD9HVlOk8lutOuF5icx+6TX08J8g0T97AQ==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail.covisp.net) smtp.remote-ip=65.121.55.42; dmarc=none header.from=covisp.net; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20200801; t=1603969679; bh=b2Hf8kLU+VmdICHtOo4Mfk2zqQpKK/RDkDvGZO2xkNo=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:To:References:Message-ID:Content-Transfer-Encoding:Date: In-Reply-To:From:Subject:Content-Type:DKIM-Signature; b=P5fJyT/+GgHav4ERP8zzc3MElm0YOTlE4TeQgS8dQFtppWuqzC7KxwdTZNzc5mT9dlrUWD95nk AUGG71CgpnAZO1vhiCvte85wLpM1nfUT+DVHQ/PSC56fQGDEVeeRSRRTU3LTOKD1rP8xt8yx34 eeKXkebxysoxU/nFU0OkvA0AYWq3F4APJoqMrls4s4/mq8B5dvXk/MWqfI6eYF8acEt0UkYwUR /eQGquzWSFxsRFDdfKpBGrKQiTxkbkW56HqDfqaBe9BBlrJCzuMLhZaDVHkyeA7fV7N6NEXKPa KF+T6st3QKHDxYSAxteA89ZLbc4nS8UhRq8AP+G34TeQUQ==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20200801; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:To:References:Message-Id: Content-Transfer-Encoding:Date:In-Reply-To:From:Subject:Content-Type:Reply-To :Cc:MIME-Version:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=YEPKIoJpQ/ydl+nk8K/v6Fnc4tPe8rfbfcjS9mTpLzo=; b=QGiAYveawUzaTvYyYl11PLrxFL fCupMD13dIAEPGnMfok/vOy++JjjKMFn/Kf0euw1Wrk6xu6FHmCLaXPOg50ZLnWDXxoiL5wVRhbVc KqOFFLWdNzKvSdG2Ry+XYn1nYI+b8IDtGQUoF0hfRc3Wapd6wwpXw/saQYQrWPzxOpphCa10fggBc ahq01NTl+5Ld9hFCiS6mCb4uEy468DeqsFwz9ZN6YhXN9lhoDzALfB70gMKzd5d4DJRpCFyRpAV45 KaeY2kiA1u8Ps3L9y/fvnAuZ0xP9YV1O+8mCNu/xOtKDOrEbQWA/4NPXi581KrLBLIyULj0pyFGjV grUfAz1A==; Received: from authenticated user by zero.zsh.org with local id 1kY5mb-000A7f-Hh; Thu, 29 Oct 2020 11:07:53 +0000 Authentication-Results: zsh.org; iprev=pass (mail.covisp.net) smtp.remote-ip=65.121.55.42; dmarc=none header.from=covisp.net; arc=none Received: from mail.covisp.net ([65.121.55.42]:17082) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1kY5m3-0009lJ-N8; Thu, 29 Oct 2020 11:07:21 +0000 Content-Type: text/plain; charset=utf-8 Subject: Re: save a command in history from within the widget From: Lewis Butler In-Reply-To: Date: Thu, 29 Oct 2020 05:07:16 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: <0E85AE23-69A6-41EB-AC00-8EEF5587DF03@covisp.net> References: To: Zsh Users X-Mailer: Apple Mail (2.3654.0.3.2.82) X-Seq: 26139 Archived-At: X-Loop: zsh-users@zsh.org Errors-To: zsh-users-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-users-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: Archived-At: On 24 Oct 2020, at 13:00, Ahmad Ismail wrote: > I am currently working on a widget. It is used so that I can use my = git alias also for my dotfiles. This is, to me, very advanced zsh and while reading through it I am = still not exactly sure what it does or what the purpose is. > The widget is given bellow: >=20 > function _check-if-dotfile-command { >=20 > if [[ $BUFFER =3D~ ^"g d untrack-all" ]] > then > zle .kill-whole-line > BUFFER=3D"g d rm --cached -r ~" > zle .accept-line > elif [[ $BUFFER =3D~ ^"g d add-and-commit" ]] > then=20 > BUFFERz=3D$(echo $BUFFER | cut -d '"' -f2) > zle .kill-whole-line > BUFFER=3D"git d add ~ && g d commit -am \"${BUFFERz}\"" > zle .accept-line > elif [[ $BUFFER =3D~ ^"g d sb" ]] > then=20 > zle .kill-whole-line > BUFFER=3D"git d branch | rofi -dmenu | xargs git checkout" > zle .accept-line > elif [[ $BUFFER =3D~ ^"g d stash-and-reset" ]] > then=20 > zle .kill-whole-line > BUFFER=3D"git d stash && git d reset --hard HEAD" > zle .accept-line > elif [[ $BUFFER =3D~ ^"g d last" ]] > then=20 > zle .kill-whole-line > BUFFER=3D"git d --no-pager log -1 --oneline" > zle .accept-line > else > zle .accept-line > fi=20 > } >=20 > zle -N accept-line _check-if-dotfile-command I currently have a directory named ~/.shell which is a git repo for all = the various . Files in my home folder (via hard links). What is the = widget intended to do and how is it triggered? (I realize you've moved away from this widget, but what were you trying = for). --=20 =C9=B9=D7=9F=CA=87nq=D7=9F tel:+1.303.219.0564