shell things

main
Alpha Chen 10 months ago
parent c7bee84725
commit cf6182f623
Signed by: alpha
SSH Key Fingerprint: SHA256:3fOT8fiYQG/aK9ntivV3Bqtg8AYQ7q4nV6ZgihOA20g

@ -49,7 +49,7 @@
status # exit code of the last command status # exit code of the last command
command_execution_time # duration of the last command command_execution_time # duration of the last command
background_jobs # presence of background jobs background_jobs # presence of background jobs
direnv # direnv status (https://direnv.net/) # direnv # direnv status (https://direnv.net/)
asdf # asdf version manager (https://github.com/asdf-vm/asdf) asdf # asdf version manager (https://github.com/asdf-vm/asdf)
virtualenv # python virtual environment (https://docs.python.org/3/library/venv.html) virtualenv # python virtual environment (https://docs.python.org/3/library/venv.html)
anaconda # conda environment (https://conda.io/) anaconda # conda environment (https://conda.io/)
@ -1375,8 +1375,6 @@
'*' OTHER) '*' OTHER)
typeset -g POWERLEVEL9K_TERRAFORM_OTHER_FOREGROUND=38 typeset -g POWERLEVEL9K_TERRAFORM_OTHER_FOREGROUND=38
# typeset -g POWERLEVEL9K_TERRAFORM_OTHER_VISUAL_IDENTIFIER_EXPANSION='⭐' # typeset -g POWERLEVEL9K_TERRAFORM_OTHER_VISUAL_IDENTIFIER_EXPANSION='⭐'
# Replace the content of terraform segment with an empty value.
typeset -g POWERLEVEL9K_TERRAFORM_CONTENT_EXPANSION=
#############[ terraform_version: terraform version (https://www.terraform.io) ]############## #############[ terraform_version: terraform version (https://www.terraform.io) ]##############
# Terraform version color. # Terraform version color.

@ -0,0 +1,3 @@
if [[ $- == *"i"* ]]; then
exec zsh
fi

@ -72,8 +72,19 @@ path=(~/bin $path)
# Export environment variables. # Export environment variables.
export GPG_TTY=$TTY export GPG_TTY=$TTY
export EDITOR=nvim
export VISUAL=nvim
export BAT_THEME=ashes
export FZF_DEFAULT_OPTS="--height 40% --layout=reverse --border"
export FZF_DEFAULT_COMMAND="fd --type f --strip-cwd-prefix --hidden --follow --exclude .git"
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"
export FZF_ALT_C_COMMAND="fd --type d --strip-cwd-prefix --hidden --follow --exclude .git"
# Source additional local files if they exist. # Source additional local files if they exist.
if (( $+commands[fzf] )); then
[[ $- == *i* ]] && z4h source ${HOMEBREW_PREFIX:+$HOMEBREW_PREFIX/opt/fzf/shell/completion.zsh}
fi
z4h source ~/.dotfiles/src/fzf-git.sh/fzf-git.sh
z4h source ~/.local.zsh z4h source ~/.local.zsh
# Use additional Git repositories pulled in with `z4h install`. # Use additional Git repositories pulled in with `z4h install`.
@ -91,6 +102,22 @@ z4h bindkey z4h-cd-forward Shift+Right # cd into the next directory
z4h bindkey z4h-cd-up Shift+Up # cd into the parent directory z4h bindkey z4h-cd-up Shift+Up # cd into the parent directory
z4h bindkey z4h-cd-down Shift+Down # cd into a child directory z4h bindkey z4h-cd-down Shift+Down # cd into a child directory
z4h bindkey history-beginning-search-backward Ctrl+P
z4h bindkey history-beginning-search-forward Ctrl+N
if (( $+commands[fzf] )); then
z4h source ${HOMEBREW_PREFIX:+$HOMEBREW_PREFIX/opt/fzf/shell/key-bindings.zsh}
# Not sure how to do key sequences w/`z4h bindkey`
bindkey '^gg' fzf-git-branches-widget
# ^gl doesn't work in tmux, but I need reflogs more than remotes probably?
bindkey '^gr' fzf-git-lreflogs-widget
# https://github.com/junegunn/fzf/issues/164#issuecomment-581837757
z4h bindkey fzf-cd-widget ç
fi
# Autoload functions. # Autoload functions.
autoload -Uz zmv autoload -Uz zmv
@ -98,6 +125,14 @@ autoload -Uz zmv
function md() { [[ $# == 1 ]] && mkdir -p -- "$1" && cd -- "$1" } function md() { [[ $# == 1 ]] && mkdir -p -- "$1" && cd -- "$1" }
compdef _directories md compdef _directories md
# https://docs.brew.sh/Shell-Completion
if type brew &>/dev/null; then
FPATH=${HOMEBREW_PREFIX:+$HOMEBREW_PREFIX/share/zsh/site-functions:${FPATH}}
autoload -Uz compinit
compinit
fi
# Define named directories: ~w <=> Windows home directory on WSL. # Define named directories: ~w <=> Windows home directory on WSL.
# [[ -z $z4h_win_home ]] || hash -d w=$z4h_win_home # [[ -z $z4h_win_home ]] || hash -d w=$z4h_win_home

Loading…
Cancel
Save