mirror of https://github.com/akelge/zsh
Compare commits
No commits in common. "f15438867004db919803bd58320606a293e75e10" and "221aec2b352779ce64033a6999ab1cb3427111d4" have entirely different histories.
f154388670
...
221aec2b35
|
@ -9,7 +9,7 @@ done
|
||||||
|
|
||||||
compinit -C
|
compinit -C
|
||||||
|
|
||||||
autoload bashcompinit && bashcompinit
|
# autoload bashcompinit && bashcompinit
|
||||||
# autoload bashcompinit
|
# autoload bashcompinit
|
||||||
|
|
||||||
# allow approximate
|
# allow approximate
|
||||||
|
|
|
@ -0,0 +1,30 @@
|
||||||
|
# Hooks for zsh
|
||||||
|
#
|
||||||
|
# - precmd
|
||||||
|
# - chpwd
|
||||||
|
# - preexec
|
||||||
|
# - periodic
|
||||||
|
# - zshaddhistory
|
||||||
|
# - zshexit
|
||||||
|
#
|
||||||
|
|
||||||
|
# Async Git update
|
||||||
|
autoload -Uz vcs_info
|
||||||
|
|
||||||
|
_vbe_vcs_info_done() {
|
||||||
|
local stdout=$3
|
||||||
|
vcs_info_msg_0_=$stdout
|
||||||
|
# echo $(date +"%Y-%m-%d %H:%M:%S") $PWD info $vcs_info_msg_0_ $vcs_info_msg_1_ >> ~/vcs.log
|
||||||
|
zle reset-prompt
|
||||||
|
}
|
||||||
|
|
||||||
|
_vbe_vcs_precmd() {
|
||||||
|
# echo $(date +"%Y-%m-%d %H:%M:%S") $PWD pre >> ~/vcs.log
|
||||||
|
async_flush_jobs vcs_info
|
||||||
|
async_job vcs_info _vbe_vcs_info $PWD
|
||||||
|
}
|
||||||
|
|
||||||
|
async_init
|
||||||
|
async_start_worker vcs_info
|
||||||
|
async_register_callback vcs_info _vbe_vcs_info_done
|
||||||
|
add-zsh-hook precmd _vbe_vcs_precmd
|
32
zshrc
32
zshrc
|
@ -12,30 +12,34 @@
|
||||||
# profiling data at startup
|
# profiling data at startup
|
||||||
zmodload zsh/zprof
|
zmodload zsh/zprof
|
||||||
|
|
||||||
|
function loadRC {
|
||||||
|
[ -d $1/zshfunctions ] && fpath=($1/zshfunctions $fpath)
|
||||||
|
[ -d $1/completions ] && fpath=($1/completions $fpath)
|
||||||
|
|
||||||
|
for zshFile in $1/[0-9]*.zsh; do
|
||||||
|
source $zshFile
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
# Default PATH
|
# Default PATH
|
||||||
PATH="/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:$HOME/bin"
|
PATH="/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:$HOME/bin"
|
||||||
|
|
||||||
# Determine zsh conf file position.
|
|
||||||
local BASE="/etc"
|
local BASE="/etc"
|
||||||
|
# Determine zsh conf file position. On Debian/Ubuntu is /etc/zsh, on other should be /etc
|
||||||
# On Debian/Ubuntu is /etc/zsh, on other should be /etc
|
|
||||||
[ -d /etc/zsh ] && BASE="/etc/zsh"
|
[ -d /etc/zsh ] && BASE="/etc/zsh"
|
||||||
|
|
||||||
# If there is a .zsh directory into user's home, use that one instead (local install)
|
# If there is a .zsh directory into user's home, use that one instead (local install)
|
||||||
[ -d ~/.zsh ] && BASE=~/.zsh
|
[ -d ~/.zsh ] && BASE=~/.zsh
|
||||||
|
|
||||||
|
|
||||||
|
local KERNEL=`uname -s`
|
||||||
local LIBRARY=${BASE}/zsh.d
|
local LIBRARY=${BASE}/zsh.d
|
||||||
# local KERNEL=`uname -s`
|
local KERNLIB=${LIBRARY}/${KERNEL}
|
||||||
local KERNLIB=${LIBRARY}/$(uname -s)
|
|
||||||
|
|
||||||
for lib in $LIBRARY $KERNLIB; do
|
loadRC ${KERNLIB}
|
||||||
[ -d $lib/zshfunctions ] && fpath=($lib/zshfunctions $fpath)
|
loadRC ${LIBRARY}
|
||||||
[ -d $lib/completions ] && fpath=($lib/completions $fpath)
|
|
||||||
|
|
||||||
for zshFile in $lib/[0-9]*.zsh; do
|
|
||||||
# echo $zshFile
|
|
||||||
source $zshFile
|
|
||||||
done
|
|
||||||
done
|
|
||||||
|
|
||||||
|
# # Add local customization file
|
||||||
|
# if [ -w $LIBRARY ]; then
|
||||||
|
# [ -f $LIBRARY/99-local.zsh ] || echo "# Local customizations" > $LIBRARY/99-local.zsh
|
||||||
|
# fi
|
||||||
|
|
Loading…
Reference in New Issue