Обновить конфигурацию Zsh: изменить настройки плагинов, улучшить привязку клавиш и добавить историю команд

This commit is contained in:
Dmitry
2026-01-06 23:40:15 +03:00
parent 1b779aa71e
commit bdb4cbeb01
6 changed files with 31 additions and 31 deletions

View File

@@ -1,9 +1,8 @@
# Generated by Powerlevel10k configuration wizard on 2025-12-07 at 18:23 MSK.
# Generated by Powerlevel10k configuration wizard on 2026-01-06 at 23:39 MSK.
# Based on romkatv/powerlevel10k/config/p10k-rainbow.zsh, checksum 49619.
# Wizard options: nerdfont-v3 + powerline, small icons, rainbow, unicode,
# angled separators, sharp heads, sharp tails, 2 lines, disconnected, left frame,
# lightest-ornaments, sparse, many icons, fluent, transient_prompt,
# instant_prompt=verbose.
# slanted separators, slanted heads, slanted tails, 2 lines, disconnected, left frame,
# light-ornaments, sparse, many icons, fluent, transient_prompt, instant_prompt=verbose.
# Type `p10k configure` to generate another config.
#
# Config for Powerlevel10k with powerline prompt style with colorful background.
@@ -143,9 +142,9 @@
# Connect left prompt lines with these symbols. You'll probably want to use the same color
# as POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_FOREGROUND below.
typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_PREFIX='%244F╭─'
typeset -g POWERLEVEL9K_MULTILINE_NEWLINE_PROMPT_PREFIX='%244F├─'
typeset -g POWERLEVEL9K_MULTILINE_LAST_PROMPT_PREFIX='%244F╰─'
typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_PREFIX='%242F╭─'
typeset -g POWERLEVEL9K_MULTILINE_NEWLINE_PROMPT_PREFIX='%242F├─'
typeset -g POWERLEVEL9K_MULTILINE_LAST_PROMPT_PREFIX='%242F╰─'
# Connect right prompt lines with these symbols.
typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_SUFFIX=
typeset -g POWERLEVEL9K_MULTILINE_NEWLINE_PROMPT_SUFFIX=
@@ -161,7 +160,7 @@
if [[ $POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_CHAR != ' ' ]]; then
# The color of the filler. You'll probably want to match the color of POWERLEVEL9K_MULTILINE
# ornaments defined above.
typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_FOREGROUND=244
typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_FOREGROUND=242
# Start filler from the edge of the screen if there are no left segments on the first line.
typeset -g POWERLEVEL9K_EMPTY_LINE_LEFT_PROMPT_FIRST_SEGMENT_END_SYMBOL='%{%}'
# End filler on the edge of the screen if there are no right segments on the first line.
@@ -169,24 +168,24 @@
fi
# Separator between same-color segments on the left.
typeset -g POWERLEVEL9K_LEFT_SUBSEGMENT_SEPARATOR='\uE0B1'
typeset -g POWERLEVEL9K_LEFT_SUBSEGMENT_SEPARATOR='\u2571'
# Separator between same-color segments on the right.
typeset -g POWERLEVEL9K_RIGHT_SUBSEGMENT_SEPARATOR='\uE0B3'
typeset -g POWERLEVEL9K_RIGHT_SUBSEGMENT_SEPARATOR='\u2571'
# Separator between different-color segments on the left.
typeset -g POWERLEVEL9K_LEFT_SEGMENT_SEPARATOR='\uE0B0'
typeset -g POWERLEVEL9K_LEFT_SEGMENT_SEPARATOR='\uE0BC'
# Separator between different-color segments on the right.
typeset -g POWERLEVEL9K_RIGHT_SEGMENT_SEPARATOR='\uE0B2'
typeset -g POWERLEVEL9K_RIGHT_SEGMENT_SEPARATOR='\uE0BA'
# To remove a separator between two segments, add "_joined" to the second segment name.
# For example: POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(os_icon context_joined)
# The right end of left prompt.
typeset -g POWERLEVEL9K_LEFT_PROMPT_LAST_SEGMENT_END_SYMBOL='\uE0B0'
typeset -g POWERLEVEL9K_LEFT_PROMPT_LAST_SEGMENT_END_SYMBOL='\uE0BC'
# The left end of right prompt.
typeset -g POWERLEVEL9K_RIGHT_PROMPT_FIRST_SEGMENT_START_SYMBOL='\uE0B2'
typeset -g POWERLEVEL9K_RIGHT_PROMPT_FIRST_SEGMENT_START_SYMBOL='\uE0BA'
# The left end of left prompt.
typeset -g POWERLEVEL9K_LEFT_PROMPT_FIRST_SEGMENT_START_SYMBOL='\uE0B2'
typeset -g POWERLEVEL9K_LEFT_PROMPT_FIRST_SEGMENT_START_SYMBOL='\uE0BA'
# The right end of right prompt.
typeset -g POWERLEVEL9K_RIGHT_PROMPT_LAST_SEGMENT_END_SYMBOL='\uE0B0'
typeset -g POWERLEVEL9K_RIGHT_PROMPT_LAST_SEGMENT_END_SYMBOL='\uE0BC'
# Left prompt terminator for lines without any segments.
typeset -g POWERLEVEL9K_EMPTY_LINE_LEFT_PROMPT_LAST_SEGMENT_END_SYMBOL=

View File

View File

@@ -0,0 +1,2 @@
stow -t ~ */
ls

View File

@@ -28,20 +28,12 @@ bindkey '^[^[[C' forward-word # Alt+Right - вперёд на слов
bindkey '^[^[[D' backward-word # Alt+Left - назад на слово
# ═══ История команд ════════════════════════════════════════
# Обычная навигация по истории (без фильтрации)
bindkey '^P' up-history # Ctrl+P - предыдущая команда (без фильтра)
bindkey '^N' down-history # Ctrl+N - следующая команда (без фильтра)
# Стрелки вверх/вниз - с фильтрацией по началу строки
bindkey '^[[A' up-line-or-search # Up - предыдущая команда (с фильтром)
bindkey '^[[B' down-line-or-search # Down - следующая команда (с фильтром)
bindkey '^P' up-history # Ctrl+P - просто вверх
bindkey '^N' down-history # Ctrl+N - просто вниз
# Поиск в истории (если загружен history-substring-search)
if (( $+functions[history-substring-search-up] )); then
# Alt+Up/Down для поиска подстроки в истории
bindkey '^[[1;3A' history-substring-search-up # Alt+Up
bindkey '^[[1;3B' history-substring-search-down # Alt+Down
fi
# Оставляем Alt+Стрелки для чего-то другого или удаляем,
# если они дублируют функционал.
# ═══ Автодополнение ════════════════════════════════════════
bindkey '^I' complete-word # Tab - автодополнение

View File

@@ -39,8 +39,15 @@ export ZSH_AUTOSUGGEST_STRATEGY=(history completion)
export ZSH_AUTOSUGGEST_BUFFER_MAX_SIZE=20
# ═══ История ═══════════════════════════════════════════════
# zsh-history-substring-search - поиск в истории
zinit ice wait lucid
zinit ice wait"0" lucid atload'
# Привязываем стрелки к плагину (теперь они не будут глючить)
bindkey "$terminfo[kcuu1]" history-substring-search-up
bindkey "$terminfo[kcud1]" history-substring-search-down
# Настройка цветов (по желанию)
HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND="fg=magenta,bold"
HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_NOT_FOUND="fg=red,bold"
'
zinit light zsh-users/zsh-history-substring-search
# ═══ FZF ═══════════════════════════════════════════════════