mirror of
https://codeberg.org/leana8959/.files.git
synced 2025-12-06 22:59:15 +00:00
add(fish): clone_repo function, tmux-vim function and bindings
This commit is contained in:
parent
67c4b31e8a
commit
a801d13874
4 changed files with 40 additions and 9 deletions
12
.config/fish/functions/clone_repo.fish
Normal file
12
.config/fish/functions/clone_repo.fish
Normal 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue