Last active
November 15, 2023 16:15
-
-
Save wckdouglas/ab034397b07d54f970efd2760909edda to your computer and use it in GitHub Desktop.
zshrc template with starship (how I like my zsh behaves)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# using starship: https://starship.rs/ | |
eval "$(starship init zsh)" | |
# never beep | |
setopt NO_BEEP | |
# auto completion: https://dev.to/rossijonas/how-to-set-up-history-based-autocompletion-in-zsh-k7o | |
zstyle ':completion:*' matcher-list '' 'm:{a-zA-Z}={A-Za-z}' 'r:|=*' 'l:|=* r:|=*' | |
autoload -U compinit && compinit | |
## history setup | |
setopt SHARE_HISTORY | |
HISTFILE=$HOME/.zhistory | |
SAVEHIST=1000 | |
HISTSIZE=999 | |
setopt HIST_EXPIRE_DUPS_FIRST | |
setopt EXTENDED_HISTORY | |
## autocompletion using arrow keys (based on history) | |
## https://superuser.com/questions/417627/oh-my-zsh-history-completion | |
## https://unix.stackexchange.com/questions/97843/how-can-i-search-history-with-text-already-entered-at-the-prompt-in-zsh | |
autoload -U history-search-end | |
zle -N history-beginning-search-backward-end history-search-end | |
zle -N history-beginning-search-forward-end history-search-end | |
bindkey '\e[A' history-beginning-search-backward-end # sometimes this is '^[OA' | |
bindkey '\e[B' history-beginning-search-forward-end # sometimes this is '^[OB' | |
# highlight when ls+tab: https://stackoverflow.com/questions/29196718/zsh-highlight-on-tab | |
zstyle ':completion:*' menu select | |
# hot keys | |
bindkey "^[[1;3C" forward-word # opt+right arrow to jump a word forward | |
bindkey "^[[1;3D" backward-word # opt+left arrow to jump a word back | |
bindkey '^L' beginning-of-line # ctrl+L to jump to beginnning | |
bindkey '^R' end-of-line # ctrl+R to jump to end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment