-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.zshrc
94 lines (75 loc) · 3.01 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
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
export ZSH="$HOME/.oh-my-zsh"
# Standard plugins can be found in $ZSH/plugins/
# Custom plugins may be added to $ZSH_CUSTOM/plugins/
plugins=(nvm git git-extras zsh-syntax-highlighting symfony-console)
# Lazy loads nvm to speed up shell startup time
zstyle ':omz:plugins:nvm' lazy yes
# Pre oh-my-zsh user configuration
# INIT oh-my-zsh
[[ ! -f $ZSH/oh-my-zsh.sh ]] || source $ZSH/oh-my-zsh.sh
# USER CONFIG
# Compilation flags
export ARCHFLAGS="-arch $(uname -m)"
# For larger history file
HISTFILESIZE=1000000000
HISTSIZE=1000000
# INIT
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
# Fuzzy search
[ -x "$(command -v fzf)" ] && eval "$(fzf --zsh)"
# FUNCTIONS
# Fuzzy search functions
# fd - cd to selected directory
fd() {
local dir
dir=$(find ${1:-.} -path '*/\.*' -prune \
-o -type d -print 2> /dev/null | fzf +m) &&
cd "$dir"
}
# fh - search in your command history and execute selected command
fh() {
eval $( ([ -n "$ZSH_NAME" ] && fc -l 1 || history) | fzf +s --tac | sed 's/ *[0-9]* *//')
}
# ALIASES
# Development
# Symfony
alias sc='symfony console'
alias sym='symfony'
# Laravel
alias mfs='php artisan migrate:fresh --seed'
alias mfss='mfs && php artisan db:seed --class=DevSeeder'
# IPs
alias ip='curl -4 icanhazip.com'
alias ip4='curl -4 icanhazip.com'
alias ip6='curl -6 icanhazip.com'
alias iplan="ifconfig en0 inet | grep 'inet ' | awk ' { print \$2 } '"
alias ips="ifconfig -a | perl -nle'/(\d+\.\d+\.\d+\.\d+)/ && print \$1'"
alias ip4a="dig +short -4 myip.opendns.com @resolver4.opendns.com"
alias ip6a="dig +short -6 myip.opendns.com @resolver1.ipv6-sandbox.opendns.com AAAA"
# Neovim if exists
if type nvim > /dev/null; then
alias vi="nvim"
alias vim="nvim"
alias view="nvim -R"
alias vimdiff="nvim -d"
fi
# EPDS
# List EPDS AWS EC2 Instances
alias epds_ec2="aws ec2 describe-instances --query 'Reservations[].Instances[?not_null(Tags[?Key==\`Name\`].Value)]|[].[State.Name,PrivateIpAddress,PublicIpAddress,InstanceId,Tags[?Key==\`Name\`].Value[]|[0]] | sort_by(@, &[3])' --output text | sed '$!N;s/ / /'"
# Other
# Removes all Adobe stuff
alias nothankyouadobe="sudo -H killall ACCFinderSync \"Core Sync\" AdobeCRDaemon \"Adobe Creative\" AdobeIPCBroker node \"Adobe Desktop Service\" \"Adobe Crash Reporter\";sudo -H rm -rf \"/Library/LaunchAgents/com.adobe.AAM.Updater-1.0.plist\" \"/Library/LaunchAgents/com.adobe.AdobeCreativeCloud.plist\" \"/Library/LaunchDaemons/com.adobe.*.plist\""
# pnpm
export PNPM_HOME="/Users/nick/Library/pnpm"
case ":$PATH:" in
*":$PNPM_HOME:"*) ;;
*) export PATH="$PNPM_HOME:$PATH" ;;
esac
# pnpm end