mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-02-06 02:51:32 +01:00
important aliases, refactorings, all sorts
This commit is contained in:
parent
b2a9b62fa5
commit
e278d94f6f
9 changed files with 76 additions and 38 deletions
|
|
@ -1,5 +1,12 @@
|
||||||
alias kube="kubectl"
|
alias ts-resolve-host="tsunami variables resolve --unit-type host "
|
||||||
alias mk="minikube"
|
|
||||||
alias kube-list-contexts="kubectl config get-contexts"
|
function ts-variables-show() {
|
||||||
alias docker-suicide="killall com.docker.hyperkit"
|
tsunami variables show $1 $2
|
||||||
alias docker-die="killall com.docker.hyperkit"
|
}
|
||||||
|
function ts-variables-show-version() {
|
||||||
|
tsunami variables history $1 $2
|
||||||
|
}
|
||||||
|
|
||||||
|
alias tsunami-resolve-host="ts-resolve-host"
|
||||||
|
alias tsunami-variables-show="ts-variables-show"
|
||||||
|
alias tsunami-variables-show-version="ts-variables-show-version"
|
||||||
|
|
|
||||||
|
|
@ -289,22 +289,6 @@ function kube-list-prod-contexts() {
|
||||||
# \history -${NUM_LINES}
|
# \history -${NUM_LINES}
|
||||||
# }
|
# }
|
||||||
|
|
||||||
alias h="history -20"
|
|
||||||
alias gfind-filename=gfindf
|
|
||||||
|
|
||||||
alias ff='fd -t f ' # find files
|
|
||||||
alias ffa='fd -H -t f ' # find files in horrible places
|
|
||||||
|
|
||||||
alias fdd='\fd -t d ' # find directories
|
|
||||||
alias fdir='\fd -t d ' # find directories
|
|
||||||
|
|
||||||
alias fdda='\fd -H -t d ' # find directories in horrible places
|
|
||||||
|
|
||||||
alias lg='l | grep -i ' # ls grep
|
|
||||||
alias gfinda="gfind-all"
|
|
||||||
alias hg="h | grep -i "
|
|
||||||
# alias agl="ag --pager less "
|
|
||||||
|
|
||||||
function agl() {
|
function agl() {
|
||||||
ag --pager less "$@"
|
ag --pager less "$@"
|
||||||
}
|
}
|
||||||
|
|
@ -333,7 +317,7 @@ function clean-slate() {
|
||||||
alias clr=clean-slate
|
alias clr=clean-slate
|
||||||
alias cls=clean-slate
|
alias cls=clean-slate
|
||||||
|
|
||||||
function psg () {
|
function psgr() {
|
||||||
ps auwwwwx | grep -v 'grep ' | grep -E "%CPU|$1"
|
ps auwwwwx | grep -v 'grep ' | grep -E "%CPU|$1"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -366,11 +350,11 @@ function ssh-ds718() {
|
||||||
|
|
||||||
alias git-stash-list-all='gitk `git stash list --pretty=format:%gd`'
|
alias git-stash-list-all='gitk `git stash list --pretty=format:%gd`'
|
||||||
|
|
||||||
function master-protection() {
|
function master-show-protection() {
|
||||||
git branch -vv | grep "origin/`git branch --show-current`"
|
git branch -vv | grep "origin/`git branch --show-current`"
|
||||||
}
|
}
|
||||||
|
|
||||||
function git-branch() {
|
function git-show-branch() {
|
||||||
git branch -vv | grep `git branch --show-current`
|
git branch -vv | grep `git branch --show-current`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -378,40 +362,69 @@ function git-branch() {
|
||||||
alias docker-kill-latest='docker ps -l --format='{{.Names}}' | xargs docker kill'
|
alias docker-kill-latest='docker ps -l --format='{{.Names}}' | xargs docker kill'
|
||||||
|
|
||||||
# stop all containers
|
# stop all containers
|
||||||
function docker-stop-all() {
|
docker-stop-all () {
|
||||||
docker container stop -t 2 $(docker container ls -q) &
|
docker container stop -t 2 $(docker container ls -q) 2>/dev/null
|
||||||
}
|
}
|
||||||
|
|
||||||
# Launch firefox profile manager
|
function find-gig-files() {
|
||||||
function firefox-profiles() {
|
|
||||||
"/Applications/Firefox.app/Contents/MacOS/firefox-bin --profilemanager"
|
|
||||||
}
|
|
||||||
|
|
||||||
function find-all-massive-files() {
|
|
||||||
find . -size +1G -ls | sort -k7n # Find files larger than 1GB and then order the list by the file size
|
find . -size +1G -ls | sort -k7n # Find files larger than 1GB and then order the list by the file size
|
||||||
}
|
}
|
||||||
|
|
||||||
function start-cloud-storage() {
|
function _start-cloud-storage() {
|
||||||
|
bgnotify "Booting cloud sync apps..."
|
||||||
cd /Applications
|
cd /Applications
|
||||||
open Dropbox.app 2>/dev/null &
|
open Dropbox.app 2>/dev/null &
|
||||||
open Backup\ and\ Sync.app 2>/dev/null &
|
open Google\ Drive.app 2>/dev/null &
|
||||||
# Don't do this cos it downloads my backed up photos
|
# Don't do this cos it downloads my backed up photos
|
||||||
# open "Google Drive File Stream.app" 2>/dev/null &
|
# open "Google Drive File Stream.app" 2>/dev/null &
|
||||||
cd -
|
cd -
|
||||||
}
|
}
|
||||||
|
|
||||||
function tree() {
|
function start-cloud-storage() {
|
||||||
/usr/local/homebrew/bin/tree -a $1 | colorize_less
|
(
|
||||||
|
bgnotify "Waiting for local unison sync..."
|
||||||
|
/Users/peter/dotfiles_psk/bin/unison-cron-job.sh
|
||||||
|
sleep 7
|
||||||
|
_start-cloud-storage
|
||||||
|
) &
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function tree() {
|
||||||
|
/usr/local/homebrew/bin/tree -a $1 | colorize_less "$@"
|
||||||
|
}
|
||||||
|
|
||||||
|
# function open-all-edge-apps() {
|
||||||
|
# EDGE_APP_DIR='/Users/peter/Dropbox (Personal)/_Settings/Edge Apps.localized/'
|
||||||
|
# for APP in ${EDGE_APP_DIR}/*.app; do
|
||||||
|
# echo "Opening $APP ..."
|
||||||
|
# nohup open -a "$APP" &
|
||||||
|
# done
|
||||||
|
# }
|
||||||
|
|
||||||
|
function _open-all-chrome-apps() {
|
||||||
|
for APP in "${1}"/*.app; do
|
||||||
|
echo "Opening $APP ..."
|
||||||
|
nohup open -a "$APP" &
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
function open-all-chrome-apps() {
|
||||||
|
CHROME_APP_DIR='/Users/peter/Dropbox (Personal)/_Settings/Chrome Apps/Chrome Apps.localized/'
|
||||||
|
_open-all-chrome-apps "$CHROME_APP_DIR"
|
||||||
|
CHROME_APP_DIR='/Users/peter/Dropbox (Personal)/_Settings/Chrome/Chrome Apps/Chrome Apps.localized/'
|
||||||
|
_open-all-chrome-apps "$CHROME_APP_DIR"
|
||||||
|
}
|
||||||
|
|
||||||
|
alias start-all-edge-apps="open-all-edge-apps"
|
||||||
|
|
||||||
function kill-cloud-storage() {
|
function kill-cloud-storage() {
|
||||||
# TODO investigate pkill as alternative
|
# TODO investigate pkill as alternative
|
||||||
|
|
||||||
# Don't do this cos it downloads my backed up photos
|
# Don't do this cos it downloads my backed up photos
|
||||||
# killall "Google Drive File Stream" 2>/dev/null &
|
# killall "Google Drive File Stream" 2>/dev/null &
|
||||||
killall Dropbox 2>/dev/null &
|
killall Dropbox 2>/dev/null &
|
||||||
killall "Backup and Sync" 2>/dev/null &
|
|
||||||
killall "Google Drive" 2>/dev/null &
|
killall "Google Drive" 2>/dev/null &
|
||||||
|
killall -v "FinderSyncExtension" -SIGKILL &
|
||||||
}
|
}
|
||||||
|
|
||||||
# For photos, pictures, DS718
|
# For photos, pictures, DS718
|
||||||
|
|
|
||||||
|
|
@ -16,9 +16,9 @@ else
|
||||||
# isn't available, --color won't be either (they were released at the same
|
# isn't available, --color won't be either (they were released at the same
|
||||||
# time (v2.5): https://git.savannah.gnu.org/cgit/grep.git/tree/NEWS?id=1236f007
|
# time (v2.5): https://git.savannah.gnu.org/cgit/grep.git/tree/NEWS?id=1236f007
|
||||||
if grep-flags-available --color=auto --exclude-dir=.cvs; then
|
if grep-flags-available --color=auto --exclude-dir=.cvs; then
|
||||||
GREP_OPTIONS="--color=always --exclude-dir=$EXC_FOLDERS"
|
GREP_OPTIONS="--exclude-dir=$EXC_FOLDERS"
|
||||||
elif grep-flags-available --color=auto --exclude=.cvs; then
|
elif grep-flags-available --color=auto --exclude=.cvs; then
|
||||||
GREP_OPTIONS="--color=always --exclude=$EXC_FOLDERS"
|
GREP_OPTIONS="--exclude=$EXC_FOLDERS"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -n "$GREP_OPTIONS" ]]; then
|
if [[ -n "$GREP_OPTIONS" ]]; then
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,13 @@ if [ "$DISABLE_AUTO_UPDATE" != "true" ]; then
|
||||||
source $ZSH/tools/check_for_upgrade.sh
|
source $ZSH/tools/check_for_upgrade.sh
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Homebrew mentioned this so I'm doing it
|
||||||
|
export SCALA_HOME=/usr/local/homebrew/opt/scala/idea
|
||||||
|
|
||||||
|
# From Helios user guide https://github.com/spotify/helios/blob/master/docs/user_manual.md#using-the-helios-cli
|
||||||
|
alias helios='helios -z http://localhost:5801'
|
||||||
|
|
||||||
|
|
||||||
# Initializes Oh My Zsh
|
# Initializes Oh My Zsh
|
||||||
|
|
||||||
# add a function path
|
# add a function path
|
||||||
|
|
|
||||||
1
themes/agnoster-short.zsh-theme
Symbolic link
1
themes/agnoster-short.zsh-theme
Symbolic link
|
|
@ -0,0 +1 @@
|
||||||
|
/Users/peter/.oh-my-zsh/custom/themes/agnoster-short.zsh-theme
|
||||||
1
themes/agnoster-shorter.zsh-theme
Symbolic link
1
themes/agnoster-shorter.zsh-theme
Symbolic link
|
|
@ -0,0 +1 @@
|
||||||
|
/Users/peter/.oh-my-zsh/custom/themes/agnoster-shorter.zsh-theme
|
||||||
1
themes/example.zsh-theme
Symbolic link
1
themes/example.zsh-theme
Symbolic link
|
|
@ -0,0 +1 @@
|
||||||
|
/Users/peter/.oh-my-zsh/custom/themes/example.zsh-theme
|
||||||
7
tsunami-aliases.sh
Normal file
7
tsunami-aliases.sh
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
alias kube="kubectl"
|
||||||
|
alias kc="kubectl"
|
||||||
|
alias mk="minikube"
|
||||||
|
alias kube-list-contexts="kubectl config get-contexts"
|
||||||
|
alias docker-suicide="killall com.docker.hyperkit"
|
||||||
|
alias docker-die="killall com.docker.hyperkit"
|
||||||
|
alias mk="minikube"
|
||||||
1
unison-cron-job.sh
Symbolic link
1
unison-cron-job.sh
Symbolic link
|
|
@ -0,0 +1 @@
|
||||||
|
/Users/peter/dotfiles_psk/bin/unison-cron-job.sh
|
||||||
Loading…
Add table
Add a link
Reference in a new issue