Compare commits
62 Commits
a20d17eb8b
...
master
Author | SHA1 | Date | |
---|---|---|---|
eea38195a1 | |||
c7bb09d5bc | |||
0ab8f29d9e | |||
ffb71f5600 | |||
ee02aea5a7 | |||
1df17fc702 | |||
62670c583c | |||
faa5c5a550 | |||
4d8052da4b | |||
bb4f1bbb53 | |||
44111962f2 | |||
9c38804a6a | |||
6562cc7774 | |||
d8eb4a6049 | |||
0246176d38 | |||
6d35685e33 | |||
312733c575 | |||
a7e2a48581 | |||
442480e151 | |||
b25739c78b | |||
88efc82376 | |||
9e58e8e04f | |||
c0c1920574 | |||
842b64bfe1 | |||
484a4b943f | |||
a288ff89ed | |||
48902750b9 | |||
ce3d65d15b | |||
ab88a647c0 | |||
0d440310bd | |||
566cca7844 | |||
188e40834e | |||
3819c3ee74 | |||
8364968e2f | |||
b1ab03e165 | |||
020da06b8a | |||
01f900a450 | |||
dd91f10bb4 | |||
0943137da8 | |||
5e593ade5e | |||
2b8ea8a194 | |||
edf4ef872c | |||
9730fc1f5c | |||
9aa3dec349 | |||
834a086fbc | |||
c7b2bbb92f | |||
a545d3be52 | |||
9dc78aa73d | |||
ebbc50dc4c | |||
75c47072f9 | |||
41cc096839 | |||
33eb5a63e1 | |||
505bccc687 | |||
8321fb3a86 | |||
1be479ca64 | |||
43a6deb60c | |||
3df25cc280 | |||
bc176b9f3a | |||
d7f8f98895 | |||
addc2bbc65 | |||
8d6f4d0a0c | |||
345d23e0dc |
1652
.p10k.8colors.zsh
Normal file
1652
.p10k.8colors.zsh
Normal file
File diff suppressed because it is too large
Load Diff
11
.zshenv
11
.zshenv
@ -27,6 +27,12 @@ export XDG_STATE_HOME="$HOME/.local/state"
|
||||
export ZSH_CACHE_DIR="$XDG_CACHE_HOME/zsh"
|
||||
export ZSH_COMPDUMP="$ZSH_CACHE_DIR/zcompdump-${HOST/.*/}-$ZSH_VERSION"
|
||||
|
||||
typeset -g POWERLEVEL9K_INSTANT_PROMPT=off
|
||||
|
||||
# Короткое имя компьютера, обязательно нужно для ssh-agent.
|
||||
# Часто используется в OhMyZsh.
|
||||
export SHORT_HOST="${SHORT_HOST:-${(%):-%m}}"
|
||||
|
||||
# Отключаем некоторые плагины, если запуск в качестве подоболочки mc
|
||||
# Bug: https://midnight-commander.org/ticket/4253
|
||||
[ "$(ps -p $PPID -o cmd=)" = "mc" ] && ZSH_MC_SUBSHELL=1
|
||||
@ -49,6 +55,11 @@ if [[ -n ${DISPLAY+set} ]]; then
|
||||
fi
|
||||
# }}}
|
||||
|
||||
if command -v bat >/dev/null; then
|
||||
export PAGER=bat
|
||||
export MANPAGER="sh -c 'col -bx | bat -l man -p'"
|
||||
fi
|
||||
|
||||
# Uncrustify
|
||||
export UNCRUSTIFY_CONFIG="${XDG_CONFIG_HOME}/uncrustify/uncrustify.cfg"
|
||||
[ ! -r "${UNCRUSTIFY_CONFIG}" ] && unset UNCRUSTIFY_CONFIG
|
||||
|
7
.zshrc
7
.zshrc
@ -11,10 +11,11 @@ for S in \
|
||||
42-zinit \
|
||||
45-plugins \
|
||||
55-agents \
|
||||
65-scripts \
|
||||
75-aliases \
|
||||
62-scripts \
|
||||
68-aliases \
|
||||
72-widgets \
|
||||
78-keybindings \
|
||||
82-completion \
|
||||
85-keybindings \
|
||||
88-prompt \
|
||||
95-finish
|
||||
do
|
||||
|
@ -2,7 +2,7 @@
|
||||
# vim: ft=sh
|
||||
|
||||
HISTFILE="$ZSH_CACHE_DIR/history"
|
||||
HISTSIZE=100000
|
||||
HISTSIZE=600000
|
||||
SAVEHIST=500000
|
||||
HISTDUP=erase
|
||||
|
||||
|
@ -2,14 +2,16 @@
|
||||
# vim: ft=sh
|
||||
|
||||
declare -A ZINIT
|
||||
ZINIT[HOME_DIR]="$ZSH_CACHE_DIR/zinit"
|
||||
ZINIT[VERSION]="3.14.0"
|
||||
ZINIT[HOME_DIR]="$ZSH_CACHE_DIR/zinit-${ZINIT[VERSION]}"
|
||||
ZINIT[PLUGINS_DIR]="$ZSH_CACHE_DIR/plugins"
|
||||
ZINIT[SNIPPETS_DIR]="$ZSH_CACHE_DIR/snippets"
|
||||
ZINIT[ZCOMPDUMP_PATH]="$ZSH_CACHE_DIR/zcompdump"
|
||||
ZPFX="$ZSH_CACHE_DIR/polaris"
|
||||
|
||||
if [ ! -d "${ZINIT[HOME_DIR]}" ]; then
|
||||
git clone --depth 1 https://github.com/zdharma-continuum/zinit "${ZINIT[HOME_DIR]}"
|
||||
curl -sL "https://github.com/zdharma-continuum/zinit/archive/refs/tags/v${ZINIT[VERSION]}.tar.gz" | tar zxf - -C "$ZSH_CACHE_DIR"
|
||||
sed -i 's/.*zinit-self-update -q//' "${ZINIT[HOME_DIR]}/zinit-autoload.zsh"
|
||||
zcompile "${ZINIT[HOME_DIR]}/zinit.zsh"
|
||||
fi
|
||||
|
||||
|
@ -1,66 +1,80 @@
|
||||
# shellcheck shell=bash
|
||||
# vim: ft=sh
|
||||
|
||||
zinit load willghatch/zsh-saneopt
|
||||
zinit load mafredri/zsh-async
|
||||
zinit light willghatch/zsh-saneopt
|
||||
zinit light mafredri/zsh-async
|
||||
|
||||
export ZSHZ_CASE=smart
|
||||
export ZSHZ_DATA="${ZSH_CACHE_DIR}/z"
|
||||
zinit ice wait'!0' depth'1'
|
||||
zinit ice lucid wait'0' depth'1'
|
||||
zinit light agkozak/zsh-z
|
||||
|
||||
if [ "$(id -u)" != "0" ] && [[ -n ${DISPLAY+set} ]]; then
|
||||
zinit snippet OMZP::pj
|
||||
|
||||
if [[ "$(id -u)" != "0" ]] && [[ -n "${DISPLAY+set}" ]]; then
|
||||
zstyle ':notify:*' expire-time 5000
|
||||
zstyle ':notify:*' command-complete-timeout 20
|
||||
zstyle ':notify:*' enable-on-ssh yes
|
||||
zinit light marzocchi/zsh-notify
|
||||
fi
|
||||
|
||||
zinit ice wait'!0' from"gh-r" as"program"
|
||||
zinit light denisidoro/navi
|
||||
zinit snippet https://github.com/denisidoro/navi/blob/master/shell/navi.plugin.zsh
|
||||
|
||||
zinit snippet OMZL::functions.zsh
|
||||
zinit snippet OMZL::clipboard.zsh
|
||||
zinit snippet OMZL::key-bindings.zsh
|
||||
zinit snippet OMZL::termsupport.zsh
|
||||
zinit snippet OMZP::autojump
|
||||
zinit snippet OMZP::command-not-found
|
||||
|
||||
zinit light marlonrichert/zsh-hist
|
||||
|
||||
if [ -x /usr/lib/command-not-found ]; then
|
||||
zinit snippet OMZP::command-not-found
|
||||
fi
|
||||
zinit snippet OMZP::common-aliases
|
||||
zinit snippet OMZP::debian
|
||||
zinit snippet OMZP::isodate
|
||||
zinit snippet OMZP::mosh
|
||||
zinit snippet OMZP::nmap
|
||||
zinit snippet OMZP::pre-commit
|
||||
zinit snippet OMZP::rsync
|
||||
if command -v mosh > /dev/null 2>&1; then
|
||||
zinit snippet OMZP::mosh
|
||||
fi
|
||||
if command -v nmap > /dev/null 2>&1; then
|
||||
zinit snippet OMZP::nmap
|
||||
fi
|
||||
if command -v pre-commit > /dev/null 2>&1; then
|
||||
zinit snippet OMZP::pre-commit
|
||||
fi
|
||||
if command -v rsync > /dev/null 2>&1; then
|
||||
zinit snippet OMZP::rsync
|
||||
fi
|
||||
zinit snippet OMZP::vscode
|
||||
zinit snippet OMZP::web-search
|
||||
zinit load brymck/print-alias
|
||||
if command -v git-lfs > /dev/null 2>&1; then
|
||||
zinit light brymck/print-alias
|
||||
fi
|
||||
|
||||
zinit ice wait'!0' from"gh-r" as"program"
|
||||
zinit light junegunn/fzf
|
||||
|
||||
zinit ice wait'!0' mv"completion.zsh -> _fzf" pick"_fzf" as"completion"
|
||||
zinit snippet https://github.com/junegunn/fzf/blob/master/shell/completion.zsh
|
||||
zinit snippet https://github.com/junegunn/fzf/blob/master/shell/key-bindings.zsh
|
||||
|
||||
zinit ice wait'!0' lucid
|
||||
zinit light joshskidmore/zsh-fzf-history-search
|
||||
if command -v fzf > /dev/null 2>&1; then
|
||||
FZF_DEFAULT_OPTS='--height 60% --layout=reverse --border'
|
||||
if command -v fd > /dev/null 2>&1; then
|
||||
FZF_DEFAULT_COMMAND="fd --type f"
|
||||
FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"
|
||||
FZF_ALT_C_COMMAND="fd --type d"
|
||||
fi
|
||||
FZF_VERSION="$(fzf --version | sed -r 's/([0-9]+\.[0-9]+).*/\1/' )"
|
||||
zinit ice lucid wait'0' mv"completion.zsh -> _fzf" pick"_fzf" as"completion"
|
||||
if is-at-least "0.54" "$FZF_VERSION"; then
|
||||
zinit snippet "https://raw.githubusercontent.com/junegunn/fzf/refs/tags/v${FZF_VERSION}.0/shell/completion.zsh"
|
||||
zinit snippet "https://raw.githubusercontent.com/junegunn/fzf/refs/tags/v${FZF_VERSION}.0/shell/key-bindings.zsh"
|
||||
else
|
||||
zinit snippet "https://raw.githubusercontent.com/junegunn/fzf/refs/tags/${FZF_VERSION}.0/shell/completion.zsh"
|
||||
zinit snippet "https://raw.githubusercontent.com/junegunn/fzf/refs/tags/${FZF_VERSION}.0/shell/key-bindings.zsh"
|
||||
fi
|
||||
fi
|
||||
|
||||
if command -v git > /dev/null 2>&1; then
|
||||
GIT_AUTO_FETCH_INTERVAL=3600
|
||||
zinit snippet OMZL::git.zsh
|
||||
zinit snippet OMZP::git
|
||||
zinit snippet OMZP::github
|
||||
zinit load paulirish/git-open
|
||||
[ -z ${SSH_CONNECTION+set} ] && zinit snippet OMZP::git-auto-fetch
|
||||
if [ -x /usr/bin/git-extras ]; then
|
||||
zinit snippet OMZP::git-extras
|
||||
else
|
||||
zinit lucid wait'0a' depth"1" for \
|
||||
as"program" \
|
||||
pick"$ZPFX/bin/git-*" \
|
||||
src"etc/git-extras-completion.zsh" \
|
||||
make"PREFIX=$ZPFX" tj/git-extras
|
||||
fi
|
||||
zinit snippet OMZP::github
|
||||
[ -z ${SSH_CONNECTION+set} ] && zinit snippet OMZP::git-auto-fetch
|
||||
zinit light unixorn/git-extra-commands
|
||||
fi
|
||||
|
||||
if command -v psql > /dev/null 2>&1; then
|
||||
@ -84,6 +98,6 @@ if command -v tmux > /dev/null 2>&1; then
|
||||
zinit light amyreese/zsh-titles
|
||||
fi
|
||||
if command -v kitty > /dev/null 2>&1; then
|
||||
zinit load redxtech/zsh-kitty
|
||||
zinit light redxtech/zsh-kitty
|
||||
fi
|
||||
|
||||
|
@ -3,28 +3,38 @@
|
||||
|
||||
# Copy this file to 55-agents.user.zsh and modify to your needs
|
||||
|
||||
##
|
||||
# SSH agent
|
||||
##
|
||||
# SSH agent #{{{
|
||||
# if command -v ssh-agent >/dev/null 2>&1; then
|
||||
# zstyle :omz:plugins:ssh-agent agent-forwarding on
|
||||
# zstyle :omz:plugins:ssh-agent identities id_rsa
|
||||
# zstyle :omz:plugins:ssh-agent lifetime 10h
|
||||
# zinit snippet OMZP::ssh-agent
|
||||
# fi
|
||||
#}}}
|
||||
|
||||
##
|
||||
# GPG agent
|
||||
##
|
||||
if command -v gpg-agent >/dev/null 2>&1; then
|
||||
zinit snippet OMZP::gpg-agent
|
||||
if command -v gpg-conf >/dev/null 2>&1; then
|
||||
gpgconf --create-socketdir
|
||||
fi
|
||||
fi
|
||||
# GPG agent #{{{
|
||||
# if command -v gpg-agent >/dev/null 2>&1; then
|
||||
# zinit snippet OMZP::gpg-agent
|
||||
# if command -v gpg-conf >/dev/null 2>&1; then
|
||||
# gpgconf --create-socketdir
|
||||
# fi
|
||||
# fi
|
||||
#}}}
|
||||
|
||||
##
|
||||
# Keychain
|
||||
##
|
||||
# Keychain #{{{
|
||||
# if command -v keychain >/dev/null 2>&1; then
|
||||
# zstyle :omz:plugins:keychain identities id_rsa 01234567
|
||||
# zstyle :omz:plugins:keychain options --quiet --inherit any-once --noask --nocolor --gpg2 --absolute --dir ~/.cache/keychain
|
||||
# zstyle :omz:plugins:keychain options --quiet --inherit any-once --noask --nocolor --absolute --dir ~/.cache/keychain
|
||||
# zstyle :omz:plugins:keychain agents gpg,ssh
|
||||
# zinit snippet OMZP::keychain
|
||||
# fi
|
||||
#}}}
|
||||
|
||||
# Keychain: вариант только для ssh-agent #{{{
|
||||
# if command -v keychain >/dev/null 2>&1; then
|
||||
# zstyle :omz:plugins:keychain identities id_rsa
|
||||
# zstyle :omz:plugins:keychain options --quiet --inherit any-once --noask --nocolor
|
||||
# zstyle :omz:plugins:keychain agents ssh
|
||||
# zinit snippet OMZP::keychain
|
||||
# fi
|
||||
#}}}
|
||||
|
@ -3,10 +3,15 @@
|
||||
|
||||
# Обновление конфигурации zsh, менеджера zinit и плагинов
|
||||
zu() {
|
||||
git -C "${ZDOTDIR}" pull && zinit update --parallel
|
||||
git -C $ZDOTDIR rev-parse 2>/dev/null && git -C $ZDOTDIR pull
|
||||
zinit update --parallel --all
|
||||
exec zsh
|
||||
}
|
||||
|
||||
gpsr() {
|
||||
git push -u "$1" "$(git branch --show-current)"
|
||||
}
|
||||
|
||||
ch() {
|
||||
curl -s "https://cheat.sh/$1" | less -R
|
||||
}
|
@ -1,13 +1,11 @@
|
||||
# shellcheck shell=bash
|
||||
# vim: ft=sh
|
||||
|
||||
# Dotdrop
|
||||
alias dotdrop="$HOME/etc/dotdrop.sh" --cfg="$HOME/etc/config.yaml"
|
||||
|
||||
# zmv
|
||||
alias zcp='zmv -C'
|
||||
alias zln='zmv -L'
|
||||
|
||||
# shellcheck disable=SC2154
|
||||
alias path='print -l $path'
|
||||
alias mkdir='mkdir -pv'
|
||||
|
||||
@ -21,26 +19,31 @@ alias aptc='sudo apt-get --purge autoremove && sudo apt-get clean'
|
||||
alias aptk='sudo apt-key add'
|
||||
alias apts='apt-cache show'
|
||||
aptf() {
|
||||
[ -z $1 ] && return 1
|
||||
if [ -z $2 ]; then
|
||||
apt-cache search $1
|
||||
[ -z "$1" ] && return 1
|
||||
if [ -z "$2" ]; then
|
||||
apt-cache search "$1"
|
||||
else
|
||||
apt-cache search $1 | grep $2
|
||||
apt-cache search "$1" | grep "$2"
|
||||
fi
|
||||
}
|
||||
|
||||
alias lzg='lazygit'
|
||||
alias lzd='lazydocker'
|
||||
alias tldr='tealdeer'
|
||||
|
||||
# Youtube
|
||||
if command -v youtube-dl > /dev/null 2>&1; then
|
||||
alias ydlbest="youtube-dl --merge-output-format mkv -f 'bestvideo+bestaudio'"
|
||||
alias ydlaudio="youtube-dl -f bestaudio"
|
||||
alias ydl="youtube-dl --merge-output-format mkv"
|
||||
if command -v yt-dlp > /dev/null 2>&1; then
|
||||
alias ydlbest="yt-dlp --merge-output-format mkv -f 'bestvideo+bestaudio'"
|
||||
alias ydlaudio="yt-dlp -f bestaudio"
|
||||
alias ydl="yt-dlp --merge-output-format mkv"
|
||||
alias youtube-dl="yt-dlp"
|
||||
fi
|
||||
|
||||
# feh
|
||||
command -v feh > /dev/null 2>&1 && alias feh="feh --cache-size 256 --version-sort --sort filename --image-bg black"
|
||||
|
||||
# Замена шрифта у заголовка окна в i3 при использовании ssh или mosh
|
||||
if [ ! -z ${DISPLAY+set} ] ; then
|
||||
if [ -n "${DISPLAY+set}" ] ; then
|
||||
if command -v i3-msg >/dev/null 2>&1 ; then
|
||||
i3-mosh () {
|
||||
i3-msg -q title_format "<span foreground='#AAAAFF' font-weight='bold'>%title</span>"
|
||||
@ -63,7 +66,11 @@ alias gu="git pull"
|
||||
alias gur="git pull --recurse-submodules"
|
||||
alias gsui="git submodule update --recursive --init"
|
||||
alias gsur="git submodule update --recursive --init --remote"
|
||||
command -v lazygit > /dev/null 2>&1 && alias lg=lazygit
|
||||
|
||||
alias ycal="ncal $(date +%Y)"
|
||||
|
||||
# gdu вместо ncdu
|
||||
command -v gdu > /dev/null 2>&1 && alias ncdu=gdu
|
||||
|
||||
# Фильтры (H,T,G,L определены в common-aliases)
|
||||
alias -g N1='1>/dev/null'
|
||||
@ -84,4 +91,5 @@ alias -g XS0='| sort -z | xargs -0'
|
||||
|
||||
alias -g Z='| fzf'
|
||||
|
||||
# shellcheck disable=SC1073,SC1064,SC1072
|
||||
audio-join() ffmpeg -i "concat:${(j:|:)@[2,-1]}" -acodec copy $1
|
48
72-widgets.zsh
Normal file
48
72-widgets.zsh
Normal file
@ -0,0 +1,48 @@
|
||||
# shellcheck shell=bash
|
||||
# vim: ft=sh
|
||||
|
||||
# Navi
|
||||
if command -v navi > /dev/null 2>&1; then
|
||||
zinit snippet https://github.com/denisidoro/navi/blob/master/shell/navi.plugin.zsh
|
||||
function magic-ctrl-g {
|
||||
if ! (( $#BUFFER )) && [[ "$CONTEXT" == start ]]; then _navi_widget; fi
|
||||
}
|
||||
zle -N magic-ctrl-g
|
||||
bindkey '^G' magic-ctrl-g
|
||||
fi
|
||||
|
||||
# FZF #{{{
|
||||
if command -v fzf > /dev/null 2>&1; then
|
||||
function magic-ctrl-f {
|
||||
if ! (( $#BUFFER )) && [[ "$CONTEXT" == start ]]; then fzf-file-widget; fi
|
||||
}
|
||||
zle -N magic-ctrl-f
|
||||
bindkey '^F' magic-ctrl-f
|
||||
fi
|
||||
#}}}
|
||||
|
||||
ZSH_FZF_PASTE_KEY=enter
|
||||
ZSH_FZF_EXEC_KEY=ctrl-r
|
||||
fzf-kill-proc-by-list() {
|
||||
local cmd=$([ "$UID" != '0' ] && echo "ps -f -u $UID" || echo 'ps -ef')
|
||||
local res=$(${=cmd} \
|
||||
| FZF_DEFAULT_OPTS="${FZF_DEFAULT_OPTS}
|
||||
--no-sort
|
||||
--reverse
|
||||
--bind=\"${ZSH_FZF_PASTE_KEY}:execute@echo kill -9 \$(echo {} | awk '{print \$2}')@+abort\"
|
||||
--bind=\"${ZSH_FZF_EXEC_KEY}:execute@kill -9 \$(echo {} | awk '{print \$2}')@+abort\"
|
||||
" $(__fzfcmd))
|
||||
|
||||
if [[ -n "$res" ]]; then
|
||||
LBUFFER=${LBUFFER}$res
|
||||
zle redisplay
|
||||
else
|
||||
zle reset-prompt
|
||||
fi
|
||||
}
|
||||
|
||||
if command -v fzf > /dev/null 2>&1; then
|
||||
zle -N fzf-kill-proc-by-list
|
||||
bindkey '^Z' fzf-kill-proc-by-list
|
||||
fi
|
||||
|
6
78-keybindings.zsh
Normal file
6
78-keybindings.zsh
Normal file
@ -0,0 +1,6 @@
|
||||
# shellcheck shell=bash
|
||||
# vim: ft=sh
|
||||
|
||||
# [Esc] [Esc]
|
||||
bindkey '\e\e' send-break
|
||||
|
@ -5,6 +5,7 @@
|
||||
zstyle ':completion:*' accept-exact '*(N)'
|
||||
zstyle ':completion:*' use-cache on
|
||||
zstyle ':completion:*' cache-path "$ZSH_CACHE_DIR"
|
||||
zstyle ':completion:*' menu select
|
||||
|
||||
zstyle ':completion:*:processes' command 'ps -ax'
|
||||
zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#)*=0=01;32'
|
||||
@ -28,7 +29,7 @@ zstyle ':completion:*:(ssh|scp|rsync):*:hosts-ipaddr' ignored-patterns '^<->.<->
|
||||
|
||||
# marlonrichert/zsh-autocomplete
|
||||
|
||||
zinit wait'!0' lucid light-mode depth'1' for \
|
||||
zinit wait'0' lucid light-mode depth'1' for \
|
||||
atinit"ZINIT[COMPINIT_OPTS]=-C; zicompinit; zicdreplay" \
|
||||
zdharma-continuum/fast-syntax-highlighting \
|
||||
blockf \
|
||||
@ -36,16 +37,17 @@ zinit wait'!0' lucid light-mode depth'1' for \
|
||||
atload"!_zsh_autosuggest_start" \
|
||||
zsh-users/zsh-autosuggestions
|
||||
|
||||
if [[ -n ${ZSH_MC_SUBSHELL+set} ]] && [[ -n ${SSH_CONNECTION+set} ]]; then
|
||||
zinit load zsh-users/zsh-history-substring-search
|
||||
else
|
||||
zstyle ":history-search-multi-word" page-size "$((LINES/2))"
|
||||
zstyle ":plugin:history-search-multi-word" clear-on-cancel "yes"
|
||||
zinit wait'!0' lucid light-mode depth'1' for \
|
||||
zdharma-continuum/history-search-multi-word \
|
||||
zinit wait'0' lucid light-mode depth'1' for \
|
||||
atload"bindkey '^[[A' history-substring-search-up; \
|
||||
bindkey '^[[B' history-substring-search-down; \
|
||||
bindkey '^K' history-search-multi-word " \
|
||||
bindkey '^[[B' history-substring-search-down" \
|
||||
zsh-users/zsh-history-substring-search
|
||||
fi
|
||||
|
||||
#[ "$(lsb_release -c -s)" = "orel" ] && ZSH_HISTORY_SEARCH_MULTI_WORD_MODE=1
|
||||
#[ -n "${SSH_CONNECTION}" ] && ZSH_HISTORY_SEARCH_MULTI_WORD_MODE=2
|
||||
#zstyle ':history-search-multi-word' page-size "$((LINES/2))"
|
||||
#zstyle ':plugin:history-search-multi-word' clear-on-cancel 'yes'
|
||||
#zinit ice if'[[ -z ${ZSH_HISTORY_SEARCH_MULTI_WORD_MODE+set} ]]' \
|
||||
# wait'0' lucid light-mode depth'1' for \
|
||||
# atload"bindkey '^K' history-search-multi-word"
|
||||
#zinit light zdharma-continuum/history-search-multi-word
|
||||
|
||||
|
@ -1,17 +0,0 @@
|
||||
# shellcheck shell=bash
|
||||
# vim: ft=sh
|
||||
|
||||
# [Esc] [Esc] вместо Ctrl+G
|
||||
bindkey '\e\e' send-break
|
||||
|
||||
# Navi
|
||||
bindkey '^G' _navi_widget
|
||||
|
||||
# FZF #{{{
|
||||
bindkey "^F" fzf-file-widget # Ctrl+F file search
|
||||
bindkey "^[[A" fzf-history-widget # Up
|
||||
bindkey "^[[B" fzf-history-widget # Down
|
||||
bindkey "${terminfo[kcuu1]}" fzf-history-widget # Up
|
||||
bindkey "${terminfo[kcud1]}" fzf-history-widget # Down
|
||||
#}}}
|
||||
|
@ -6,7 +6,15 @@ if is-at-least 5.3; then
|
||||
zinit light romkatv/powerlevel10k
|
||||
|
||||
# To customize prompt, run `p10k configure` or edit ~/.config/zsh/.p10k.zsh.
|
||||
if [[ -r "$ZDOTDIR/.p10k.user.zsh" ]]; then
|
||||
source "$ZDOTDIR/.p10k.user.zsh"
|
||||
else
|
||||
if [[ "$TERM" = "xterm" ]]; then
|
||||
[[ -r "$ZDOTDIR/.p10k.8colors.zsh" ]] && source "$ZDOTDIR/.p10k.8colors.zsh"
|
||||
else
|
||||
[[ -r "$ZDOTDIR/.p10k.zsh" ]] && source "$ZDOTDIR/.p10k.zsh"
|
||||
fi
|
||||
fi
|
||||
else
|
||||
zinit load agkozak/agkozak-zsh-prompt
|
||||
zinit light agkozak/agkozak-zsh-prompt
|
||||
fi
|
||||
|
44
README.md
44
README.md
@ -1,21 +1,38 @@
|
||||
# Быстрая установка
|
||||
|
||||
```sh
|
||||
sudo apt-get install curl
|
||||
sh -c "$(curl -fsSL https://git.246060.ru/config/zsh/raw/branch/master/install.sh)"
|
||||
```
|
||||
|
||||
# Установка
|
||||
|
||||
Установка оболочки [`Zsh`](https://www.zsh.org):
|
||||
Установить оболочку [Zsh](https://www.zsh.org) и git:
|
||||
|
||||
```sh
|
||||
sudo apt-get install git zsh
|
||||
sudo apt-get install git zsh curl
|
||||
```
|
||||
|
||||
Установка желательных пакетов:
|
||||
На системах, где нет пакета Zsh или есть только старая версия, можно установить статически
|
||||
скомпилированную версию программы командой:
|
||||
|
||||
```sh
|
||||
sudo apt-get install autojump command-not-found grc grepcidr kitty-terminfo wmctrl xdotool
|
||||
sh -c "$(curl -fsSL https://raw.githubusercontent.com/romkatv/zsh-bin/master/install)"
|
||||
```
|
||||
|
||||
Клонирование репозитория в каталог `~/.config/zsh`:
|
||||
Установить рекомендуемые пакеты:
|
||||
|
||||
```sh
|
||||
git clone https://git.246060.ru/f1x1t/zshrc ~/.config/zsh
|
||||
sudo apt-get install command-not-found grc grepcidr kitty-terminfo wmctrl xdotool
|
||||
```
|
||||
|
||||
Установить дополнительные программы по [инструкции](https://git.246060.ru/config/eget/).
|
||||
|
||||
|
||||
Клонировать репозиторий с настройками Zsh в каталог `~/.config/zsh`:
|
||||
|
||||
```sh
|
||||
git clone https://git.246060.ru/config/zsh ~/.config/zsh
|
||||
```
|
||||
|
||||
# Базовая настройка
|
||||
@ -34,6 +51,14 @@ source $ZDOTDIR/.zshenv
|
||||
sudo usermod -s /usr/bin/zsh username
|
||||
```
|
||||
|
||||
# Установка шрифтов
|
||||
|
||||
```sh
|
||||
wget -A ".deb" -c -q -np -nd -r -l 1 https://deb.246060.ru/bin/fonts/pool/main/f/fonts-iosevka-prog/
|
||||
wget -A ".deb" -c -q -np -nd -r -l 1 https://deb.246060.ru/bin/fonts/pool/main/f/fonts-iosevka-prog-nerd/
|
||||
sudo dpkg -i fonts*deb
|
||||
```
|
||||
|
||||
# Настройка агентов
|
||||
|
||||
Существует несколько вариантов настройки агентов для SSH и/или GPG.
|
||||
@ -159,6 +184,13 @@ zu
|
||||
source $HOME/.config/zsh/fixes.zsh
|
||||
```
|
||||
|
||||
Если в системе установлена программа `fzf` версии ниже `0.53.0`, то может
|
||||
не работать поиск по истории, файлам и автодополнение. Исправление:
|
||||
|
||||
```
|
||||
fix-update-fzf
|
||||
```
|
||||
|
||||
Для обеспечения поддержки терминала `kitty` на системах, где недоступно
|
||||
его описание, можно выполнить команду:
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
# где отсутствует пакет kitty-terminfo
|
||||
fix-kitty-terminal-support() {
|
||||
mkdir -p $HOME/.terminfo/x
|
||||
wget -qO - https://github.com/kovidgoyal/kitty/raw/master/terminfo/x/xterm-kitty > $HOME/.terminfo/x/xterm-kitty
|
||||
curl -fsSL https://github.com/kovidgoyal/kitty/raw/master/terminfo/x/xterm-kitty > $HOME/.terminfo/x/xterm-kitty
|
||||
}
|
||||
|
||||
# Настройка mc для работы в терминале kitty
|
||||
@ -24,3 +24,9 @@ fix-mc-kitty-support() {
|
||||
fi
|
||||
}
|
||||
|
||||
# Новые версии плагинов для поиска используют функционал fzf версии 0.54.1.
|
||||
fix-update-fzf() {
|
||||
mkdir -p $HOME/bin
|
||||
wget -O- https://github.com/junegunn/fzf/releases/download/v0.54.1/fzf-0.54.1-linux_amd64.tar.gz | tar -zxf - -C $HOME/bin
|
||||
}
|
||||
|
||||
|
20
install.sh
Normal file
20
install.sh
Normal file
@ -0,0 +1,20 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
sudo apt-get install git zsh curl wget
|
||||
git clone https://git.246060.ru/config/zsh $HOME/.config/zsh
|
||||
|
||||
cat <<EOF > $HOME/.zshenv
|
||||
# Загрузка конфигурации из каталога \$ZDOTDIR
|
||||
export ZDOTDIR=\$HOME/.config/zsh
|
||||
source \$ZDOTDIR/.zshenv
|
||||
EOF
|
||||
|
||||
sudo usermod -s $(which zsh) $(whoami)
|
||||
|
||||
TEMP="${XDG_RUNTIME_DIR:-/tmp}"
|
||||
wget -P "$TEMP" -c -r -nd --no-parent -A "fonts-iosevka-prog-nerd_*_all.deb" https://deb.246060.ru/bin/fonts/pool/main/f/fonts-iosevka-prog-nerd/
|
||||
sudo dpkg -i "$TEMP"/fonts-iosevka-prog-nerd_*_all.deb
|
||||
rm -f "$TEMP"/fonts-iosevka-prog-nerd_*_all.deb
|
||||
|
Reference in New Issue
Block a user