Skip to content

Commit 510292a

Browse files
Update zshrc
1 parent 2ccff97 commit 510292a

File tree

1 file changed

+130
-11
lines changed

1 file changed

+130
-11
lines changed

Dotfiles/Mac/zshrc

+130-11
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
1+
# If you come from bash you might have to change your $PATH.
2+
# export PATH=$HOME/bin:/usr/local/bin:$PATH
3+
14
# Path to your oh-my-zsh installation.
25
export ZSH="$HOME/.oh-my-zsh"
36
export PATH="$PATH:/usr/bin/ctags"
47
export PATH="$PATH:~/.vim/plugged/fzf/bin"
5-
export CPLUS_INCLUDE_PATH=/opt/homebrew/include
8+
export CPLUS_INCLUDE_PATH=/opt/homebrew/include
69
export PKG_CONFIG_PATH="/opt/homebrew/opt/jpeg/lib/pkgconfig"
10+
export PATH="$HOME/bin:$PATH"
11+
export EDITOR='nvim'
712

13+
export NVM_DIR="$HOME/.nvm"
14+
[ -s "/opt/homebrew/opt/nvm/nvm.sh" ] && \. "/opt/homebrew/opt/nvm/nvm.sh" # This loads nvm
15+
[ -s "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm" ] && \. "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm" # This loads nvm bash_completion
816

917
# Set name of the theme to load --- if set to "random", it will
1018
# load a random theme each time oh-my-zsh is loaded, in which case,
@@ -21,6 +29,55 @@ ZSH_THEME="robbyrussell"
2129
# If set to an empty array, this variable will have no effect.
2230
# ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" )
2331

32+
# Uncomment the following line to use case-sensitive completion.
33+
# CASE_SENSITIVE="true"
34+
35+
# Uncomment the following line to use hyphen-insensitive completion.
36+
# Case-sensitive completion must be off. _ and - will be interchangeable.
37+
# HYPHEN_INSENSITIVE="true"
38+
39+
# Uncomment one of the following lines to change the auto-update behavior
40+
# zstyle ':omz:update' mode disabled # disable automatic updates
41+
# zstyle ':omz:update' mode auto # update automatically without asking
42+
# zstyle ':omz:update' mode reminder # just remind me to update when it's time
43+
44+
# Uncomment the following line to change how often to auto-update (in days).
45+
# zstyle ':omz:update' frequency 13
46+
47+
# Uncomment the following line if pasting URLs and other text is messed up.
48+
# DISABLE_MAGIC_FUNCTIONS="true"
49+
50+
# Uncomment the following line to disable colors in ls.
51+
# DISABLE_LS_COLORS="true"
52+
53+
# Uncomment the following line to disable auto-setting terminal title.
54+
# DISABLE_AUTO_TITLE="true"
55+
56+
# Uncomment the following line to enable command auto-correction.
57+
# ENABLE_CORRECTION="true"
58+
59+
# Uncomment the following line to display red dots whilst waiting for completion.
60+
# You can also set it to another string to have that shown instead of the default red dots.
61+
# e.g. COMPLETION_WAITING_DOTS="%F{yellow}waiting...%f"
62+
# Caution: this setting can cause issues with multiline prompts in zsh < 5.7.1 (see #5765)
63+
# COMPLETION_WAITING_DOTS="true"
64+
65+
# Uncomment the following line if you want to disable marking untracked files
66+
# under VCS as dirty. This makes repository status check for large repositories
67+
# much, much faster.
68+
# DISABLE_UNTRACKED_FILES_DIRTY="true"
69+
70+
# Uncomment the following line if you want to change the command execution time
71+
# stamp shown in the history command output.
72+
# You can set one of the optional three formats:
73+
# "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
74+
# or set a custom format using the strftime function format specifications,
75+
# see 'man strftime' for details.
76+
# HIST_STAMPS="mm/dd/yyyy"
77+
78+
# Would you like to use another custom folder than $ZSH/custom?
79+
# ZSH_CUSTOM=/path/to/new-custom-folder
80+
2481
# Which plugins would you like to load?
2582
# Standard plugins can be found in $ZSH/plugins/
2683
# Custom plugins may be added to $ZSH_CUSTOM/plugins/
@@ -60,19 +117,33 @@ source $ZSH/oh-my-zsh.sh
60117

