-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
118 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# chezmoi aliases & utils | ||
|
||
# based from: https://github.com/mass8326/zsh-chezmoi | ||
|
||
# Ensure chezmoi is available | ||
[[ $+commands[chezmoi] ]] || return 0 | ||
|
||
# Completion | ||
source <(chezmoi completion zsh) | ||
|
||
# Status | ||
alias cm="chezmoi" | ||
alias cmd="chezmoi diff" | ||
alias cmcd="chezmoi cd" | ||
alias cmst="chezmoi status" | ||
alias cmdoc="chezmoi doctor" | ||
|
||
# Editing source | ||
alias cma="chezmoi add" | ||
alias cmr="chezmoi re-add" | ||
alias cme="chezmoi edit" | ||
alias cmea="chezmoi edit --apply" | ||
alias chcd="chezmoi cd" | ||
|
||
# Updating target | ||
alias cmap="chezmoi apply" | ||
alias cmup="chezmoi update" | ||
alias cmug="chezmoi upgrade" | ||
|
||
# git | ||
alias cmg="chezmoi git" | ||
|
||
|
||
# helpers | ||
alias zshrc="chezmoi edit --apply ~/.zshrc && omz reload" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# one password function | ||
|
||
function op.signin() { | ||
eval $(op signin) | ||
} | ||
|
||
function op.ensure_signedin() { | ||
op whoami >/dev/null 2>&1 | ||
retVal=$? | ||
if [ $retVal -ne 0 ]; then | ||
op.signin | ||
fi | ||
} | ||
|
||
function ssh-add.load_keys() { | ||
op.ensure_signedin | ||
echo "loading specified keys from 1Password" | ||
# load all specified ssh-keys | ||
ssh-add - <<< `op read "op://Keys/20221016_mudiarto_at_gmail_com/id_ed25519"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
################################################################################# | ||
# tmux | ||
################################################################################ | ||
|
||
alias tm='tmux' | ||
|
||
# new session-name | ||
alias tm-new='tmux new -A -s' | ||
alias tmn='tmux new -A -s' | ||
|
||
# join session-name | ||
# note - this will detach others connected to the current session | ||
alias tm-join='tmux attach -d -t' | ||
alias tmj='tmux attach -d -t' | ||
|
||
# ls | ||
alias tm-ls='tmux ls' | ||
alias tml='tmux ls' | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Description: Utility functions | ||
|
||
# make directory and cd into it | ||
function mcd () { | ||
mkdir -v -p $1 | ||
cd $1 | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters