From 1dc978f1c1a4464ce1c9dada56af8caec72f48c4 Mon Sep 17 00:00:00 2001 From: Jan Andrle Date: Thu, 28 Mar 2024 11:36:28 +0100 Subject: [PATCH] =?UTF-8?q?:zap:=20`m`=20instead=20of=20`cd.`=20+=20`?= =?UTF-8?q?=C2=A7time.mjs`=20completion?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .bash/.bash_aliases | 7 ++++--- .config/nodejsscript/completions.json | 18 +++++++++++++++++- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/.bash/.bash_aliases b/.bash/.bash_aliases index cd75416..b254606 100644 --- a/.bash/.bash_aliases +++ b/.bash/.bash_aliases @@ -45,12 +45,13 @@ history_most_used(){ LC_ALL=C cat ~/.bash_history | cut -d ';' -f 2- | §awk 1 | alias §less='less -R -S' -cd.(){ +m(){ [[ -z "$1" ]] && return 1 + local n="m$1" + [[ -z "${!n}" ]] || return 1 [[ -z "$2" ]] && local p="$(pwd)" || local p="$(readlink -f $2)" - alias cd.$1="cd ${p}"; + export $n="$p" } -alias m='cd.' alias cd-vifm='cd `vifm --choose-dir -`' mkcd(){ mkdir -p -- "$1" && cd -P -- "$1"; } diff --git a/.config/nodejsscript/completions.json b/.config/nodejsscript/completions.json index d6ffcf5..b43d19b 100644 --- a/.config/nodejsscript/completions.json +++ b/.config/nodejsscript/completions.json @@ -32,6 +32,22 @@ "--help", "--version" ] + }, + "§time.mjs": { + "npx": false, + "completions": { + "diff": [ + "--unit" + ], + "?": "diff", + "zone": [ + "--z" + ] + }, + "completions_all": [ + "--help", + "--version" + ] } } -} +} \ No newline at end of file