60 lines
949 B
Text
60 lines
949 B
Text
|
#!/usr/bin/bash
|
||
|
|
||
|
################
|
||
|
# ALIASES #
|
||
|
################
|
||
|
|
||
|
# TMUX things.
|
||
|
|
||
|
# Lists all sessions
|
||
|
alias ts="tmux ls"
|
||
|
|
||
|
# Attaches to session with name $1
|
||
|
alias ta="tmux attach -t $1"
|
||
|
|
||
|
# Create new session with provided name.
|
||
|
alias tm="tmux new -s $1"
|
||
|
|
||
|
# VIM/NVIM things.
|
||
|
|
||
|
# All roads lead to nvim.
|
||
|
alias vim=nvim
|
||
|
alias v=nvim
|
||
|
|
||
|
##############
|
||
|
# FUNCTIONS #
|
||
|
##############
|
||
|
|
||
|
# Autoupdates the env setup.
|
||
|
function env_autoupdate {
|
||
|
SHELL_CONFIG_PATH=""
|
||
|
|
||
|
if [[ -n $(echo $SHELL | grep zsh) ]]; then
|
||
|
SHELL_CONFIG_PATH="$HOME/.zshrc"
|
||
|
else
|
||
|
SHELL_CONFIG_PATH="$HOME/.bashrc"
|
||
|
fi
|
||
|
|
||
|
|
||
|
{
|
||
|
cd ~/.env_goodies
|
||
|
git pull
|
||
|
source $SHELL_CONFIG_PATH
|
||
|
cd -
|
||
|
}
|
||
|
|
||
|
}
|
||
|
|
||
|
# Inspects available aliases based on a grep query.
|
||
|
function which_alias {
|
||
|
alias | grep $1
|
||
|
}
|
||
|
|
||
|
#############
|
||
|
# EXPORTS #
|
||
|
#############
|
||
|
|
||
|
# Ensures that passphrases can be entered when signing
|
||
|
# git commits.
|
||
|
export GPG_TTY=$(tty)
|