61118
# export NVM_DIR=~/.nvm
62119
#source $(brew --prefix nvm)/nvm.sh
120+
# zoxide
121+
eval "$(zoxide init zsh)"
122+
63123

64124
# alias
65-
alias dui='cd /Users/ts-rodrigo.diaz/Documents/PROJECTS/dynamic-ui'
125+
alias dui='cd /Users/ts-rodrigo.diaz/Documents/dynamic-ui'
66126
alias develop='git checkout develop'
67127
alias run-shop-top='DEFAULT_FEATURES=ichiba npm run app:watch-dev -- --env.pages=shop-top'
68128
alias run-item='DEFAULT_FEATURES=ichiba npm run app:watch-dev -- --env.pages=item'
129+
alias run-item-pc='DEFAULT_FEATURES=ichiba API_URL=http://rmsj-rpage-dapi-9508.rwasp-stg.hnd2.bdd.local npm run app:watch-dev -- --env.pages=item-pc'
130+
alias run-checkout0='DEFAULT_FEATURES=ichiba ENABLE_QA_ROLE=1 API_URL=http://rmsj-rpage-dapi-9508.rwasp-stg.hnd2.bdd.local npm run app:watch-dev -- --env.pages=checkout-step0'
131+
alias run-checkout2-5='DEFAULT_FEATURES=ichiba ENABLE_QA_ROLE=1 API_URL=http://rmsj-rpage-dapi-9508.rwasp-stg.hnd2.bdd.local npm run app:watch-dev -- --env.pages=checkout-step2-5'
69132
alias test-unit-all='npm run test:unit -- --all'
70133
alias build-shop-top='DEFAULT_FEATURES=ichiba npm run app:build -- --env.pages=shop-top'
71134
alias amend='git commit --amend'
135+
alias yabai-start='yabai --start-service'
72136
alias yabai-restart='brew services restart yabai'
73137
alias yabai-stop='brew services stop yabai'
74-
alias unsafe-chrome='open -n -a /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --args --user-data-dir="/Users/ts-rodrigo.diaz/InsecChrome" --disable-web-security --ignore-certificate -errors'
138+
alias unsafe-chrome='open -n -a /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --args --user-data-dir="/Users/ts-rodrigo.diaz/InsecChrome" --disable-web-security --ignore-certificate-errors'
75139
alias python3='python3.10'
140+
alias watch9502='DEFAULT_FEATURES=ichiba API_URL=http://rmsj-rpage-dapi-9502.rwasp-stg.hnd2.bdd.local npm run app:watch-dev -- --env.pages=item'
141+
alias search='bash ~/.scripts/search'
142+
alias cd='z'
143+
alias unit-test='npm run test:unit --coverage'
144+
alias e2e-run='TEST_DEVICE=DESKTOP_FULL,IPHONE_VERTICAL TEST_PROXY=http://stg.checkproxy.rakuten-it.com:9502 npm run start:dev'
145+
alias gitto-create-branch='~/bin/gitto --command create'
146+
alias reverse-proxy='mitmdump --ssl-insecure -p 9400 -s ~/reverse-proxy.py'
76147

