Skip to content

Instantly share code, notes, and snippets.

@dfyz
Last active May 31, 2020 02:08
Show Gist options
  • Save dfyz/723a915c70b260cd7969491d5d59e5d5 to your computer and use it in GitHub Desktop.
Save dfyz/723a915c70b260cd7969491d5d59e5d5 to your computer and use it in GitHub Desktop.
# History.
[ -z "$HISTFILE" ] && HISTFILE="$HOME/.zsh_history"
HISTSIZE=50000
SAVEHIST=10000
setopt extended_history
setopt hist_expire_dups_first
setopt hist_ignore_dups
setopt inc_append_history
setopt share_history
setopt extendedglob
# Completions.
autoload compinit && compinit
zstyle ':completion:*' menu select
# Prompts.
PROMPT='%n@%m %F{green}%d%(!.#.>)%f '
# Keys.
bindkey -e
key[Alt-Left]="${terminfo[kLFT3]}"
key[Alt-Right]="${terminfo[kRIT3]}"
key[Control-Left]="${terminfo[kLFT5]}"
key[Control-Right]="${terminfo[kRIT5]}"
[[ -n "${key[Alt-Left]}" ]] && bindkey -- "${key[Alt-Left]}" backward-word
[[ -n "${key[Alt-Right]}" ]] && bindkey -- "${key[Alt-Right]}" forward-word
[[ -n "${key[Control-Left]}" ]] && bindkey -- "${key[Control-Left]}" backward-word
[[ -n "${key[Control-Right]}" ]] && bindkey -- "${key[Control-Right]}" forward-word
autoload -U select-word-style
select-word-style bash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment