-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcommands.zsh
67 lines (58 loc) · 1.62 KB
/
commands.zsh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# Commands
# Lazygit
lg() {
export LAZYGIT_NEW_DIR_FILE=~/.lazygit/newdir
lazygit "$@"
if [ -f $LAZYGIT_NEW_DIR_FILE ]; then
cd "$(cat $LAZYGIT_NEW_DIR_FILE)"
rm -f $LAZYGIT_NEW_DIR_FILE > /dev/null
fi
}
phpv() {
valet stop
brew link --force --overwrite $1
brew services start $1
composer global update
rm -f ~/.config/valet/valet.sock
valet install
}
myip() {
ifconfig | grep "inet " | grep -Fv 127.0.0.1 | awk '{print $2}'
}
# alias php74="phpv [email protected]"
# alias php80="phpv [email protected]"
alias php81="phpv [email protected]"
alias php82="phpv [email protected]"
composer-link() {
composer config repositories.local '{"type": "path", "url": "'$1'"}' --file composer.json
}
function stage {
SOURCE_BRANCH="$(git rev-parse --abbrev-ref HEAD)"
echo "pull existing changes..." &&
git pull &&
echo "checking out staging..." &&
git checkout staging &&
echo "pulling staging..." &&
git pull
echo "merging $SOURCE_BRANCH.." &&
git merge $SOURCE_BRANCH --no-edit &&
echo "pushing to staging..." &&
git push &&
echo "checkout back to $SOURCE_BRANCH" &&
git checkout $SOURCE_BRANCH
}
# Zellij
function zr () { zellij run --name "$*" -- zsh -ic "$*";}
function zrf () { zellij run --name "$*" --floating -- zsh -ic "$*";}
function zri () { zellij run --name "$*" --in-place -- zsh -ic "$*";}
function ze () { zellij edit "$*";}
function zef () { zellij edit --floating "$*";}
function zei () { zellij edit --in-place "$*";}
function zpipe () {
if [ -z "$1" ]; then
zellij pipe;
else
zellij pipe -p $1;
fi
}