77148
pushini () {
78149
branchName=`git branch --contains | grep '*' | awk '{print $2}'`
@@ -97,11 +168,17 @@ function commit () {
97168
}
98169

99170
function peco-history-selection() {
100-
BUFFER=`history 1 | tac | sed s/\^\ \*\[0-9\]\*//g | sed s/\^\*//g | sed s/\^\ \*//g | peco `
171+
BUFFER=`history | sk | awk '{$1=""}1'`
101172
CURSOR=$#BUFFER zle reset-prompt
102173
}
103174
zle -N peco-history-selection
104-
bindkey '^R' peco-history-selection
175+
bindkey '^H' peco-history-selection
176+
177+
function latest-branches() {
178+
`git branch --sort=-committerdate | head -n 100| awk '{print "git checkout " $0}' | sed 's/remotes\/origin\///' | peco`
179+
180+
}
181+
105182

106183
function peco-git-checkout() {
107184
BUFFER=`git branch -a | cat | sed s/\^\ \*\[0-9\]\*//g | sed s/\^\*//g | sed s/\^\ \*//g | awk '{print "git checkout " $0}' | sed 's/remotes\/origin\///' | peco`
@@ -130,11 +207,11 @@ function browser-rakuten() {
130207

131208
function test-unit() {
132209
npm run test:unit -- --"$1"
133-
210+
134211
}
135212
function watch() {
136213
npm run test:unit "--" "$1" --watch
137-
214+
138215
}
139216

140217
function create-branch() {
@@ -167,16 +244,17 @@ function create-branch() {
167244
# check if valid branch name
168245
git check-ref-format --branch "$branch"
169246
if [ $? -ne 0 ]; then
170-
# Git only handles branch names smaller than 255 chars
171-
branch="${branch:0:253}"
247+
# Git only handles branch names smaller than 128 chars
172248
echo "$branch"
173249
# Clean the name if invalid characters found
174-
branch="$(echo "$branch" | sed 's/^-.//; s/[^[:alnum:]_\-]/-/g; s/-\{2,\}/-/g; s/[^[:alnum:]]*$//')"
250+
branch="$(echo "$branch" | sed 's/[^[:alnum:][:space:]]//g; s/ /-/g; s/-\{2,\}/-/g; s/^-//; s/-$//')"
175251
echo
176252
echo "After cleaning, new name is $branch"
177253
[[ "$(echo -n 'Continue? [y/N]> ' >&2; read; echo $REPLY)" == [Yy]* ]] \
178254
&& echo ok || return 1;
179255

256+
# use only 100 chars
257+
branch="${branch:0:100}"
180258

181259
# check again, just in case
182260
git check-ref-format --branch "$branch"
@@ -187,11 +265,52 @@ function create-branch() {
187265
fi
188266

189267
# Finish
190-
git checkout -b "$branch"
268+
git checkout -b "$branch"
191269
}
192270

193271

272+
function repeat-e2e-test() {
273+
echo STARTED;
274+
for i in {1..$1};
275+
do
276+
for j in {1..3}; do
277+
echo '##########################################' REPETITION $i '################################################'; done;
278+
DEVICE=$2 npm run test:e2e -- --spec $3;
279+
done
280+
echo FINISHED;
281+
}
282+
283+
194284
# find wifi password
195285
# security find-generic-password -ga "ROUTERNAME" | grep "password:"
196286

197287
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
288+
289+
290+
# bun completions
291+
[ -s "/Users/ts-rodrigo.diaz/.bun/_bun" ] && source "/Users/ts-rodrigo.diaz/.bun/_bun"
292+
293+
# bun
294+
export BUN_INSTALL="$HOME/.bun"
295+
export PATH="$BUN_INSTALL/bin:$PATH"
296+
297+
export LANG="en_US.UTF-8"
298+
export LC_ALL="en_US.UTF-8"
299+
300+
# lfs migrate VR images
301+
migrateVRimages() {
302+
local folder_path="$1"
303+
304+
# Check if folder_path is provided
305+
if [ -z "$folder_path" ]; then
306+
echo "Error: folder_path is not provided."
307+
return 1
308+
fi
309+
310+
# Loop through each file in the folder
311+
find "$folder_path" -type f -print0 | while IFS= read -r -d $'\0' file; do
312+
git lfs migrate import --no-rewrite "$file"
313+
done
314+
}
315+
316+
export PATH="/Users/ts-rodrigo.diaz/.deno/bin:$PATH"

0 commit comments

Comments
 (0)