Last active
October 4, 2022 14:17
-
-
Save mrroot5/91661b21245c52822628e42f5e9bf301 to your computer and use it in GitHub Desktop.
Zsh alias. Asegúrate de que en .zshrc se hace referencia a este fichero, mira el ejemplo.Ambos ficheros deben estar en la home.
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
# Functions | |
# | |
# System functions | |
# | |
find_kill_process() { | |
# This function shows the process list and search on it | |
# Requires fzf available | |
pid=$(ps -ef | sed 1d | eval "fzf $FZF_DEFAULT_OPTS -m --header='[kill:process]'" | awk '{print $2}') | |
if [ ! -z "$pid" ] | |
then | |
if [ -z "$1" ] | |
then | |
kill $pid | |
else | |
kill $1 $pid | |
fi | |
fi | |
} | |
# End system functions | |
# Git functions | |
# | |
git_merge_develop() { | |
if [ -z "$1" ] | |
then | |
git merge --log develop | |
else | |
git merge --log $1 | |
fi | |
} | |
# End git function | |
# | |
# Virtualenv functions | |
# | |
init_virtualenv() { | |
if [ -z "$1" ] | |
then | |
. env/bin/activate | |
else | |
. $1/bin/activate | |
fi | |
} | |
close_virtualenv() { | |
deactivate | |
} | |
# End virtualenv functions | |
# | |
# Alias List | |
# | |
# System | |
alias ls='ls -lah' | |
alias kp=find_kill_process | |
# | |
# Git | |
alias gmodl=git_merge_develop | |
alias kp=find_kill_process | |
# | |
# Virtualenv | |
alias onenv=init_virtualenv | |
alias offenv=close_virtualenv |
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
# Add at bottom of .zshrc | |
if [ -f ~/.zsh_aliases ]; then | |
source ~/.zsh_aliases | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment