82 lines
2.0 KiB
Bash
82 lines
2.0 KiB
Bash
source ~/.profile
|
|
|
|
HISTFILE=~/.histfile
|
|
HISTSIZE=100000
|
|
SAVEHIST=100000
|
|
|
|
# Permitir comentarios en la shell
|
|
setopt interactive_comments
|
|
|
|
setopt autocd extendedglob notify
|
|
bindkey -e
|
|
bindkey "^[f" forward-word
|
|
bindkey "^[b" backward-word
|
|
|
|
zmodload zsh/complist
|
|
zstyle ':completion:*' menu yes select
|
|
|
|
zstyle ':completion:*' list-dirs-first yes
|
|
zstyle ':completion:*' matcher-list '' 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
|
|
|
|
zstyle :compinstall filename ~/.zshrc
|
|
autoload -Uz compinit && compinit
|
|
|
|
# Advertencia: no es seguro entrar a carpetas desconfiables con esto...
|
|
# https://blog.sonarsource.com/securing-developer-tools-git-integrations
|
|
autoload -Uz vcs_info
|
|
zstyle ':vcs_info:*' actionformats \
|
|
'%F{4}[%F{2}%b%F{3}|%F{1}%a%F{4}]%f '
|
|
zstyle ':vcs_info:*' formats '%F{4}%b%f '
|
|
zstyle ':vcs_info:*' enable git
|
|
precmd () { vcs_info }
|
|
|
|
setopt promptsubst
|
|
PS1=$'%{\e]133;A%}''%F{5} %3~ ${vcs_info_msg_0_}%f%# '
|
|
"$REMOTE" && PS1='%n@%m '$PS1
|
|
|
|
alias ls='ls --color=always'
|
|
alias grep='grep --color=always'
|
|
|
|
alias ssh='TERM=xterm-256color ssh'
|
|
alias e="$EDITOR"
|
|
alias r="trash -r"
|
|
|
|
alias a='nohup nautilus "$(pwd)" >/dev/null &; disown'
|
|
|
|
alias g='git'
|
|
alias gc='git commit'
|
|
alias gcp='git commit -p'
|
|
alias gr='git restore'
|
|
alias grp='git restore -p'
|
|
alias gco='git checkout'
|
|
alias gl='git log'
|
|
alias gs='git status'
|
|
alias ga='git add'
|
|
alias gap='git add -p'
|
|
alias gt='git tag'
|
|
alias gp='git push'
|
|
alias gpo='git push origin' # Para tags: git push origin 1.0.2 / gpo 1.0.2
|
|
|
|
alias gitdf='git --git-dir=$HOME/.config/dotfiles/ --work-tree=$HOME'
|
|
alias gd='gitdf'
|
|
alias gdc='gitdf commit'
|
|
alias gdcp='gitdf commit -p'
|
|
alias gdl='git log'
|
|
alias gda='gitdf add'
|
|
alias gdap='gitdf add -p'
|
|
alias gds='gitdf status'
|
|
alias gdp='gitdf push'
|
|
|
|
source /usr/share/fzf/key-bindings.zsh
|
|
source ~/.config/zsh/bg_notify.zsh
|
|
! "$REMOTE" && source ~/.config/zsh/osc_7.zsh
|
|
|
|
if ! "$REMOTE"; then
|
|
unset SSH_AGENT_PID
|
|
if [ "${gnupg_SSH_AUTH_SOCK_by:-0}" -ne $$ ]; then
|
|
# Start if not started
|
|
gpg-agent --daemon 2>/dev/null
|
|
export SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)"
|
|
fi
|
|
fi
|