Modified zshrc
This commit is contained in:
parent
b65f69da7e
commit
c54f7cccf1
105
.zshrc
105
.zshrc
@ -17,13 +17,26 @@
|
|||||||
|
|
||||||
##History
|
##History
|
||||||
HISTFILE=~/.zsh_history
|
HISTFILE=~/.zsh_history
|
||||||
HISTSIZE=25000
|
HISTSIZE=100000
|
||||||
SAVEHIST=12500
|
SAVEHIST=50000
|
||||||
setopt INC_APPEND_HISTORY
|
setopt INC_APPEND_HISTORY
|
||||||
setopt incappendhistory
|
setopt incappendhistory
|
||||||
setopt sharehistory
|
setopt sharehistory
|
||||||
setopt HIST_REDUCE_BLANKS
|
setopt HIST_REDUCE_BLANKS
|
||||||
setopt HIST_IGNORE_ALL_DUPS
|
setopt HIST_IGNORE_ALL_DUPS
|
||||||
|
setopt appendhistory
|
||||||
|
setopt autocd
|
||||||
|
setopt beep
|
||||||
|
setopt nomatch
|
||||||
|
setopt correct
|
||||||
|
setopt noclobber
|
||||||
|
setopt prompt_subst
|
||||||
|
setopt notify
|
||||||
|
unsetopt extendedglob
|
||||||
|
bindkey -v
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# make history searchable with ctrl-r
|
# make history searchable with ctrl-r
|
||||||
bindkey "^r" history-incremental-search-backward
|
bindkey "^r" history-incremental-search-backward
|
||||||
|
|
||||||
@ -37,11 +50,9 @@ export VISUAL=$EDITOR
|
|||||||
# export GITEA_TOKEN=a2a8542ad8fcf4de4156e9b5a83c09f826e53dc0
|
# export GITEA_TOKEN=a2a8542ad8fcf4de4156e9b5a83c09f826e53dc0
|
||||||
# export GITEA_TOKEN=55fa045ffdc1ffabbabcdc429e353e4883b04b17
|
# export GITEA_TOKEN=55fa045ffdc1ffabbabcdc429e353e4883b04b17
|
||||||
##Alias
|
##Alias
|
||||||
|
export SSH_AUTH_SOCK=/home/nick/.bitwarden-ssh-agent.sock
|
||||||
source ~/.alias
|
source ~/.alias
|
||||||
|
|
||||||
setopt appendhistory autocd beep nomatch correct noclobber
|
|
||||||
unsetopt extendedglob notify
|
|
||||||
bindkey -v
|
|
||||||
|
|
||||||
zstyle :compinstall filename '/home/nick/.zshrc'
|
zstyle :compinstall filename '/home/nick/.zshrc'
|
||||||
|
|
||||||
@ -74,15 +85,28 @@ if [ -f "/usr/share/doc/pkgfile/command-not-found.zsh" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
#eval 'keychain --eval id_ed25519'
|
# The following lines were added by compinstall
|
||||||
if [[ -f /usr/bin/keychain ]] then
|
|
||||||
keychain --agents gpg,ssh id_ed25519 31936033 github_rsa
|
zstyle ':completion:*' completer _expand _complete _ignored _correct _approximate
|
||||||
[ -z "$HOSTNAME" ] && HOSTNAME=`uname -n`
|
zstyle ':completion:*' format ''\''Completing %d'\'''
|
||||||
[ -f $HOME/.keychian/$HOSTNAME-sh ]
|
zstyle ':completion:*' max-errors 3 numeric
|
||||||
source $HOME/.keychain/$HOSTNAME-sh ]
|
zstyle ':completion:*' prompt 'Errors '\''%e'\'''
|
||||||
[ -f $HOME/.keychain/$HOSTNAME-sh-gpg ]
|
zstyle :compinstall filename '/home/nick/.zshrc'
|
||||||
source $HOME/.keychain/$HOSTNAME-sh-gpg
|
|
||||||
fi
|
autoload -Uz compinit
|
||||||
|
compinit
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# #eval 'keychain --eval id_ed25519'
|
||||||
|
# if [[ -f /usr/bin/keychain ]]; then
|
||||||
|
# keychain --agents gpg,ssh id_ed25519 31936033 github_rsa
|
||||||
|
# [ -z "$HOSTNAME" ] && HOSTNAME=`uname -n`
|
||||||
|
# [ -f $HOME/.keychian/$HOSTNAME-sh ]
|
||||||
|
# source $HOME/.keychain/$HOSTNAME-sh ]
|
||||||
|
# [ -f $HOME/.keychain/$HOSTNAME-sh-gpg ]
|
||||||
|
# source $HOME/.keychain/$HOSTNAME-sh-gpg
|
||||||
|
# fi
|
||||||
|
|
||||||
##Prompt
|
##Prompt
|
||||||
|
|
||||||
@ -100,22 +124,10 @@ else
|
|||||||
%#"
|
%#"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
###Alias
|
|
||||||
#alias aurup="cd ~/AUR && echo $PWD && cower -ubddf --color" #AUR Update
|
|
||||||
#alias aurSs="cd ~/AUR && cower -s --color" #Search AUR
|
|
||||||
#alias aurS="cd ~/AUR && cower -dd --color" #Download PKGBUILD and depends
|
|
||||||
#ZFS Related #zfs, and zpool both set to NOPASSWD via sudoers file
|
|
||||||
#alias zfs="sudo zfs"
|
|
||||||
#alias zpool="sudo zpool"
|
|
||||||
#alias scrub="sudo zpool scrub" #preforms scrub
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Adapted from code found at <https://gist.github.com/1712320>.
|
|
||||||
|
|
||||||
setopt prompt_subst
|
|
||||||
# Modify the colors and symbols in these variables as desired.
|
# Modify the colors and symbols in these variables as desired.
|
||||||
#GIT_PROMPT_SYMBOL="%{$fg[blue]%}±"
|
GIT_PROMPT_SYMBOL="%{$fg[blue]%}±"
|
||||||
GIT_PROMPT_PREFIX="%{$fg[green]%}[%{$reset_color%}"
|
GIT_PROMPT_PREFIX="%{$fg[green]%}[%{$reset_color%}"
|
||||||
GIT_PROMPT_SUFFIX="%{$fg[green]%}]%{$reset_color%}"
|
GIT_PROMPT_SUFFIX="%{$fg[green]%}]%{$reset_color%}"
|
||||||
GIT_PROMPT_AHEAD="%{$fg[red]%}ANUM%{$reset_color%}"
|
GIT_PROMPT_AHEAD="%{$fg[red]%}ANUM%{$reset_color%}"
|
||||||
@ -176,7 +188,7 @@ git_prompt_string() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
## alt-s inserts "sudo" at start of line
|
## alt-s inserts "sudo" at start of line
|
||||||
insert_sudo () { zle beginning-of-line; zle -U "sudo " }
|
insert_sudo() { zle beginning-of-line; zle -U "sudo " }
|
||||||
zle -N insert-sudo insert_sudo
|
zle -N insert-sudo insert_sudo
|
||||||
bindkey "^[s" insert-sudo
|
bindkey "^[s" insert-sudo
|
||||||
|
|
||||||
@ -187,12 +199,37 @@ RPS1='$(git_prompt_string)'
|
|||||||
# Created by `pipx` on 2025-03-03 18:34:12
|
# Created by `pipx` on 2025-03-03 18:34:12
|
||||||
export PATH="$PATH:/home/nick/.local/bin"
|
export PATH="$PATH:/home/nick/.local/bin"
|
||||||
|
|
||||||
|
# show_venv() {
|
||||||
|
# if [[ -n "$VIRTUAL_ENV" && -n "$DIRENV_DIR" ]]; then
|
||||||
|
# echo "($(basename $VIRTUAL_ENV))"
|
||||||
|
# fi
|
||||||
|
# }
|
||||||
|
#PS1='$(show_venv)'$PS1
|
||||||
|
|
||||||
# requires direnv to be installed
|
# requires direnv to be installed
|
||||||
eval "$(direnv hook zsh)"
|
eval "$(direnv hook zsh)"
|
||||||
|
|
||||||
show_venv() {
|
## UNTESTED NEEDS REVIEW
|
||||||
if [[ -n "$VIRTUAL_ENV" && -n "$DIRENV_DIR" ]]; then
|
# SHOULD Allow > / >> to auto create directories
|
||||||
echo "($(basename $VIRTUAL_ENV))"
|
# # This function will be called before executing any command
|
||||||
fi
|
# preexec() {
|
||||||
}
|
# # Match something like > ~/path/to/file or >> ~/path/to/file
|
||||||
RPS1='$(show_venv)'$RPS1
|
# if [[ "$1" =~ '>>?\s*(~?/.+)' ]]; then
|
||||||
|
# local outfile=${match[1]}
|
||||||
|
# # Expand ~ to full path
|
||||||
|
# outfile=${outfile/#\~/$HOME}
|
||||||
|
# local outdir=$(dirname "$outfile")
|
||||||
|
|
||||||
|
# if [[ ! -d "$outdir" ]]; then
|
||||||
|
# echo "Output redirection to: $outfile"
|
||||||
|
# echo -n "Directory '$outdir' does not exist. Create it? [Y/n]: "
|
||||||
|
# read -r reply
|
||||||
|
# if [[ -z "$reply" || "$reply" =~ ^[Yy] ]]; then
|
||||||
|
# mkdir -p "$outdir"
|
||||||
|
# echo "✅ Created $outdir"
|
||||||
|
# else
|
||||||
|
# echo "❌ Skipped creating directory. Command might fail."
|
||||||
|
# fi
|
||||||
|
# fi
|
||||||
|
# fi
|
||||||
|
# }
|
||||||
|
Loading…
Reference in New Issue
Block a user