Add (mostly) ported zsh configuration
This commit is contained in:
67
zshrc
Normal file
67
zshrc
Normal file
@@ -0,0 +1,67 @@
|
||||
# Load plugin scripts
|
||||
plugin-load() { source ~/.config/zsh/$1/$1.plugin.zsh }
|
||||
plugin-load zsh-syntax-highlighting
|
||||
plugin-load zsh-history-substring-search
|
||||
|
||||
# Disable sound
|
||||
unsetopt BEEP
|
||||
|
||||
# Remove duplicates from history
|
||||
setopt HIST_IGNORE_ALL_DUPS
|
||||
setopt HIST_REDUCE_BLANKS
|
||||
setopt HIST_SAVE_NO_DUPS
|
||||
|
||||
# Enable multi-terminal history
|
||||
setopt INC_APPEND_HISTORY
|
||||
|
||||
# Enable % escape expansion and substitution in the prompt
|
||||
setopt PROMPT_PERCENT
|
||||
setopt PROMPT_SUBST
|
||||
|
||||
# Disable '<Ctrl>D' to logout
|
||||
setopt IGNORE_EOF
|
||||
|
||||
# Enable comments in the prompt
|
||||
setopt INTERACTIVE_COMMENTS
|
||||
|
||||
# Initialize completions
|
||||
autoload -U compinit
|
||||
compinit
|
||||
|
||||
# Enable prompt themes
|
||||
autoload -Uz promptinit
|
||||
promptinit
|
||||
prompt fresh
|
||||
|
||||
# Enable vi mode
|
||||
bindkey -v
|
||||
|
||||
# Enable yank whole line with 'yy' and yank end of line with 'Y'
|
||||
bindkey -M vicmd 'yy' vi-yank-whole-line
|
||||
bindkey -M vicmd 'Y' vi-yank-eol
|
||||
|
||||
# Enable undo with 'u' and redo with 'U'
|
||||
bindkey -M vicmd 'u' undo
|
||||
bindkey -M vicmd 'U' redo
|
||||
|
||||
# Enable substring history search with 'j' and 'k'
|
||||
bindkey -M vicmd 'k' history-substring-search-up
|
||||
bindkey -M vicmd 'j' history-substring-search-down
|
||||
|
||||
# Replace '<Esc>h' with 'K' to view help
|
||||
bindkey -r '^[h'
|
||||
bindkey -M vicmd 'K' run-help
|
||||
|
||||
# Disable Ex mode with ':'
|
||||
bindkey -rM vicmd ':'
|
||||
|
||||
# Use editor to edit command line with '<Ctrl>V'
|
||||
autoload -U edit-command-line
|
||||
zle -N edit-command-line
|
||||
bindkey -M vicmd '^V' edit-command-line
|
||||
|
||||
# Disable tty flow control, allows vim to use '<Ctrl>S'
|
||||
stty -ixon
|
||||
|
||||
# Remove duplicates from PATH
|
||||
typeset -U PATH
|
||||
Reference in New Issue
Block a user