From a524b71f558dcdd4f050f3e3f8a1ad2eac7443bd Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Sun, 13 Dec 2020 11:16:29 +0100 Subject: Improving feedback on clone with project-open, Updated shiftwidth=2 widht setlocal instead of set to avoid poluting the other buffers, Updated newsboat video stream with mpv to enable going forward/backward --- .newsboat/config | 5 ++++- .vimrc | 2 +- bin/project-open | 24 +++++++++++++++++------- 3 files changed, 22 insertions(+), 9 deletions(-) diff --git a/.newsboat/config b/.newsboat/config index 2818ca4..c8238c8 100644 --- a/.newsboat/config +++ b/.newsboat/config @@ -17,8 +17,11 @@ color listfocus_unread black cyan color info default black color article default default + highlight article "^(Title):.*$" blue default highlight article "https?://[^ ]+" red default highlight article "\\[image\\ [0-9]+\\]" green default -macro v set browser "youtube-dl --cookies /home/charles/youtube.com_cookies.txt -o - %u | mpv -"; open-in-browser; set browser chromium +# browser vimb + +macro v set browser "mpv %u"; open-in-browser; set browser chromium diff --git a/.vimrc b/.vimrc index 37681a0..89fb3e5 100644 --- a/.vimrc +++ b/.vimrc @@ -240,7 +240,7 @@ autocmd Filetype vim setlocal foldmethod=marker autocmd FileType haskell set formatprg=stylish-haskell -autocmd FileType lisp,html,css set shiftwidth=2 +autocmd FileType lisp,html,css setlocal shiftwidth=2 " }}} """""""""""" diff --git a/bin/project-open b/bin/project-open index 0dd5d31..955d31d 100755 --- a/bin/project-open +++ b/bin/project-open @@ -1,6 +1,7 @@ #!/bin/sh # shellcheck disable=SC2088 +# (tile does not expand in single quote) dest=$( find ~/git -mindepth 1 -maxdepth 1 -printf '%A@\t%f\n' | sort -r | @@ -15,7 +16,7 @@ dest_path="$HOME/git/$dest" if cd "$dest_path" 2> /dev/null then touch "$dest_path" - st + exec st else while [ -z "$choice" ] do @@ -27,16 +28,25 @@ else mkdir -p "$dest_path" cd "$dest_path" || exit 1 git init + exec st ;; + "clone") - url="$(echo '' | dmenu -p "Entry repository url: ")" - notify-send "Cloning $url to $dest_path" - git clone --recursive "$url" "$dest_path" || - (notify-send -u critical "Clone failed"; exit 1) - cd "$dest_path" || exit 1 + while [ -z "$remote_choice" ] + do + remote_choice=$(printf 'github.com\ncacharle.xyz\nother' | dmenu -p "Remote location") + done + case "$remote_choice" in + "github.com") prefix='git@github.com:cacharle/' ;; + "cacharle.xyz") prefix='git@cacharle.xyz:/srv/git/' ;; + "other") ;; + esac + url="$prefix$(echo "$dest" | dmenu -p "Enter repository url: $prefix")" + st -e /bin/sh -c "git clone --recursive '$url' '$dest_path' && cd '$dest_path' && exec $SHELL" || + notify-send -u critical "Could not clone $url in $dest_path" && exit 1 ;; + "cancel") exit ;; *) exit 1 ;; esac - st fi -- cgit