ZSH: Updated config
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
## Load config files in $ZSH/lib that for stage 3
|
## Load config files in $ZSH/lib that for stage 3
|
||||||
for config_file (${ZLIBDIR}/30-*.zsh) source $config_file
|
for config_file (${ZLIBDIR}/30-*.zsh) source $config_file
|
||||||
|
unset config_file
|
||||||
|
|
||||||
## Compile startup files
|
## Compile startup files
|
||||||
zwcautocompile
|
zwcautocompile
|
||||||
|
|||||||
@@ -2,3 +2,4 @@
|
|||||||
|
|
||||||
# Load config files in $ZSH/lib that for stage 2
|
# Load config files in $ZSH/lib that for stage 2
|
||||||
for config_file (${ZLIBDIR}/20-*.zsh) source $config_file
|
for config_file (${ZLIBDIR}/20-*.zsh) source $config_file
|
||||||
|
unset config_file
|
||||||
|
|||||||
@@ -10,12 +10,12 @@ function dc() {
|
|||||||
# Save current working directory
|
# Save current working directory
|
||||||
CURRENT_DIR="${PWD}"
|
CURRENT_DIR="${PWD}"
|
||||||
|
|
||||||
for file in $(find ${PWD} -maxdepth 2 -type f -regextype posix-extended -regex '.*(docker-compose|compose)\.ya?ml' | sort); do
|
for file in $(find "${PWD}" -maxdepth 2 -type f \( -name "docker-compose.yml" -o -name "docker-compose.yaml" -o -name "compose.yml" -o -name "compose.yaml" \) | sort); do
|
||||||
cd $(dirname "$file")
|
cd "$(dirname "$file")"
|
||||||
docker compose $@
|
docker compose "$@"
|
||||||
done
|
done
|
||||||
|
|
||||||
# Change back to saved working directory
|
# Change back to saved working directory
|
||||||
cd ${CURRENT_DIR}
|
cd "${CURRENT_DIR}"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ function extract() {
|
|||||||
echo " extract <path/file_name_1.ext> [path/file_name_2.ext] [path/file_name_3.ext]"
|
echo " extract <path/file_name_1.ext> [path/file_name_2.ext] [path/file_name_3.ext]"
|
||||||
return 1
|
return 1
|
||||||
else
|
else
|
||||||
for n in $@; do
|
for n in "$@"; do
|
||||||
if [ -f "$n" ]; then
|
if [ -f "$n" ]; then
|
||||||
case "${n%,}" in
|
case "${n%,}" in
|
||||||
*.tar.bz2 | *.tar.gz | *.tar.xz | *.tbz2 | *.tgz | *.txz | *.tar)
|
*.tar.bz2 | *.tar.gz | *.tar.xz | *.tbz2 | *.tgz | *.txz | *.tar)
|
||||||
|
|||||||
@@ -3,19 +3,19 @@
|
|||||||
function zwcautocompile() {
|
function zwcautocompile() {
|
||||||
autoload -Uz zrecompile
|
autoload -Uz zrecompile
|
||||||
|
|
||||||
for f in $(find ${ZDOTDIR} -maxdepth 3 -type f \( -name "*.zsh" -o -name ".zlogin" -o -name ".zshrc" \) ! -name "*.zwc" ! -name "*.zwc.old"); do
|
for f in $(find "${ZDOTDIR}" -maxdepth 3 -type f \( -name "*.zsh" -o -name ".zlogin" -o -name ".zshrc" \) ! -name "*.zwc" ! -name "*.zwc.old"); do
|
||||||
zrecompile -pq ${f} && rm -f ${f}.zwc.old
|
zrecompile -pq "${f}" && rm -f "${f}.zwc.old"
|
||||||
done
|
done
|
||||||
|
|
||||||
if [[ -d ${ZAUTOLOADDIR} ]]; then
|
if [[ -d "${ZAUTOLOADDIR}" ]]; then
|
||||||
for f in ${ZAUTOLOADDIR}/*; do
|
for f in "${ZAUTOLOADDIR}"/*; do
|
||||||
zrecompile -pq ${f} && rm -f ${f}.zwc.old
|
zrecompile -pq "${f}" && rm -f "${f}.zwc.old"
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -d ${ZLIBDIR} ]]; then
|
if [[ -d "${ZLIBDIR}" ]]; then
|
||||||
for f in ${ZLIBDIR}/*; do
|
for f in "${ZLIBDIR}"/*; do
|
||||||
zrecompile -pq ${f} && rm -f ${f}.zwc.old
|
zrecompile -pq "${f}" && rm -f "${f}.zwc.old"
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
function zwcpurge() {
|
function zwcpurge() {
|
||||||
autoload -Uz zrecompile
|
autoload -Uz zrecompile
|
||||||
for zsh_file in $(find ${ZDOTDIR} -maxdepth 3 -type f \( -name "*.zwc" -o -name "*.zwc.old" \)); do
|
for zsh_file in $(find "${ZDOTDIR}" -maxdepth 3 -type f \( -name "*.zwc" -o -name "*.zwc.old" \)); do
|
||||||
rm -f ${zsh_file}
|
rm -f "${zsh_file}"
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,25 +18,20 @@ fi
|
|||||||
if ! _exists fetch; then
|
if ! _exists fetch; then
|
||||||
if _exists curl; then
|
if _exists curl; then
|
||||||
alias fetch="curl -O"
|
alias fetch="curl -O"
|
||||||
elif _exists curl; then
|
elif _exists wget; then
|
||||||
alias fetch="wget"
|
alias fetch="wget"
|
||||||
else
|
else
|
||||||
echo "fetch not found."
|
echo "fetch not found."
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# htop
|
|
||||||
if _exists htop; then
|
|
||||||
alias htop="sudo htop"
|
|
||||||
fi
|
|
||||||
|
|
||||||
unfunction _exists
|
unfunction _exists
|
||||||
|
|
||||||
alias mkdir="mkdir -p"
|
alias mkdir="mkdir -p"
|
||||||
alias ..="cd .."
|
alias ..="cd .."
|
||||||
alias ...="cd ../.."
|
alias ...="cd ../.."
|
||||||
alias ....="cd ../../.."
|
alias ....="cd ../../.."
|
||||||
alias google="ping -c 10240000 google.com"
|
alias google="ping google.com"
|
||||||
alias history="history -i"
|
alias history="history -i"
|
||||||
|
|
||||||
case `uname` in
|
case `uname` in
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
if [[ -d "${ZAUTOLOADDIR}" ]]; then
|
if [[ -d "${ZAUTOLOADDIR}" ]]; then
|
||||||
|
|
||||||
fpath=($fpath ${ZAUTOLOADDIR})
|
fpath=(${ZAUTOLOADDIR} $fpath)
|
||||||
|
|
||||||
# Load functions
|
# Load functions
|
||||||
for func in ${ZAUTOLOADDIR}/*; do
|
for func in ${ZAUTOLOADDIR}/*; do
|
||||||
|
|||||||
@@ -1,16 +1,13 @@
|
|||||||
## Command history configuration
|
## Command history configuration
|
||||||
export HISTFILE="${ZCACHE}/history"
|
export HISTFILE="${ZCACHE}/history"
|
||||||
export HISTSIZE=1000000000
|
export HISTSIZE=1000000
|
||||||
export SAVEHIST=${HISTSIZE}
|
export SAVEHIST=${HISTSIZE}
|
||||||
export HISTORY_IGNORE="([bf]g *|disown|cd ..|cd -)"
|
export HISTORY_IGNORE="([bf]g *|disown|cd ..|cd -)"
|
||||||
|
|
||||||
export HISTTIMEFORMAT="[%F %T] "
|
|
||||||
setopt INC_APPEND_HISTORY
|
|
||||||
setopt EXTENDED_HISTORY
|
setopt EXTENDED_HISTORY
|
||||||
|
setopt SHARE_HISTORY
|
||||||
setopt HIST_FIND_NO_DUPS
|
setopt HIST_FIND_NO_DUPS
|
||||||
setopt hist_ignore_dups
|
setopt HIST_IGNORE_DUPS
|
||||||
setopt hist_verify
|
setopt HIST_VERIFY
|
||||||
setopt incappendhistory
|
setopt HIST_IGNORE_SPACE
|
||||||
setopt histignorespace
|
setopt HIST_NO_STORE
|
||||||
setopt histnostore
|
|
||||||
setopt share_history
|
|
||||||
@@ -10,7 +10,7 @@ setopt long_list_jobs
|
|||||||
|
|
||||||
## pager
|
## pager
|
||||||
export LC_CTYPE=$LANG
|
export LC_CTYPE=$LANG
|
||||||
export LC_ALL=de_DE.UTF-8
|
export LANG=de_DE.UTF-8
|
||||||
export IOCAGE_COLOR=TRUE
|
export IOCAGE_COLOR=TRUE
|
||||||
|
|
||||||
## Set some app specific dirs with XDM scheme
|
## Set some app specific dirs with XDM scheme
|
||||||
|
|||||||
@@ -20,11 +20,11 @@ if [[ "$OSTYPE" == darwin* ]]; then
|
|||||||
else
|
else
|
||||||
# Linux/BSD: Start ssh-agent if not running
|
# Linux/BSD: Start ssh-agent if not running
|
||||||
if ! pgrep -u "$USER" ssh-agent > /dev/null; then
|
if ! pgrep -u "$USER" ssh-agent > /dev/null; then
|
||||||
ssh-agent -t 1h > "$HOME/.ssh-agent.env"
|
( umask 077; ssh-agent -t 1h > "$HOME/.ssh-agent.env" )
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Source ssh-agent environment
|
# Source ssh-agent environment
|
||||||
if [[ ! -S ~/.ssh/ssh_auth_sock && -f "$HOME/.ssh-agent.env" ]]; then
|
if [[ ! -S "$SSH_AUTH_SOCK" && -f "$HOME/.ssh-agent.env" ]]; then
|
||||||
source "$HOME/.ssh-agent.env" >/dev/null
|
source "$HOME/.ssh-agent.env" >/dev/null
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# get zsh_unplugged and store it with your other plugins
|
# get zsh_unplugged and store it with your other plugins
|
||||||
if [[ ! -d ${ZPLUGINDIR}/zsh_unplugged ]]; then
|
if [[ ! -d ${ZPLUGINDIR}/zsh_unplugged ]]; then
|
||||||
git clone --quiet https://github.com/mattmc3/zsh_unplugged ${ZPLUGINDIR}/zsh_unplugged
|
git clone --quiet --depth 1 https://github.com/mattmc3/zsh_unplugged ${ZPLUGINDIR}/zsh_unplugged
|
||||||
fi
|
fi
|
||||||
source ${ZPLUGINDIR}/zsh_unplugged/zsh_unplugged.zsh
|
source ${ZPLUGINDIR}/zsh_unplugged/zsh_unplugged.zsh
|
||||||
|
|
||||||
|
|||||||
1
.zshenv
1
.zshenv
@@ -15,3 +15,4 @@ export ZCACHE="${XDG_CACHE_HOME}/zsh" # Cache directory for history and zcompdum
|
|||||||
|
|
||||||
# Load config files in $ZSH/lib that for stage 1
|
# Load config files in $ZSH/lib that for stage 1
|
||||||
for config_file (${ZLIBDIR}/10-*.zsh) source $config_file
|
for config_file (${ZLIBDIR}/10-*.zsh) source $config_file
|
||||||
|
unset config_file
|
||||||
|
|||||||
Reference in New Issue
Block a user