Compare commits
3 Commits
03c791b8d6
...
7e76e91f8b
Author | SHA1 | Date | |
---|---|---|---|
7e76e91f8b | |||
0693f6618d | |||
d2c2bd908b |
5
config/.config/zsh-abbr/user-abbreviations
Normal file
5
config/.config/zsh-abbr/user-abbreviations
Normal 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"
|
@ -1,46 +1,13 @@
|
||||
# alias go=colorgo
|
||||
# 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 ##
|
||||
|
||||
export ABBR_QUIET=1
|
||||
alias grep='grep --colour'
|
||||
# abbr cat='bat'
|
||||
alias ls='exa'
|
||||
alias tmux='tmux -2'
|
||||
|
||||
alias cp='cp -iv' # Preferred 'cp' implementation
|
||||
alias mv='mv -iv' # Preferred 'mv' 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 () {
|
||||
tmp_name=$(TMPDIR=$(dirname -- "$1") mktemp) &&
|
||||
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); }
|
||||
export ABBR_QUIET=0
|
||||
|
@ -76,38 +76,11 @@ knock() {
|
||||
echo "ERROR: Cannot invoke knock before gcert has been run" >&2
|
||||
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() {
|
||||
blaze build --config gmscore_arm64 //java/com/google/android/gmscore/integ:GmsCore_prodnext_xxhdpi_debug
|
||||
}
|
||||
|
||||
cdm() {
|
||||
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
|
||||
}
|
||||
abbr cdm = "adb shell am start -n com.google.android.gms/.chimera.debug.ChimeraDebugActivity"
|
||||
|
||||
jt() {
|
||||
if [[ $PWD =~ '(.*)/javatests(.*)' ]]; then
|
||||
@ -126,10 +99,6 @@ cl_search() {
|
||||
rg --ignore-case $1 $(hg pstatus -ma -n --template= -- 2>/dev/null)
|
||||
}
|
||||
|
||||
todos() {
|
||||
cl_search "TODO"
|
||||
}
|
||||
|
||||
cl_replace() {
|
||||
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
|
||||
}
|
||||
|
||||
objfs_cp() {
|
||||
tmp=$(mktemp) && \
|
||||
fileutil cp -f $1 $tmp && unzip $tmp $2 && unlink $tmp
|
||||
}
|
||||
|
||||
from_cloud(){
|
||||
scp baggins.c.googlers.com:$1 ~/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 bluze=/google/bin/releases/blueprint-bluze/public/bluze
|
||||
source /google/bin/releases/gmscore-tools/cli/prod/setup_prod_gms.sh
|
||||
|
||||
abbr bq="blaze query"
|
||||
abbr br="blaze run"
|
||||
abbr bb="blaze build"
|
||||
|
@ -29,6 +29,8 @@ zplug "plugins/docker", from:oh-my-zsh;
|
||||
zplug "plugins/rsync", from:oh-my-zsh;
|
||||
zplug "plugins/safepaste", from:oh-my-zsh;
|
||||
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 "zsh-users/zsh-syntax-highlighting", defer:2
|
||||
@ -49,6 +51,8 @@ fi
|
||||
# Then, source plugins and add commands to $PATH
|
||||
zplug load
|
||||
|
||||
ZSH_AUTOSUGGEST_STRATEGY=( abbreviations $ZSH_AUTOSUGGEST_STRATEGY )
|
||||
|
||||
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
|
||||
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
|
||||
# Initialization code that may require console input (password prompts, [y/n]
|
||||
|
@ -13,7 +13,7 @@ autoload -Uz add-zsh-hook
|
||||
add-zsh-hook chpwd g3path::hook
|
||||
|
||||
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\/}
|
||||
fi
|
||||
zle .accept-line
|
||||
|
Reference in New Issue
Block a user