From e8078f3e6fadc850fae71b077d4a491d4a12cbef Mon Sep 17 00:00:00 2001 From: xeruf <27jf@pm.me> Date: Tue, 26 Apr 2022 13:26:22 +0200 Subject: [PATCH] config/shell: improve some script documentation --- .config/doom/user.el##user.janek | 2 +- .config/shell/browse | 2 +- .local/bin/scripts/git-fork | 7 +++++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.config/doom/user.el##user.janek b/.config/doom/user.el##user.janek index 3ecca9b..2bd8009 100644 --- a/.config/doom/user.el##user.janek +++ b/.config/doom/user.el##user.janek @@ -24,5 +24,5 @@ (add-to-list 'recentf-exclude "writing\\/tug") (add-to-list 'recentf-exclude "\\.\\(sync\\|stversions\\|stfolder\\)") (add-to-list 'recentf-list (expand-file-name "4-incubator/downloads/" user-data-dir)) - ;(setq recentf-keep '(recentf-keep-default-predicate file-remote-p)) + (setq recentf-keep '(recentf-keep-default-predicate file-remote-p "/ssh:.*")) ) diff --git a/.config/shell/browse b/.config/shell/browse index 099382f..da1a3a4 100644 --- a/.config/shell/browse +++ b/.config/shell/browse @@ -53,7 +53,7 @@ cd() { # LOCATE {{{1 # TODO no double heading with bat -alias fselect='fzf -0 -1 --reverse --height=30% | while read f; do test -d "$f" && cd "$f" || { highlight "$f" && b "$f" }; done' +alias fselect='fzf -0 -1 --reverse --height=30% | while read f; do test -d "$f" && cd "$f" || { highlight "$f" && print -s "b $f" && b "$f" }; done' loci() { locate --all --ignore-case --basename --existing "$@" | command grep --extended-regexp --ignore-case --color=always $(echo "$|${@:$#}" | sed 's/ /|/g') | diff --git a/.local/bin/scripts/git-fork b/.local/bin/scripts/git-fork index bcb5a9b..8ee3192 100755 --- a/.local/bin/scripts/git-fork +++ b/.local/bin/scripts/git-fork @@ -1,11 +1,14 @@ -#!/bin/sh -e +#!/bin/bash -e # Clones a fork and sets a corresponding upstream # ARGS # - repo name (omit if setting upstream in existing repo) # - upstream user -# - local user +# - own user # - url # - target directory name (and further arguments to clone) +# In an existing repo, first arg is omitted +test $# -eq 0 && echo "Usage: $0 [repo] [upstream owner] [own user] [url]" && exit 2 +# TODO check from subdir if test -d ".git" then repo="$(basename "$PWD")" git remote set-url origin "$(git-repo "${3:-github.com}" "$repo" "$2" "${@:4}")"