add(fish): clone_repo function, tmux-vim function and bindings

This commit is contained in:
Léana 江 2023-04-01 22:27:20 +02:00
parent 67c4b31e8a
commit a801d13874
4 changed files with 40 additions and 9 deletions

View file

@ -0,0 +1,12 @@
function clone_repo
if count $argv > /dev/null
set -f name_repo (echo $argv | sd -p '.*[:/]([\w\d._-]+)/([\w\d._-]+).git$' '$1 $2')
set -f name (echo $name_repo | cut -d ' ' -f1)
set -f repo (echo $name_repo | cut -d ' ' -f2)
mkdir -p ~/repos/"$name"
git clone $argv ~/repos/"$name"/"$repo"
cd ~/repos/"$name"/"$repo"
else
echo "Please provide a git url"
end
end