josemidev24 revised this gist 6 hours ago. Go to revision
1 file changed, 51 insertions
.zshrc(file created)
| @@ -0,0 +1,51 @@ | |||
| 1 | + | # Homebrew | |
| 2 | + | export HOMEBREW_PREFIX="$HOME/homebrew" | |
| 3 | + | export HOMEBREW_HOME="$HOMEBREW_PREFIX/bin" | |
| 4 | + | export PATH="$HOMEBREW_HOME:$PATH" | |
| 5 | + | ||
| 6 | + | # Zsh Plugins | |
| 7 | + | source $HOMEBREW_PREFIX/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh | |
| 8 | + | source $HOMEBREW_PREFIX/share/zsh-autosuggestions/zsh-autosuggestions.zsh | |
| 9 | + | ||
| 10 | + | # Starship | |
| 11 | + | eval "$(starship init zsh)" | |
| 12 | + | ||
| 13 | + | # Fnm | |
| 14 | + | eval "$(fnm env --use-on-cd --shell zsh)" | |
| 15 | + | ||
| 16 | + | # Aliases | |
| 17 | + | alias sc="source ~/.zshrc" | |
| 18 | + | alias date="print -z Current time is $(date)" | |
| 19 | + | alias home="cd $HOME" | |
| 20 | + | alias dev="cd $HOME/Workspace" | |
| 21 | + | ||
| 22 | + | # Aliases As Inline Function | |
| 23 | + | # alias zshconfig='f(){ $@ ~/.zshrc; }; f' | |
| 24 | + | ||
| 25 | + | # Or Complete Definition Function | |
| 26 | + | zshconfig () { | |
| 27 | + | # Define el editor por defecto y una lista de editores permitidos. | |
| 28 | + | local editor="${1:-nvim}" | |
| 29 | + | local valid_editors=("nvim" "code" "nano" "vim") | |
| 30 | + | ||
| 31 | + | # Verifica si el editor solicitado es válido; si no, usa el predeterminado. | |
| 32 | + | if [[ ! " ${valid_editors[@]} " =~ " ${editor} " ]]; then | |
| 33 | + | editor="nvim" | |
| 34 | + | fi | |
| 35 | + | ||
| 36 | + | # Abre el archivo de configuración. | |
| 37 | + | "$editor" "$HOME/.zshrc" | |
| 38 | + | } | |
| 39 | + | ||
| 40 | + | # Alias GIT | |
| 41 | + | alias gconfig="nvim ~/.gitconfig" | |
| 42 | + | alias gs="git status" | |
| 43 | + | alias gi="git init" | |
| 44 | + | alias gall="git add ." | |
| 45 | + | alias gfetch="git fetch -a" | |
| 46 | + | alias gpull="git pull" | |
| 47 | + | alias gpush="git push" | |
| 48 | + | alias gcom='f(){ git commit -m "$@"; }; f' | |
| 49 | + | ||
| 50 | + | # Added by Antigravity | |
| 51 | + | export PATH="/Users/josemidev/.antigravity/antigravity/bin:$PATH" | |
Newer
Older