reformat code, stylistic changes
This commit is contained in:
@@ -1,44 +1,44 @@
|
||||
# HSTR configuration - add this to ~/.zshrc
|
||||
if command -v hstr >/dev/null 2>&1; then
|
||||
alias hh="hstr" # hh to be alias for hstr
|
||||
setopt histignorespace # skip cmds w/ leading space from history
|
||||
export HSTR_CONFIG="hicolor" # get more colors
|
||||
hstr_no_tiocsti() {
|
||||
zle -I
|
||||
{ HSTR_OUT="$( { </dev/tty hstr ${BUFFER}; } 2>&1 1>&3 3>&- )"; } 3>&1;
|
||||
BUFFER="${HSTR_OUT}"
|
||||
CURSOR="${#BUFFER}"
|
||||
zle redisplay
|
||||
}
|
||||
zle -N hstr_no_tiocsti
|
||||
bindkey '\C-r' hstr_no_tiocsti
|
||||
export HSTR_TIOCSTI=n
|
||||
alias hh="hstr" # hh to be alias for hstr
|
||||
setopt histignorespace # skip cmds w/ leading space from history
|
||||
export HSTR_CONFIG="hicolor" # get more colors
|
||||
hstr_no_tiocsti() {
|
||||
zle -I
|
||||
{ HSTR_OUT="$( { </dev/tty hstr ${BUFFER}; } 2>&1 1>&3 3>&- )"; } 3>&1;
|
||||
BUFFER="${HSTR_OUT}"
|
||||
CURSOR="${#BUFFER}"
|
||||
zle redisplay
|
||||
}
|
||||
zle -N hstr_no_tiocsti
|
||||
bindkey '\C-r' hstr_no_tiocsti
|
||||
export HSTR_TIOCSTI=n
|
||||
else
|
||||
bindkey '\C-r' history-incremental-search-backward
|
||||
bindkey '\C-r' history-incremental-search-backward
|
||||
fi
|
||||
|
||||
# better ls
|
||||
if command -v eza >/dev/null 2>&1; then
|
||||
alias ll="eza -bghHlS"
|
||||
alias ll="eza -bghHlS"
|
||||
else
|
||||
alias ll="exa -bghHlS"
|
||||
alias ll="exa -bghHlS"
|
||||
fi
|
||||
|
||||
# bat (debian)
|
||||
if command -v batcat >/dev/null 2>&1; then
|
||||
alias bat=batcat
|
||||
alias bat="batcat"
|
||||
fi
|
||||
|
||||
# ranger
|
||||
ranger_cd() {
|
||||
temp_file=$(mktemp -t "ranger_cd.XXXXXXXXXX")
|
||||
ranger --choosedir="${temp_file}" -- "${@:-${PWD}}"
|
||||
if chosen_dir=$(cat -- "${temp_file}") &&
|
||||
[ -n "${chosen_dir}" ] &&
|
||||
[ "${chosen_dir}" != "${PWD}" ]; then
|
||||
cd -- "${chosen_dir}"
|
||||
fi
|
||||
rm -f -- "${temp_file}"
|
||||
temp_file=$(mktemp -t "ranger_cd.XXXXXXXXXX")
|
||||
ranger --choosedir="$temp_file" -- "${@:-$PWD}"
|
||||
if chosen_dir=$(cat -- "$temp_file") &&
|
||||
[ -n "$chosen_dir" ] &&
|
||||
[ $chosen_dir != "$PWD" ]; then
|
||||
cd -- "$chosen_dir"
|
||||
fi
|
||||
rm -f -- "$temp_file"
|
||||
}
|
||||
alias ranger="ranger_cd"
|
||||
|
||||
@@ -47,38 +47,38 @@ alias ranger="ranger_cd"
|
||||
[[ -f "/usr/lib/mc/mc.sh" ]] && . "/usr/lib/mc/mc.sh"
|
||||
|
||||
# nix package manager
|
||||
[[ -e "${HOME}/.nix-profile/etc/profile.d/nix.sh" ]] &&
|
||||
. "${HOME}/.nix-profile/etc/profile.d/nix.sh"
|
||||
[[ -e "$HOME/.nix-profile/etc/profile.d/nix.sh" ]] &&
|
||||
. "$HOME/.nix-profile/etc/profile.d/nix.sh"
|
||||
|
||||
# nix shell
|
||||
if command -v nix-your-shell >/dev/null 2>&1; then
|
||||
nix-your-shell zsh | . /dev/stdin
|
||||
nix-your-shell zsh | . /dev/stdin
|
||||
fi
|
||||
|
||||
# node.js
|
||||
export NVM_DIR="${HOME}/.nvm"
|
||||
[[ -s "${NVM_DIR}/nvm.sh" ]] &&
|
||||
. "${NVM_DIR}/nvm.sh" # This loads nvm
|
||||
[[ -s "${NVM_DIR}/bash_completion" ]] &&
|
||||
. "${NVM_DIR}/bash_completion" # This loads nvm bash_completion
|
||||
export NVM_DIR="$HOME/.nvm"
|
||||
[[ -s "$NVM_DIR/nvm.sh" ]] &&
|
||||
. "$NVM_DIR/nvm.sh" # This loads nvm
|
||||
[[ -s "$NVM_DIR/bash_completion" ]] &&
|
||||
. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
|
||||
|
||||
# rvm
|
||||
[[ -s "${HOME}/.rvm/scripts/rvm" ]] && . "${HOME}/.rvm/scripts/rvm"
|
||||
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"
|
||||
|
||||
# pyenv
|
||||
export PYENV_ROOT="${HOME}/.pyenv"
|
||||
if [[ -d "${PYENV_ROOT}/bin" ]]; then
|
||||
path=("${PYENV_ROOT}/bin" "${path[@]}")
|
||||
export PATH
|
||||
eval "$(pyenv init - zsh)"
|
||||
eval "$(pyenv virtualenv-init -)"
|
||||
export PYENV_ROOT="$HOME/.pyenv"
|
||||
if [[ -d "$PYENV_ROOT/bin" ]]; then
|
||||
path=("$PYENV_ROOT/bin" "${path[@]}")
|
||||
export PATH
|
||||
eval "$(pyenv init - zsh)"
|
||||
eval "$(pyenv virtualenv-init -)"
|
||||
fi
|
||||
|
||||
# inside tmux, we don't know if Sway got restarted
|
||||
if [[ -v TMUX ]]; then
|
||||
swaymsg() {
|
||||
SWAYSOCK="${XDG_RUNTIME_DIR}/sway-ipc.${UID}.$(pgrep -x sway).sock"
|
||||
export SWAYSOCK
|
||||
command swaymsg "$@"
|
||||
}
|
||||
swaymsg() {
|
||||
SWAYSOCK="$XDG_RUNTIME_DIR/sway-ipc.$UID.$(pgrep -x sway).sock"
|
||||
export SWAYSOCK
|
||||
command swaymsg "$@"
|
||||
}
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user