Compare commits

...

3 Commits

Author SHA1 Message Date
7e76e91f8b arghhahghggh 2024-11-26 21:52:02 +00:00
0693f6618d zsh abbreviations 2024-11-26 21:50:44 +00:00
d2c2bd908b zsh abbreviations 2024-11-26 21:42:37 +00:00
5 changed files with 20 additions and 75 deletions

View File

@ -0,0 +1,5 @@
abbr "bb"="blaze build"
abbr "bq"="blaze query"
abbr "br"="blaze run"
abbr "ds_clean"="find ./ -name \".DS_Store\" -depth -exec rm {} \;"
abbr "mux"="tmuxinator"

View File

@ -1,46 +1,13 @@
# alias go=colorgo export ABBR_QUIET=1
# alias cd=pushd
alias vim='nvim'
alias vimdiff='nvim -d'
# alias cat='bat'
alias ls='exa'
alias mux='tmuxinator'
alias tmux='tmux -2'
#alias go='grc -e go'
# alias ls='ls -Gp' # Colorize the ls output ##
# alias ll='ls -la' # Use a long listing format ##
# alias l.='ls -d .*' # Show hidden files ##
alias grep='grep --colour' alias grep='grep --colour'
# abbr cat='bat'
alias ls='exa'
alias tmux='tmux -2'
alias cp='cp -iv' # Preferred 'cp' implementation alias cp='cp -iv' # Preferred 'cp' implementation
alias mv='mv -iv' # Preferred 'mv' implementation alias mv='mv -iv' # Preferred 'mv' implementation
alias mkdir='mkdir -pv' # Preferred 'mkdir' implementation alias mkdir='mkdir -pv' # Preferred 'mkdir' implementation
alias cd..='cd ../' # Go back 1 directory level (for fast typers)
alias ..='cd ../' # Go back 1 directory level
alias ...='cd ../../' # Go back 2 directory levels
alias .3='cd ../../../' # Go back 3 directory levels
alias .4='cd ../../../../' # Go back 4 directory levels
alias .5='cd ../../../../../' # Go back 5 directory levels
alias .6='cd ../../../../../../' # Go back 6 directory levels
alias f='open -a Finder ./' # f: Opens current directory in MacOS Finder
alias ~="cd ~" # ~: Go Home
alias numFiles='echo $(ls -1 | wc -l)' # numFiles: Count of non-hidden files in current dir
alias make1mb='mkfile 1m ./1MB.dat' # make1mb: Creates a file of 1mb size (all zeros)
alias make5mb='mkfile 5m ./5MB.dat' # make5mb: Creates a file of 5mb size (all zeros)
alias make10mb='mkfile 10m ./10MB.dat' # make10mb: Creates a file of 10mb size (all zeros)
# Recursive directory listing
alias lr='ls -R | grep ":$" | sed -e '\''s/:$//'\'' -e '\''s/[^-][^\/]*\//--/g'\'' -e '\''s/^/ /'\'' -e '\''s/-/|/'\'' | less'
# recursively delete .DS_Store files
alias ds_clean='find ./ -name ".DS_Store" -depth -exec rm {} \;'
swap_files () { swap_files () {
tmp_name=$(TMPDIR=$(dirname -- "$1") mktemp) && tmp_name=$(TMPDIR=$(dirname -- "$1") mktemp) &&
mv -f -- "$1" "$tmp_name" && mv -f -- "$1" "$tmp_name" &&
@ -49,3 +16,4 @@ swap_files () {
} }
function zipdiff() { diff -W200 -y <(unzip -vql "$1" | sort -k8) <(unzip -vql "$2" | sort -k8); } function zipdiff() { diff -W200 -y <(unzip -vql "$1" | sort -k8) <(unzip -vql "$2" | sort -k8); }
export ABBR_QUIET=0

View File

@ -76,38 +76,11 @@ knock() {
echo "ERROR: Cannot invoke knock before gcert has been run" >&2 echo "ERROR: Cannot invoke knock before gcert has been run" >&2
fi fi
} }
sl() {
blaze build --config gmscore_arm64 //java/com/google/android/gmscore/$1:$2
# some targets end in ".apk", this prevents adding the suffix to targets that
# already have it
if [[ "$2" == *".apk"* ]]; then
adb install -d -r blaze-bin/java/com/google/android/gmscore/$1/$2
else
adb install -d -r blaze-bin/java/com/google/android/gmscore/$1/$2.apk
fi
}
sl_gms() {
sl integ GmsCore_prodnext_xxhdpi_debug
}
build_gms() { build_gms() {
blaze build --config gmscore_arm64 //java/com/google/android/gmscore/integ:GmsCore_prodnext_xxhdpi_debug blaze build --config gmscore_arm64 //java/com/google/android/gmscore/integ:GmsCore_prodnext_xxhdpi_debug
} }
cdm() { abbr cdm = "adb shell am start -n com.google.android.gms/.chimera.debug.ChimeraDebugActivity"
adb shell am start -n com.google.android.gms/.chimera.debug.ChimeraDebugActivity
}
cdp() {
adb shell am start -n com.google.android.gms/.chimera.multipackage.debug.MultiPackageDebugActivity
}
icdm() {
adb shell am start -n com.google.android.gms.isolated/com.google.android.gms.chimera.debug.ChimeraDebugActivity
}
jt() { jt() {
if [[ $PWD =~ '(.*)/javatests(.*)' ]]; then if [[ $PWD =~ '(.*)/javatests(.*)' ]]; then
@ -126,10 +99,6 @@ cl_search() {
rg --ignore-case $1 $(hg pstatus -ma -n --template= -- 2>/dev/null) rg --ignore-case $1 $(hg pstatus -ma -n --template= -- 2>/dev/null)
} }
todos() {
cl_search "TODO"
}
cl_replace() { cl_replace() {
hg status -n --change . --template= | xargs -i sh -c "sed -i '$1' {}" hg status -n --change . --template= | xargs -i sh -c "sed -i '$1' {}"
} }
@ -139,11 +108,6 @@ restart_gms() {
adb shell am broadcast -a com.google.android.gms.INITIALIZE adb shell am broadcast -a com.google.android.gms.INITIALIZE
} }
objfs_cp() {
tmp=$(mktemp) && \
fileutil cp -f $1 $tmp && unzip $tmp $2 && unlink $tmp
}
from_cloud(){ from_cloud(){
scp baggins.c.googlers.com:$1 ~/Downloads/ scp baggins.c.googlers.com:$1 ~/Downloads/
echo "Saved $1 to downloads" echo "Saved $1 to downloads"
@ -183,3 +147,7 @@ alias copybara='/google/bin/releases/copybara/public/copybara/copybara'
alias allow_ptrace='/google/bin/releases/cider/dbg/allow_ptrace' alias allow_ptrace='/google/bin/releases/cider/dbg/allow_ptrace'
alias bluze=/google/bin/releases/blueprint-bluze/public/bluze alias bluze=/google/bin/releases/blueprint-bluze/public/bluze
source /google/bin/releases/gmscore-tools/cli/prod/setup_prod_gms.sh source /google/bin/releases/gmscore-tools/cli/prod/setup_prod_gms.sh
abbr bq="blaze query"
abbr br="blaze run"
abbr bb="blaze build"

View File

@ -29,6 +29,8 @@ zplug "plugins/docker", from:oh-my-zsh;
zplug "plugins/rsync", from:oh-my-zsh; zplug "plugins/rsync", from:oh-my-zsh;
zplug "plugins/safepaste", from:oh-my-zsh; zplug "plugins/safepaste", from:oh-my-zsh;
zplug "mattberther/zsh-pyenv" zplug "mattberther/zsh-pyenv"
zplug "olets/zsh-abbr"
zplug "olets/zsh-autosuggestions-abbreviations-strategy"
zplug "Tarrasch/zsh-autoenv" # Expects .autoenv.zsh or .autoenv_leave.zsh zplug "Tarrasch/zsh-autoenv" # Expects .autoenv.zsh or .autoenv_leave.zsh
zplug "zsh-users/zsh-syntax-highlighting", defer:2 zplug "zsh-users/zsh-syntax-highlighting", defer:2
@ -49,6 +51,8 @@ fi
# Then, source plugins and add commands to $PATH # Then, source plugins and add commands to $PATH
zplug load zplug load
ZSH_AUTOSUGGEST_STRATEGY=( abbreviations $ZSH_AUTOSUGGEST_STRATEGY )
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh [[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc. # Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n] # Initialization code that may require console input (password prompts, [y/n]

View File

@ -13,7 +13,7 @@ autoload -Uz add-zsh-hook
add-zsh-hook chpwd g3path::hook add-zsh-hook chpwd g3path::hook
g3path::zle::accept-line () { g3path::zle::accept-line () {
if [[ -n $GOOGLE3_ROOT && ! $BUFFER =~ \\s*(blaze|g4|p4|g4d|add_dep|buildozer|build_cleaner|debug_android_lint|rabbit|hb|gqui|builddoctor|unused_deps|clipper|blaze_lint_refactoring|migrants_sh.sar) ]]; then if [[ -n $GOOGLE3_ROOT && ! $BUFFER =~ \\s*(bb|bq|br|blaze|g4|p4|g4d|add_dep|buildozer|build_cleaner|debug_android_lint|rabbit|hb|gqui|builddoctor|unused_deps|clipper|blaze_lint_refactoring|migrants_sh.sar) ]]; then
BUFFER=${BUFFER// \/\// $GOOGLE3_ROOT\/} BUFFER=${BUFFER// \/\// $GOOGLE3_ROOT\/}
fi fi
zle .accept-line zle .accept-line