mirror of
https://github.com/Matir/skel.git
synced 2026-05-26 05:29:09 -07:00
Reduce prezto deps.
This commit is contained in:
@@ -32,19 +32,14 @@ zstyle ':prezto:load' pmodule \
|
|||||||
'editor' \
|
'editor' \
|
||||||
'history' \
|
'history' \
|
||||||
'directory' \
|
'directory' \
|
||||||
'spectrum' \
|
|
||||||
'completion' \
|
'completion' \
|
||||||
'matir' \
|
'matir' \
|
||||||
'tmux' \
|
'tmux' \
|
||||||
'git' \
|
'git' \
|
||||||
'gpg' \
|
|
||||||
'python' \
|
'python' \
|
||||||
'ruby' \
|
|
||||||
'syntax-highlighting' \
|
'syntax-highlighting' \
|
||||||
'history-substring-search' \
|
'history-substring-search' \
|
||||||
'jekyll' \
|
'prompt'
|
||||||
'prompt' \
|
|
||||||
'xtra_completions'
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Autosuggestions
|
# Autosuggestions
|
||||||
|
|||||||
@@ -9,11 +9,6 @@ bindkey -v
|
|||||||
# Allow core files
|
# Allow core files
|
||||||
ulimit -c unlimited
|
ulimit -c unlimited
|
||||||
|
|
||||||
# Completion
|
|
||||||
zstyle :compinstall filename "${HOME}/.zshrc"
|
|
||||||
zstyle ':completion:*' users root ${USER}
|
|
||||||
autoload -Uz compinit && compinit
|
|
||||||
|
|
||||||
DIRSTACKSIZE=16
|
DIRSTACKSIZE=16
|
||||||
case $TERM in
|
case $TERM in
|
||||||
xterm*)
|
xterm*)
|
||||||
@@ -40,7 +35,6 @@ unsetopt cdablevars
|
|||||||
# Deduplicate the path
|
# Deduplicate the path
|
||||||
typeset -U path
|
typeset -U path
|
||||||
|
|
||||||
|
|
||||||
# Keybindings
|
# Keybindings
|
||||||
bindkey '^[[A' history-search-backward
|
bindkey '^[[A' history-search-backward
|
||||||
bindkey '^[[B' history-search-forward
|
bindkey '^[[B' history-search-forward
|
||||||
@@ -55,12 +49,17 @@ bindkey '^h' backward-delete-char
|
|||||||
bindkey '^w' backward-kill-word
|
bindkey '^w' backward-kill-word
|
||||||
bindkey '^r' history-incremental-search-backward
|
bindkey '^r' history-incremental-search-backward
|
||||||
|
|
||||||
|
|
||||||
# Source extras and aliases if interactive
|
# Source extras and aliases if interactive
|
||||||
if [[ $- == *i* ]] ; then
|
if [[ $- == *i* ]] ; then
|
||||||
if [[ -e $HOME/.aliases ]] ; then source $HOME/.aliases ; fi
|
if [[ -e $HOME/.aliases ]] ; then source $HOME/.aliases ; fi
|
||||||
# zsh-only-ism to avoid error if glob doesn't expand
|
# zsh-only-ism to avoid error if glob doesn't expand
|
||||||
for file in $HOME/.zshrc.d/*(N) ; do source "$file" ; done
|
for file in $HOME/.zshrc.d/*(N) ; do source "$file" ; done
|
||||||
|
# extra completions
|
||||||
|
fpath=(~/.zshrc.completions $fpath)
|
||||||
|
# Completion
|
||||||
|
zstyle :compinstall filename "${HOME}/.zshrc"
|
||||||
|
zstyle ':completion:*' users root ${USER}
|
||||||
|
autoload -Uz compinit && compinit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# In case ack is named ack-grep
|
# In case ack is named ack-grep
|
||||||
|
|||||||
44
dotfiles/zshrc.d/gpg.zsh
Normal file
44
dotfiles/zshrc.d/gpg.zsh
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
if ! which gpg-agent >/dev/null 2>&1 ; then
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Set the default paths to gpg-agent files.
|
||||||
|
_gpg_agent_conf="${GNUPGHOME:-$HOME/.gnupg}/gpg-agent.conf"
|
||||||
|
_gpg_agent_env="${TMPDIR:-/tmp}/gpg-agent.env.$UID"
|
||||||
|
|
||||||
|
# Load environment variables from previous run
|
||||||
|
source "$_gpg_agent_env" 2> /dev/null
|
||||||
|
|
||||||
|
# Start gpg-agent if not started.
|
||||||
|
if [[ -z "$GPG_AGENT_INFO" && ! -S "${GNUPGHOME:-$HOME/.gnupg}/S.gpg-agent" ]]; then
|
||||||
|
# Start gpg-agent if not started.
|
||||||
|
if ! ps -U "$LOGNAME" -o pid,ucomm | grep -q -- "${${${(s.:.)GPG_AGENT_INFO}[2]}:--1} gpg-agent"; then
|
||||||
|
eval "$(gpg-agent --daemon | tee "$_gpg_agent_env")"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Inform gpg-agent of the current TTY for user prompts.
|
||||||
|
export GPG_TTY="$(tty)"
|
||||||
|
|
||||||
|
# Integrate with the SSH module.
|
||||||
|
if grep '^enable-ssh-support' "$_gpg_agent_conf" &> /dev/null; then
|
||||||
|
# Load required functions.
|
||||||
|
autoload -Uz add-zsh-hook
|
||||||
|
|
||||||
|
# Override the ssh-agent environment file default path.
|
||||||
|
_ssh_agent_env="$_gpg_agent_env"
|
||||||
|
|
||||||
|
# Updates the GPG-Agent TTY before every command since SSH does not set it.
|
||||||
|
function _gpg-agent-update-tty {
|
||||||
|
gpg-connect-agent UPDATESTARTUPTTY /bye >/dev/null
|
||||||
|
}
|
||||||
|
add-zsh-hook preexec _gpg-agent-update-tty
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Clean up.
|
||||||
|
unset _gpg_agent_{conf,env}
|
||||||
|
|
||||||
|
# Disable GUI prompts inside SSH.
|
||||||
|
if [[ -n "$SSH_CONNECTION" ]]; then
|
||||||
|
export PINENTRY_USER_DATA='USE_CURSES=1'
|
||||||
|
fi
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
function source_gnupg {
|
|
||||||
GPG_ENV=${HOME}/.gnupg/gpg-agent.env
|
|
||||||
if test -f ${GPG_ENV} ; then
|
|
||||||
eval $(sed 's/^/export /' ${GPG_ENV})
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user