-
Notifications
You must be signed in to change notification settings - Fork 0
/
.zshrc
136 lines (100 loc) · 4.41 KB
/
.zshrc
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
if [[ -s "${ZDOTDIR:-$HOME}/.zprezto/init.zsh" ]]; then
source "${ZDOTDIR:-$HOME}/.zprezto/init.zsh"
fi
if [[ -z `command -v thefuck` ]]; then eval $(thefuck --alias); fi
if [[ -z `command -v hub` ]]; then alias git="hub"; fi
if [[ `uname -s` == "Darwin" ]]; then
alias uuu="mas upgrade && brew update && brew upgrade && softwareupdate -ia"
export OPEN_ON_MAKE_EDITOR="open -a \"PhpStorm\""
else
alias uuu="sudo apt update && sudo apt upgrade -y && sudo apt autoremove -y && flatpak update -y"
fi
export DENO_INSTALL="$HOME/.deno"
export PATH="$PATH:$HOME/.composer/vendor/bin"
export PATH="$PATH:$HOME/.config/composer/vendor/bin"
export PATH="$PATH:$HOME/.config/npm/bin"
export PATH="$PATH:$HOME/ThirdPartyRepos/flutter/bin"
export PATH="$PATH:$HOME/.local/bin"
export PATH="$PATH:$HOME/.symfony/bin"
[[ -d "$DENO_INSTALL" ]] && export PATH="$PATH:$DENO_INSTALL/bin"
[[ -s "$HOME/.gvm/scripts/gvm" ]] && source "$HOME/.gvm/scripts/gvm"
# disable homebrew anonymous analytics
# https://github.com/Homebrew/brew/blob/master/docs/Analytics.md
export HOMEBREW_NO_ANALYTICS=1
export HOMEBREW_NO_INSECURE_REDIRECT=1
# export HOMEBREW_CASK_OPTS=--require-sha
DUSK_CHROME_BINARY=/Applications/Chromium.app/Contents/MacOS/Chromium
function set-git-gh-remote() {
if [[ $# -eq 1 ]]; then
gitRemote="origin"
ghRepo="$1"
elif [[ $# -eq 2 ]]; then
gitRemote="$1"
ghRepo="$2"
else
echo "Usage: $0 {GitRemoteName} <GitHubRepoName>"
return -1
fi
git remote add $gitRemote `gh repo view $ghRepo --json sshUrl --jq ".sshUrl"`
}
# PHP Versions
alias p72="/Users/binota/Library/Application\\ Support/Herd/bin/php72"
alias p74="/Users/binota/Library/Application\\ Support/Herd/bin/php74"
alias p81="/Users/binota/Library/Application\\ Support/Herd/bin/php81"
alias c72="/Users/binota/Library/Application\\ Support/Herd/bin/php72 `which composer`"
alias c74="/Users/binota/Library/Application\\ Support/Herd/bin/php74 `which composer`"
alias c81="/Users/binota/Library/Application\\ Support/Herd/bin/php81 `which composer`"
alias a72="/Users/binota/Library/Application\\ Support/Herd/bin/php72 artisan"
alias a74="/Users/binota/Library/Application\\ Support/Herd/bin/php74 artisan"
alias a81="/Users/binota/Library/Application\\ Support/Herd/bin/php81 artisan"
# Aliases
alias a="php artisan"
alias afs="a migrate:fresh && a db:seed"
alias sail="./vendor/bin/sail"
alias s="./vendor/bin/sail"
alias sa="./vendor/bin/sail artisan"
alias sat="./vendor/bin/sail artisan tinker"
alias safs="sa migrate:fresh && sa db:seed"
alias sc="./vendor/bin/sail composer"
alias c="composer"
alias g="git"
alias gsm="git switch main"
alias gsd="git switch dev"
function _autodetect_dockercompose_file_flag {
compose_file=""
if [[ -f "docker-compose.yml" ]]; then
compose_file="docker-compose.yml"
elif [[ -f "docker-compose.yaml" ]]; then
compose_file="docker-compose.yaml"
elif [[ -f "docker/docker-compose.yml" ]]; then
compose_file="docker/docker-compose.yml"
elif [[ -f "docker/docker-compose.yaml" ]]; then
compose_file="docker/docker-compose.yaml"
fi
if [[ -n $compose_file ]]; then
echo "-f ${compose_file}"
fi
}
function _autodetect_dockercompose {
docker compose $(_autodetect_dockercompose_file_flag) $@
}
alias dcu="_autodetect_dockercompose up -d"
alias dcd="_autodetect_dockercompose down"
alias dcr="_autodetect_dockercompose run --rm"
alias com="_autodetect_dockercompose"
alias "??"="gh copilot suggest"
alias "?"="gh copilot explain"
# Herd injected PHP binary.
export PATH="/Users/binota/Library/Application Support/Herd/bin/":$PATH
# Herd injected PHP 8.1 configuration.
export HERD_PHP_81_INI_SCAN_DIR="/Users/binota/Library/Application Support/Herd/config/php/81/"
# Herd injected PHP 8.2 configuration.
export HERD_PHP_82_INI_SCAN_DIR="/Users/binota/Library/Application Support/Herd/config/php/82/"
# Herd injected PHP 8.3 configuration.
export HERD_PHP_83_INI_SCAN_DIR="/Users/binota/Library/Application Support/Herd/config/php/83/"
# Herd injected PHP 7.4 configuration.
export HERD_PHP_74_INI_SCAN_DIR="/Users/binota/Library/Application Support/Herd/config/php/74/"
# Herd injected NVM configuration
export NVM_DIR="/Users/binota/Library/Application Support/Herd/config/nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[[ -f "/Applications/Herd.app/Contents/Resources/config/shell/zshrc.zsh" ]] && builtin source "/Applications/Herd.app/Contents/Resources/config/shell/zshrc.zsh"