From a35425537be690d264b85568907d4916641d4d29 Mon Sep 17 00:00:00 2001 From: Tyrel Souza Date: Wed, 2 Feb 2022 15:46:51 -0500 Subject: [PATCH] shell_funcs --- config/nvim/init.vim | 1 + shell_funcs | 87 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 88 insertions(+) create mode 100644 shell_funcs diff --git a/config/nvim/init.vim b/config/nvim/init.vim index b5edc1a..8048d98 100644 --- a/config/nvim/init.vim +++ b/config/nvim/init.vim @@ -27,6 +27,7 @@ call plug#begin('~/.vim/plugged') Plug 'nanotech/jellybeans.vim' Plug 'sickill/vim-monokai' Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'} + Plug 'flebel/vim-mypy', { 'for': 'python', 'branch': 'bugfix/fast_parser_is_default_and_only_parser' } call plug#end() lua << EOF diff --git a/shell_funcs b/shell_funcs new file mode 100644 index 0000000..79a5007 --- /dev/null +++ b/shell_funcs @@ -0,0 +1,87 @@ +#!/usr/local/bin/zsh +export EDITOR=nvim +export VISUAL=nvim +# Aliases +alias ag='\ag --pager="less -r"' +alias c='\cat' +alias cat='bat' +alias cg='cd "$(git rev-parse --show-toplevel)"' +alias pg='pushd "$(git rev-parse --show-toplevel)"' +alias fuckingip="curl https://wtfismyip.com/json" +alias g='git' +alias gp='git push -u' +alias httpie="http" +alias ibrew="arch -x86_64 /usr/local/bin/brew" +alias ls="exa -lhFgxUm --git --time-style long-iso --group-directories-first" +alias ppjson="python -m json.tool" +alias shrug="echo -n '¯\_(ツ)_/¯' | pbcopy" +alias vimini="vim ~/.config/nvim/init.vim" + +# Functions +function cpbr () { + if branch=$(git symbolic-ref --short -q HEAD) + then + printf "$branch" | pbcopy + osascript -e "display notification \"$branch copied to clipboard\" with title \"cpbr\"" + else + echo "no branch, can't copy" + fi +} +function hidden() { ls -a "$@" | grep '^\.'; } +function h () { + if [ -z "$*" ] + then + history + else + history | egrep "$@" + fi +} +function pulldep() { git pull; bundle; bundle exec rake db:migrate; } + +settitle () { + echo -ne "\033]0;"$*"\007" +} + + +pullall (){ + for d in ./*/ ; do (cd "$d" && pwd && git pull); done +} + +new_dock_space (){ + defaults write com.apple.dock persistent-apps -array-add '{"tile-type"="spacer-tile";}'; killall Dock +} + +poweruser (){ + aws sso login --profile=poweruser +} +powerpip (){ + aws codeartifact login --tool pip --repository internal --domain eq-remarketing --profile poweruser +} + +kubestaging () { + kubectl config use-context shared1-east1-us-staging + kubectl config set-context --current --namespace=remarketing +} + +kubeprod () { + kubectl config use-context shared1-east1-us-prod + kubectl config set-context --current --namespace=remarketing +} +setup_crypto () { + # Needed for cryptography + export LDFLAGS="$LDFLAGS -L$(brew --prefix openssl@1.1)/lib" + export CFLAGS="$CFLAGS -I$(brew --prefix openssl@1.1)/include" +} + +brew_venv_39 () { + $(brew --cellar python@3.9)/3.9.10/bin/python3 -m venv venv +} +brew_venv_37 () { + /usr/local/opt/python@3.7/bin/python3 -m venv venv +} + + +legacybin () { + docker exec -it legacy /bin/bash +} +