42 lines
1 KiB
Bash
42 lines
1 KiB
Bash
## Basic
|
|
# enable comments in interactive-shell
|
|
setopt interactivecomments
|
|
# disable ^S ^Q
|
|
stty stop undef start undef
|
|
# history
|
|
HISTFILE=~/.zsh_history
|
|
HISTSIZE=1000 # memory
|
|
SAVEHIST=1000 # file
|
|
setopt appendhistory
|
|
|
|
## Plugins
|
|
source /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.plugin.zsh
|
|
source /usr/share/zsh/plugins/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh
|
|
## Shift-Tab to accept suggestion
|
|
bindkey '\E[Z' autosuggest-accept
|
|
|
|
## Input
|
|
# use vim mode
|
|
bindkey -v
|
|
# imap jk to <ESC>
|
|
bindkey -Mviins -s jk '\e'
|
|
|
|
## Edit
|
|
# edit zshrc
|
|
vizr() {"${EDITOR:-vi}" $HOME/.zshrc && . $HOME/.zshrc}
|
|
# edit zshenv
|
|
vize() {"${EDITOR:-vi}" $HOME/.zshenv && . $HOME/.zshenv}
|
|
# edit zprofile
|
|
vizp() {"${EDITOR:-vi}" $HOME/.zprofile && . $HOME/.zprofile}
|
|
|
|
## Alias
|
|
alias vi='nvim'
|
|
alias vim='nvim'
|
|
alias ls='ls --color=auto'
|
|
alias rg='grep -r'
|
|
alias sudo='sudo '
|
|
alias start="bash -c 'systemctl start \$0; journalctl -xefu \$0'"
|
|
|
|
## Starship
|
|
#export STARSHIP_CONFIG=/etc/starship.toml
|
|
eval "$(starship init zsh)"
|