diff options
| author | Charles Cabergs <me@cacharle.xyz> | 2020-12-13 11:16:29 +0100 |
|---|---|---|
| committer | Charles Cabergs <me@cacharle.xyz> | 2020-12-13 11:16:29 +0100 |
| commit | a524b71f558dcdd4f050f3e3f8a1ad2eac7443bd (patch) | |
| tree | 6e8dab807ee65acbe6c507f086ecba2f5c2d00e1 | |
| parent | ef554a4c34fde7b66c13bc97f8168e432353ed7c (diff) | |
| download | dotfiles-a524b71f558dcdd4f050f3e3f8a1ad2eac7443bd.tar.gz dotfiles-a524b71f558dcdd4f050f3e3f8a1ad2eac7443bd.tar.bz2 dotfiles-a524b71f558dcdd4f050f3e3f8a1ad2eac7443bd.zip | |
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
| -rw-r--r-- | .newsboat/config | 5 | ||||
| -rw-r--r-- | .vimrc | 2 | ||||
| -rwxr-xr-x | 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 @@ -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 |
