97 lines
No EOL
3 KiB
Bash
97 lines
No EOL
3 KiB
Bash
# Set up the prompt
|
|
|
|
autoload -Uz promptinit
|
|
promptinit
|
|
prompt adam1
|
|
|
|
setopt histignorealldups sharehistory
|
|
|
|
#-------------------------------------------------------------
|
|
# Keybindings
|
|
#-------------------------------------------------------------
|
|
|
|
bindkey '^H' backward-kill-word
|
|
bindkey '^F' forward-word
|
|
bindkey '^B' backward-word
|
|
# Use emacs keybindings even if our EDITOR is set to vi
|
|
bindkey -e
|
|
|
|
# Keep 1000 lines of history within the shell and save it to ~/.zsh_history:
|
|
HISTSIZE=1000
|
|
SAVEHIST=1000
|
|
HISTFILE=~/.zsh_history
|
|
|
|
# Use modern completion system
|
|
autoload -U compinit promptinit zcalc zsh-mime-setup
|
|
compinit
|
|
promptinit
|
|
zsh-mime-setup
|
|
|
|
zstyle ':completion:*' auto-description 'specify: %d'
|
|
zstyle ':completion:*' completer _expand _complete _correct _approximate
|
|
zstyle ':completion:*' format 'Completing %d'
|
|
zstyle ':completion:*' group-name ''
|
|
zstyle ':completion:*' menu select=2
|
|
eval "$(dircolors -b)"
|
|
zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS}
|
|
zstyle ':completion:*' list-colors ''
|
|
zstyle ':completion:*' list-prompt %SAt %p: Hit TAB for more, or the character to insert%s
|
|
zstyle ':completion:*' matcher-list '' 'm:{a-z}={A-Z}' 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=* l:|=*'
|
|
zstyle ':completion:*' menu select=long
|
|
zstyle ':completion:*' select-prompt %SScrolling active: current selection at %p%s
|
|
zstyle ':completion:*' use-compctl false
|
|
zstyle ':completion:*' verbose true
|
|
|
|
zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#)*=0=01;31'
|
|
zstyle ':completion:*:kill:*' command 'ps -u $USER -o pid,%cpu,tty,cputime,cmd'
|
|
|
|
# Load aliases
|
|
if [ -f ~/.zsh/zshalias ]; then
|
|
source ~/.zsh/zshalias
|
|
else
|
|
print "404: ~/.zsh/zshalias not found."
|
|
fi
|
|
|
|
eval `ssh-agent -s` && ssh-agent
|
|
ssh-add .ssh/tlc_gitlab
|
|
|
|
#-------------------------------------------------------------
|
|
# Prompt bits
|
|
#-------------------------------------------------------------
|
|
# Initialize colors.
|
|
autoload -U colors
|
|
colors
|
|
|
|
# Allow for functions in the prompt.
|
|
setopt PROMPT_SUBST
|
|
|
|
# Autoload zsh functions.
|
|
fpath=(~/.zsh/functions $fpath)
|
|
autoload -U ~/.zsh/functions/*(:t)
|
|
|
|
# Enable auto-execution of functions.
|
|
typeset -ga preexec_functions
|
|
typeset -ga precmd_functions
|
|
typeset -ga chpwd_functions
|
|
|
|
# Append git functions needed for prompt.
|
|
preexec_functions+='preexec_update_git_vars'
|
|
precmd_functions+='precmd_update_git_vars'
|
|
chpwd_functions+='chpwd_update_git_vars'
|
|
|
|
# For terminix / tilix
|
|
if [[ $TERMINIX_ID ]]; then
|
|
source /etc/profile.d/vte.sh
|
|
fi
|
|
|
|
# Set the prompt.
|
|
#PROMPT=$'%{${fg[cyan]}%}%B%~%b$(prompt_git_info)%{${fg[default]}%} '
|
|
PROMPT=$'%{${fg[magenta]}%}%n%{$reset_color%}\@%{$fg[blue]%}%m%{$reset_color%} %{${fg[cyan]}%}%B%~%b$(prompt_git_info)%{${fg[default]}%} %{$fg[blue]%}%%%{$reset_color%} '
|
|
|
|
# Export stuff for sshfs over VPN
|
|
echo "SSH_AGENT_PID=$SSH_AGENT_PID; export SSH_AGENT_PID;" >~/.thestuff
|
|
echo "SSH_AUTH_SOCK=$SSH_AUTH_SOCK; export SSH_AUTH_SOCK;" >>~/.thestuff
|
|
|
|
#ssh-agent
|
|
# Export key file to agent keychain
|
|
keychain --agents ssh --quick --quiet --noask /home/tracey/.ssh/* |