fix: zsh role add fzf support and p10k settings tweaks
This commit is contained in:
@@ -1,24 +1,61 @@
|
||||
# {{ ansible_managed }}
|
||||
export ZSH_PLUGINS={{ zsh_plugins_path }}
|
||||
|
||||
# History configuration
|
||||
HISTFILE={{ zsh_config_path }}/.zsh_history
|
||||
HISTSIZE=50000
|
||||
SAVEHIST=50000
|
||||
setopt EXTENDED_HISTORY # record timestamp of command
|
||||
setopt HIST_EXPIRE_DUPS_FIRST # delete duplicates first when trimming
|
||||
setopt HIST_IGNORE_DUPS # ignore duplicated commands
|
||||
setopt HIST_IGNORE_SPACE # ignore commands starting with space
|
||||
setopt HIST_VERIFY # show command with history expansion before running
|
||||
setopt SHARE_HISTORY # share history between sessions
|
||||
setopt APPEND_HISTORY # append to history file, don't overwrite
|
||||
|
||||
# Directory navigation
|
||||
setopt AUTO_CD # cd by typing directory name
|
||||
setopt AUTO_PUSHD # push directories on cd
|
||||
setopt PUSHD_IGNORE_DUPS # don't push duplicates
|
||||
setopt CORRECT # correct command spelling
|
||||
setopt NO_BEEP # no beeps
|
||||
|
||||
# Completion
|
||||
autoload -Uz compinit
|
||||
compinit -C # faster completion (cache)
|
||||
|
||||
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
|
||||
# Initialization code that may require console input (password prompts, [y/n]
|
||||
# confirmations, etc.) must go above this block; everything else may go below.
|
||||
if [[ -r "$HOME/.cache/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
|
||||
source "$HOME/.cache/p10k-instant-prompt-${(%):-%n}.zsh"
|
||||
fi
|
||||
|
||||
# To customize prompt, run `p10k configure` or edit the following file.
|
||||
source {{ zsh_p10k_theme_config }}
|
||||
|
||||
# Enable syntax highlighting for zsh
|
||||
source $ZSH_PLUGINS/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
|
||||
|
||||
# Enable autosuggestions
|
||||
source $ZSH_PLUGINS/zsh-autosuggestions/zsh-autosuggestions.zsh
|
||||
|
||||
# Enable powerlevel10k theme
|
||||
source $ZSH_PLUGINS/powerlevel10k/powerlevel10k.zsh-theme
|
||||
|
||||
# Enable autosuggestions (before syntax highlighting)
|
||||
source $ZSH_PLUGINS/zsh-autosuggestions/zsh-autosuggestions.zsh
|
||||
|
||||
# Enable history substring search (before keybindings, before syntax highlighting)
|
||||
source $ZSH_PLUGINS/zsh-history-substring-search/zsh-history-substring-search.zsh
|
||||
|
||||
# Enable syntax highlighting (must be loaded last)
|
||||
source $ZSH_PLUGINS/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
|
||||
|
||||
# Enable fzf integration (Ctrl+R, Ctrl+T, Alt+C)
|
||||
source /usr/share/fzf/key-bindings.zsh
|
||||
source /usr/share/fzf/completion.zsh
|
||||
|
||||
# Enable fzf-tab for completions (after compinit)
|
||||
source $ZSH_PLUGINS/fzf-tab/fzf-tab.zsh
|
||||
|
||||
# Source fzf-tab config
|
||||
[[ -f {{ zsh_config_path }}/fzf-tab.zsh ]] && source {{ zsh_config_path }}/fzf-tab.zsh
|
||||
|
||||
# Source aliases
|
||||
[[ -f {{ zsh_config_path }}/aliases ]] && source {{ zsh_config_path }}/aliases
|
||||
|
||||
export ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=8'
|
||||
export PROMPT="%n@%m:%~$ "
|
||||
|
||||
# Useful keybindings
|
||||
bindkey "^[[A" history-substring-search-up
|
||||
bindkey "^[[B" history-substring-search-down
|
||||
|
||||
Reference in New Issue
Block a user