Merge branch 'master' of https://git.246060.ru/f1x1t/zshrc
This commit is contained in:
		
							
								
								
									
										5
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										5
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							@@ -1,4 +1,5 @@
 | 
			
		||||
.zcompdump*
 | 
			
		||||
keychain-config.zsh
 | 
			
		||||
*.user.zsh
 | 
			
		||||
*.start.zsh
 | 
			
		||||
*.post.zsh
 | 
			
		||||
*.pre.zsh
 | 
			
		||||
*.zwc
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										45
									
								
								.zshrc
									
									
									
									
									
								
							
							
						
						
									
										45
									
								
								.zshrc
									
									
									
									
									
								
							@@ -1,27 +1,22 @@
 | 
			
		||||
[ -e $ZDOTDIR/env.start.zsh ] && source $ZDOTDIR/env.start.zsh
 | 
			
		||||
 | 
			
		||||
source $ZDOTDIR/env.zsh
 | 
			
		||||
[ -e $ZDOTDIR/env.user.zsh ] && source $ZDOTDIR/env.user.zsh
 | 
			
		||||
 | 
			
		||||
source $ZDOTDIR/history.zsh
 | 
			
		||||
[ -e $ZDOTDIR/history.user.zsh ] && source $ZDOTDIR/history.user.zsh
 | 
			
		||||
 | 
			
		||||
source $ZDOTDIR/options.zsh
 | 
			
		||||
[ -e $ZDOTDIR/options.user.zsh ] && source $ZDOTDIR/options.user.zsh
 | 
			
		||||
 | 
			
		||||
source $ZDOTDIR/plugins.zsh
 | 
			
		||||
[ -e $ZDOTDIR/plugins.user.zsh ] && source $ZDOTDIR/plugins.user.zsh
 | 
			
		||||
 | 
			
		||||
source $ZDOTDIR/agents.zsh
 | 
			
		||||
[ -e $ZDOTDIR/agents.user.zsh ] && source $ZDOTDIR/agents.user.zsh
 | 
			
		||||
 | 
			
		||||
source $ZDOTDIR/prompt.zsh
 | 
			
		||||
[ -e $ZDOTDIR/prompt.user.zsh ] && source $ZDOTDIR/prompt.user.zsh
 | 
			
		||||
 | 
			
		||||
source $ZDOTDIR/aliases.zsh
 | 
			
		||||
[ -e $ZDOTDIR/aliases.user.zsh ] && source $ZDOTDIR/aliases.user.zsh
 | 
			
		||||
 | 
			
		||||
source $ZDOTDIR/compinit.zsh
 | 
			
		||||
[ -e $ZDOTDIR/compinit.user.zsh ] && source $ZDOTDIR/compinit.user.zsh
 | 
			
		||||
for S in \
 | 
			
		||||
	05-start \
 | 
			
		||||
	15-env \
 | 
			
		||||
	25-history \
 | 
			
		||||
	35-options \
 | 
			
		||||
	45-plugins \
 | 
			
		||||
	55-agents \
 | 
			
		||||
	65-prompt \
 | 
			
		||||
	75-aliases \
 | 
			
		||||
	78-scripts \
 | 
			
		||||
	85-compinit \
 | 
			
		||||
	95-finish
 | 
			
		||||
do
 | 
			
		||||
	N="${S//[0-9\-]/}"
 | 
			
		||||
	[ -e "$ZDOTDIR/$S.pre.zsh" ]  && source "$ZDOTDIR/$S.pre.zsh"
 | 
			
		||||
	[ -e "$ZDOTDIR/$S.zsh" ]      && source "$ZDOTDIR/$S.zsh"
 | 
			
		||||
	[ -e "$ZDOTDIR/$S.user.zsh" ] && source "$ZDOTDIR/$S.user.zsh"
 | 
			
		||||
	[ -e "$ZDOTDIR/$N.user.zsh" ] && source "$ZDOTDIR/$N.user.zsh"
 | 
			
		||||
	[ -e "$ZDOTDIR/$S.post.zsh" ] && source "$ZDOTDIR/$S.post.zsh"
 | 
			
		||||
done
 | 
			
		||||
 | 
			
		||||
true
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										53
									
								
								15-env.zsh
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										53
									
								
								15-env.zsh
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,53 @@
 | 
			
		||||
export XDG_CONFIG_HOME="$HOME/.config"
 | 
			
		||||
export XDG_CACHE_HOME="$HOME/.cache"
 | 
			
		||||
export XDG_DATA_HOME="$HOME/.local/share"
 | 
			
		||||
 | 
			
		||||
export ZSH_CACHE_DIR="$XDG_CACHE_HOME/zsh"
 | 
			
		||||
export ZSH_COMPDUMP="$ZSH_CACHE_DIR/completions/dump"
 | 
			
		||||
export ZGEN_SOURCE="$ZSH_CACHE_DIR"
 | 
			
		||||
export ZGEN_SOURCE_BIN="$ZSH_CACHE_DIR/plugins"
 | 
			
		||||
export ZGEN_DIR="$ZSH_CACHE_DIR/zgenom"
 | 
			
		||||
 | 
			
		||||
if ps $PPID | grep mc; then
 | 
			
		||||
	export ZSH_IS_SUBSHELL=1
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
ZPFX=$ZGEN_DIR/polaris
 | 
			
		||||
 | 
			
		||||
DISABLE_AUTO_UPDATE=true
 | 
			
		||||
 | 
			
		||||
# PATH
 | 
			
		||||
for P in \
 | 
			
		||||
	"$HOME/.vim/plugged/vim-superman/bin" \
 | 
			
		||||
	"$HOME/bin" \
 | 
			
		||||
	"$HOME/.local/bin"
 | 
			
		||||
do
 | 
			
		||||
	if [[ -d "${P}" ]]; then
 | 
			
		||||
		export PATH="${P}:${PATH}"
 | 
			
		||||
	fi
 | 
			
		||||
done
 | 
			
		||||
 | 
			
		||||
# Удалить дубликаты в PATH
 | 
			
		||||
typeset -U PATH
 | 
			
		||||
 | 
			
		||||
export GNUPGHOME="$XDG_CONFIG_HOME/gnupg"
 | 
			
		||||
export SVDIR="$HOME/sv"
 | 
			
		||||
 | 
			
		||||
# Настройка uncrustify
 | 
			
		||||
UNCRUSTIFY_CONFIG="${XDG_CONFIG_HOME}/uncrustify/default.cfg"
 | 
			
		||||
[ -e "${UNCRUSTIFY_CONFIG}" ] && export UNCRUSTIFY_CONFIG
 | 
			
		||||
 | 
			
		||||
# Настройка Intel Studio
 | 
			
		||||
if [ ! -z ${ENABLE_INTEL_STUDIO+x} ]; then
 | 
			
		||||
	#export COMPILERVARS_ARCHITECTURE=intel64
 | 
			
		||||
	#export COMPILERVARS_PLATFORM=linux
 | 
			
		||||
	#/opt/intel/bin/iccvars.sh
 | 
			
		||||
	INTEL_VARS=( /opt/intel/advisor/advixe-vars.sh
 | 
			
		||||
	             /opt/intel/inspector/inspxe-vars.sh
 | 
			
		||||
	             /opt/intel/vtune_profiler/vtune-vars.sh )
 | 
			
		||||
 | 
			
		||||
	for f in ${INTEL_VARS[*]}; do
 | 
			
		||||
		[ -e "$f" ] && source "$f" > /dev/null
 | 
			
		||||
	done
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
@@ -1,9 +1,9 @@
 | 
			
		||||
HISTFILE="$HOME/.cache/zsh/history"
 | 
			
		||||
HISTFILE="$ZSH_CACHE_DIR/history"
 | 
			
		||||
HISTSIZE=10000000
 | 
			
		||||
SAVEHIST=10000000
 | 
			
		||||
HISTDUP=erase
 | 
			
		||||
 | 
			
		||||
[ ! -d "$HOME/.cache/zsh" ] && mkdir -p "$HOME/.cache/zsh"
 | 
			
		||||
[ ! -d "$ZSH_CACHE_DIR" ] && mkdir -p "$ZSH_CACHE_DIR"
 | 
			
		||||
 | 
			
		||||
setopt BANG_HIST                 # Treat the '!' character specially during expansion.
 | 
			
		||||
setopt EXTENDED_HISTORY          # Write the history file in the ":start:elapsed;command" format.
 | 
			
		||||
@@ -19,4 +19,3 @@ setopt HIST_REDUCE_BLANKS        # Remove superfluous blanks before recording en
 | 
			
		||||
setopt HIST_VERIFY               # Don't execute immediately upon history expansion.
 | 
			
		||||
setopt HIST_BEEP                 # Beep when accessing nonexistent history.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										19
									
								
								35-options.zsh
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										19
									
								
								35-options.zsh
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,19 @@
 | 
			
		||||
setopt AUTO_PUSHD           # Push the current directory visited on the stack.
 | 
			
		||||
setopt PUSHD_IGNORE_DUPS    # Do not store duplicates in the stack.
 | 
			
		||||
setopt PUSHD_SILENT         # Do not print the directory stack after pushd or popd.
 | 
			
		||||
 | 
			
		||||
autoload -Uz allopt zed zmv zcalc colors
 | 
			
		||||
colors
 | 
			
		||||
 | 
			
		||||
zmodload zsh/terminfo
 | 
			
		||||
 | 
			
		||||
autoload -Uz edit-command-line
 | 
			
		||||
zle -N edit-command-line
 | 
			
		||||
bindkey -M vicmd v edit-command-line
 | 
			
		||||
 | 
			
		||||
autoload -Uz select-word-style
 | 
			
		||||
select-word-style shell
 | 
			
		||||
 | 
			
		||||
autoload -Uz url-quote-magic
 | 
			
		||||
zle -N self-insert url-quote-magic
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										70
									
								
								45-plugins.zsh
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										70
									
								
								45-plugins.zsh
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,70 @@
 | 
			
		||||
# Менеджер плагинов zgenom
 | 
			
		||||
if [ ! -e "$ZGEN_DIR/zgenom.zsh" ]; then
 | 
			
		||||
	git clone https://github.com/jandamm/zgenom "$ZGEN_DIR"
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
source "$ZGEN_DIR/zgenom.zsh"
 | 
			
		||||
 | 
			
		||||
#
 | 
			
		||||
# Ohmyzsh
 | 
			
		||||
#
 | 
			
		||||
zgenom ohmyzsh
 | 
			
		||||
 | 
			
		||||
# Плагины
 | 
			
		||||
zgenom load willghatch/zsh-saneopt
 | 
			
		||||
zgenom load mafredri/zsh-async
 | 
			
		||||
zgenom load djui/alias-tips
 | 
			
		||||
 | 
			
		||||
zgenom load rupa/z
 | 
			
		||||
if [[ "$DISPLAY" != '' ]] && command -v xdotool > /dev/null 2>&1 &&  command -v wmctrl > /dev/null 2>&1; then
 | 
			
		||||
	zgenom load marzocchi/zsh-notify
 | 
			
		||||
	zstyle ':notify:*' expire-time 5000
 | 
			
		||||
	zstyle ':notify:*' command-complete-timeout 20
 | 
			
		||||
	zstyle ':notify:*' enable-on-ssh yes
 | 
			
		||||
fi
 | 
			
		||||
if command -v peco > /dev/null 2>&1; then
 | 
			
		||||
	zgenom load jimeh/zsh-peco-history
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
zgenom ohmyzsh plugins/autojump
 | 
			
		||||
zgenom ohmyzsh plugins/command-not-found
 | 
			
		||||
zgenom ohmyzsh plugins/common-aliases
 | 
			
		||||
zgenom ohmyzsh plugins/debian
 | 
			
		||||
zgenom ohmyzsh plugins/isodate
 | 
			
		||||
zgenom ohmyzsh plugins/rsync
 | 
			
		||||
zgenom ohmyzsh plugins/systemadmin
 | 
			
		||||
if command -v fzf > /dev/null 2>&1; then
 | 
			
		||||
	export DISABLE_FZF_KEY_BINDINGS=true
 | 
			
		||||
	zgenom ohmyzsh plugins/fzf
 | 
			
		||||
	# fzf
 | 
			
		||||
	[ -e /usr/share/doc/fzf/examples/key-bindings.zsh ] && source /usr/share/doc/fzf/examples/key-bindings.zsh
 | 
			
		||||
	[ -e /usr/share/doc/fzf/examples/completion.zsh ]   && source /usr/share/doc/fzf/examples/completion.zsh
 | 
			
		||||
fi
 | 
			
		||||
if command -v git > /dev/null 2>&1; then
 | 
			
		||||
	GIT_AUTO_FETCH_INTERVAL=3600
 | 
			
		||||
	zgenom ohmyzsh plugins/git
 | 
			
		||||
	zgenom ohmyzsh plugins/git-auto-fetch
 | 
			
		||||
	zgenom ohmyzsh plugins/git-extras
 | 
			
		||||
	zgenom ohmyzsh plugins/github
 | 
			
		||||
	zgenom load paulirish/git-open
 | 
			
		||||
fi
 | 
			
		||||
if command -v psql > /dev/null 2>&1; then
 | 
			
		||||
	zgenom ohmyzsh plugins/postgres
 | 
			
		||||
fi
 | 
			
		||||
if command -v sudo > /dev/null 2>&1; then
 | 
			
		||||
	zgenom ohmyzsh plugins/sudo
 | 
			
		||||
fi
 | 
			
		||||
if command -v systemctl > /dev/null 2>&1; then
 | 
			
		||||
	zgenom ohmyzsh plugins/systemd
 | 
			
		||||
fi
 | 
			
		||||
if command -v vim > /dev/null 2>&1; then
 | 
			
		||||
	zgenom ohmyzsh plugins/vim-interaction
 | 
			
		||||
fi
 | 
			
		||||
zgenom ohmyzsh plugins/web-search
 | 
			
		||||
 | 
			
		||||
zgenom ohmyzsh plugins/tmux
 | 
			
		||||
zstyle ':prezto:module:tmux:auto-start' local 'no'
 | 
			
		||||
zstyle ':prezto:module:tmux:auto-start' remote 'yes'
 | 
			
		||||
zstyle ':prezto:module:tmux:session' name "$(hostname)"
 | 
			
		||||
zgenom load laggardkernel/zsh-tmux
 | 
			
		||||
 | 
			
		||||
@@ -6,13 +6,12 @@
 | 
			
		||||
# 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
 | 
			
		||||
# zgenom ohmyzsh plugins/ssh-agent
 | 
			
		||||
 | 
			
		||||
##
 | 
			
		||||
# GPG agent
 | 
			
		||||
##
 | 
			
		||||
# zinit ice wait'1' lucid
 | 
			
		||||
# zinit light laggardkernel/zsh-gpg-agent
 | 
			
		||||
# zgenom ohmyzsh plugins/gpg-agent
 | 
			
		||||
 | 
			
		||||
##
 | 
			
		||||
# Keychain
 | 
			
		||||
@@ -20,5 +19,5 @@
 | 
			
		||||
# zstyle :omz:plugins:keychain identities id_rsa 01234567
 | 
			
		||||
# zstyle :omz:plugins:keychain options --quiet --inherit local-once --noask --nocolor --quick
 | 
			
		||||
# zstyle :omz:plugins:keychain agents gpg,ssh
 | 
			
		||||
# zinit snippet OMZP::keychain
 | 
			
		||||
# zgenom ohmyzsh plugins/keychain
 | 
			
		||||
 | 
			
		||||
@@ -29,7 +29,7 @@ fi
 | 
			
		||||
 | 
			
		||||
autoload is-at-least
 | 
			
		||||
if is-at-least "5.2" "$ZSH_VERSION"; then
 | 
			
		||||
	zinit load "denysdovhan/spaceship-prompt"
 | 
			
		||||
	zgenom load "denysdovhan/spaceship-prompt"
 | 
			
		||||
else
 | 
			
		||||
	zinit load "nojhan/liquidprompt"
 | 
			
		||||
	zgenom load "nojhan/liquidprompt"
 | 
			
		||||
fi
 | 
			
		||||
@@ -13,7 +13,8 @@ alias aptp='sudo apt-get purge'
 | 
			
		||||
alias aptr='sudo apt-get remove'
 | 
			
		||||
alias aptc='sudo apt-get --purge autoremove'
 | 
			
		||||
alias aptk='sudo apt-key add'
 | 
			
		||||
apts() {
 | 
			
		||||
alias apts='apt-cache show'
 | 
			
		||||
aptf() {
 | 
			
		||||
	[ -z $1 ] && return 1
 | 
			
		||||
	if [ -z $2 ]; then
 | 
			
		||||
		apt-cache search $1
 | 
			
		||||
@@ -22,9 +23,6 @@ apts() {
 | 
			
		||||
	fi
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
# VIM
 | 
			
		||||
alias gvim='gvim --remote-silent'
 | 
			
		||||
 | 
			
		||||
# Youtube
 | 
			
		||||
YDL="$HOME/bin/youtube-dl"
 | 
			
		||||
[ ! -x "$YDL" ] && YDL="$(which youtube-dl)"
 | 
			
		||||
@@ -43,8 +41,6 @@ alias gur="git pull --recurse-submodules"
 | 
			
		||||
alias gsui="git submodule update --recursive --init"
 | 
			
		||||
alias gsur="git submodule update --recursive --init --remote"
 | 
			
		||||
 | 
			
		||||
# Фильтры
 | 
			
		||||
alias -g G="| grep"
 | 
			
		||||
alias -g L="| less"
 | 
			
		||||
# Фильтры (H,T,G,L определены в common-aliases)
 | 
			
		||||
alias -g NN='&>/dev/null'
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										57
									
								
								78-scripts.zsh
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										57
									
								
								78-scripts.zsh
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,57 @@
 | 
			
		||||
ch() {
 | 
			
		||||
	curl -s "https://cheat.sh/$1" | less
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
exf() {
 | 
			
		||||
    case "$1" in
 | 
			
		||||
        *.tar.bz2)  tar xjf "$1"      ;;
 | 
			
		||||
        *.tar.gz)   tar xzf "$1"      ;;
 | 
			
		||||
        *.tar.xz)   tar xJf "$1"      ;;
 | 
			
		||||
        *.tbz2)     tar xjf "$1"      ;;
 | 
			
		||||
        *.tgz)      tar xzf "$1"      ;;
 | 
			
		||||
        *.tar)      tar xf "$1"       ;;
 | 
			
		||||
        *.zip)      unzip "$1"        ;;
 | 
			
		||||
        *.7z)       7z x "$1"         ;;
 | 
			
		||||
        *.iso)      7z x "$1"         ;;
 | 
			
		||||
        *.rar)      unrar x "$1"      ;;
 | 
			
		||||
        *)          echo "'$1' cannot be extracted" ;;
 | 
			
		||||
    esac
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
exfl() {
 | 
			
		||||
    for F in "$@"
 | 
			
		||||
    do
 | 
			
		||||
        if [ -f "$F" ]; then
 | 
			
		||||
            exf "$F"
 | 
			
		||||
        else
 | 
			
		||||
            echo "'$F' is not a valid file"
 | 
			
		||||
        fi
 | 
			
		||||
    done
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
exd() {
 | 
			
		||||
    case "$1" in
 | 
			
		||||
        *.tar.bz2)  b=${1%.tar.bz2}; mkdir -p "$b">/dev/null; tar xjf "$1" -C "$b" ;;
 | 
			
		||||
        *.tar.gz)   b=${1%.tar.gz};  mkdir -p "$b">/dev/null; tar xzf "$1" -C "$b" ;;
 | 
			
		||||
        *.tar.xz)   b=${1%.tar.xz};  mkdir -p "$b">/dev/null; tar xJf "$1" -C "$b" ;;
 | 
			
		||||
        *.tbz2)     b=${1%.tbz2};    mkdir -p "$b">/dev/null; tar xjf "$1" -C "$b" ;;
 | 
			
		||||
        *.tgz)      b=${1%.tgz};     mkdir -p "$b">/dev/null; tar xzf "$1" -C "$b" ;;
 | 
			
		||||
        *.tar)      b=${1%.tar};     mkdir -p "$b">/dev/null; tar xf "$1" -C "$b" ;;
 | 
			
		||||
        *.zip)      b=${1%.zip};     unzip "$1" -d "$b" ;;
 | 
			
		||||
        *.7z)       b=${1%.7z};      7z x -o"$b" "$1"   ;;
 | 
			
		||||
        *.iso)      b=${1%.iso};     7z x -o"$b" "$1"   ;;
 | 
			
		||||
        *.rar)      b=${1%.rar};     rar x "$1" "$b"    ;;
 | 
			
		||||
        *)          echo "'$1' cannot be extracted" ;;
 | 
			
		||||
    esac
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
exdl() {
 | 
			
		||||
    for F in "$@"
 | 
			
		||||
    do
 | 
			
		||||
        if [ -f "$F" ]; then
 | 
			
		||||
            exd "$F"
 | 
			
		||||
        else
 | 
			
		||||
            echo "'$F' is not a valid file"
 | 
			
		||||
        fi
 | 
			
		||||
    done
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										44
									
								
								85-compinit.zsh
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										44
									
								
								85-compinit.zsh
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,44 @@
 | 
			
		||||
if [ -z "${ZSH_IS_SUBSHELL}" ]; then
 | 
			
		||||
	typeset -i _compinit_updated_at=$(date +'%j' -r $ZSH_COMPDUMP 2>/dev/null || stat -f '%Sm' -t '%j' $ZSH_COMPDUMP 2>/dev/null)
 | 
			
		||||
	ZGEN_COMPINIT_FLAGS="-i"
 | 
			
		||||
	if [ $(date +'%j') = $_compinit_updated_at ]; then
 | 
			
		||||
		ZGEN_COMPINIT_FLAGS+=" -C"
 | 
			
		||||
	fi
 | 
			
		||||
	unset _compinit_updated_at
 | 
			
		||||
 | 
			
		||||
	zmodload -i zsh/complist
 | 
			
		||||
	autoload -Uz compinit && eval "compinit $ZGEN_COMPINIT_FLAGS -d $ZSH_COMPDUMP"
 | 
			
		||||
 | 
			
		||||
	#zgenom load marlonrichert/zsh-autocomplete
 | 
			
		||||
	zgenom load zsh-users/zsh-autosuggestions
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
# Speed up autocomplete, force prefix mapping
 | 
			
		||||
zstyle ':completion:*'   accept-exact '*(N)'
 | 
			
		||||
zstyle ':completion:*'   use-cache on
 | 
			
		||||
zstyle ':completion:*'   cache-path $ZSH_CACHE_DIR/completion
 | 
			
		||||
 | 
			
		||||
zstyle ':completion:*:processes'          command 'ps -ax'
 | 
			
		||||
zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#)*=0=01;32'
 | 
			
		||||
zstyle ':completion:*:*:kill:*'           menu yes select
 | 
			
		||||
zstyle ':completion:*:*:kill:*'           force-list always
 | 
			
		||||
zstyle ':completion:*:*:kill:*'           insert-ids single
 | 
			
		||||
 | 
			
		||||
zstyle ':completion:*:processes-names'    command 'ps -e -o comm='
 | 
			
		||||
zstyle ':completion:*:*:killall:*'        menu yes select
 | 
			
		||||
zstyle ':completion:*:killall:*'          force-list always
 | 
			
		||||
 | 
			
		||||
# SSH/SCP/RSYNC
 | 
			
		||||
zstyle ':completion:*:(ssh|scp|rsync):*'   hosts off
 | 
			
		||||
zstyle ':completion:*:(scp|rsync):*'       tag-order 'hosts:-host hosts:-domain:domain hosts:-ipaddr:ip\ address *'
 | 
			
		||||
zstyle ':completion:*:(scp|rsync):*'       group-order users files all-files hosts-domain hosts-host hosts-ipaddr
 | 
			
		||||
zstyle ':completion:*:ssh:*'               tag-order users 'hosts:-host hosts:-domain:domain hosts:-ipaddr:ip\ address *'
 | 
			
		||||
zstyle ':completion:*:ssh:*'               group-order hosts-domain hosts-host users hosts-ipaddr
 | 
			
		||||
zstyle ':completion:*:(ssh|scp|rsync):*:hosts-host'   ignored-patterns '*.*' loopback localhost
 | 
			
		||||
zstyle ':completion:*:(ssh|scp|rsync):*:hosts-domain' ignored-patterns '<->.<->.<->.<->' '^*.*' '*@*'
 | 
			
		||||
zstyle ':completion:*:(ssh|scp|rsync):*:hosts-ipaddr' ignored-patterns '^<->.<->.<->.<->' '127.0.0.<->'
 | 
			
		||||
 | 
			
		||||
# Вызов в этом месте и в таком порядке
 | 
			
		||||
zgenom load zsh-users/zsh-syntax-highlighting
 | 
			
		||||
zgenom load zsh-users/zsh-history-substring-search
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										3
									
								
								95-finish.zsh
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								95-finish.zsh
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,3 @@
 | 
			
		||||
#zgenom save 2>/dev/null
 | 
			
		||||
#zgenom compile $ZDOTDIR
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										23
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										23
									
								
								README.md
									
									
									
									
									
								
							@@ -30,7 +30,7 @@ sudo ${EDITOR:-mcedit} /etc/zsh/zshenv
 | 
			
		||||
и добавить строку
 | 
			
		||||
 | 
			
		||||
```sh
 | 
			
		||||
export ZDOTDIR=$HOME/.config/zsh
 | 
			
		||||
[[ -z "$ZDOTDIR" ]] && export ZDOTDIR=$HOME/.config/zsh
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
Установить интерпретатор Zsh по умолчанию для пользователя `username`.
 | 
			
		||||
@@ -45,16 +45,15 @@ sudo usermod -s /usr/bin/zsh username
 | 
			
		||||
Для любого из вариантов следует скопировать шаблонный файл для настроек:
 | 
			
		||||
 | 
			
		||||
```sh
 | 
			
		||||
cp ~/.config/zsh/agents.zsh ~/.config/zsh/agents.user.zsh
 | 
			
		||||
cp ~/.config/zsh/55-agents.zsh ~/.config/zsh/55-agents.user.zsh
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
## Настройка GPG агента
 | 
			
		||||
 | 
			
		||||
Раскомментировать в файле ` ~/.config/zsh/agents.user.zsh` строки:
 | 
			
		||||
Раскомментировать в файле ` ~/.config/zsh/55-agents.user.zsh` строки:
 | 
			
		||||
 | 
			
		||||
```text
 | 
			
		||||
# zinit ice wait'1' lucid
 | 
			
		||||
# zinit light laggardkernel/zsh-gpg-agent
 | 
			
		||||
# zgenom ohmyzsh plugins/gpg-agent
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
Пример файла настройки GPG агента `~/.config/gnupg/gpg-agent.conf`:
 | 
			
		||||
@@ -75,13 +74,13 @@ pinentry-program /usr/bin/pinentry-qt
 | 
			
		||||
 | 
			
		||||
## Настройка SSH агента
 | 
			
		||||
 | 
			
		||||
Раскомментировать в файле ` ~/.config/zsh/agents.user.zsh` строки:
 | 
			
		||||
Раскомментировать в файле ` ~/.config/zsh/55-agents.user.zsh` строки:
 | 
			
		||||
 | 
			
		||||
```text
 | 
			
		||||
# 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
 | 
			
		||||
# zgenom ohmyzsh plugins/ssh-agent
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
Добавить в конец файла `~/.ssh/config` правило для разрешения агенту сохранять ключи:
 | 
			
		||||
@@ -99,13 +98,13 @@ Host *
 | 
			
		||||
Для её работы необходимо отключить в системе все автоматические запуски агентов,
 | 
			
		||||
например в файле `/etc/X11/Xsession.options`.
 | 
			
		||||
 | 
			
		||||
Раскомментировать в файле ` ~/.config/zsh/agents.user.zsh` строки:
 | 
			
		||||
Раскомментировать в файле ` ~/.config/zsh/55-agents.user.zsh` строки:
 | 
			
		||||
 | 
			
		||||
```text
 | 
			
		||||
# zstyle :omz:plugins:keychain identities id_rsa 01234567
 | 
			
		||||
# zstyle :omz:plugins:keychain options --quiet --inherit local-once --noask --nocolor --quick
 | 
			
		||||
# zstyle :omz:plugins:keychain agents gpg,ssh
 | 
			
		||||
# zinit snippet OMZP::keychain
 | 
			
		||||
# zgenom ohmyzsh plugins/keychain
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
Отредактировать файлы настроек для агента GPG и SSH, как это описано в разделах выше.
 | 
			
		||||
@@ -114,7 +113,7 @@ Host *
 | 
			
		||||
## Инициализация
 | 
			
		||||
 | 
			
		||||
После редактирования файлов настройки запустить `zsh`, в результате чего будет
 | 
			
		||||
загружен менеджер пакетов `zinit` и необходимые плагины.
 | 
			
		||||
загружен менеджер пакетов [`zgenom`](https://github.com/jandamm/zgenom/) и необходимые плагины.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
## Обновление
 | 
			
		||||
@@ -122,11 +121,11 @@ Host *
 | 
			
		||||
Обновление менеджера пакетов:
 | 
			
		||||
 | 
			
		||||
```sh
 | 
			
		||||
zinit self-update
 | 
			
		||||
zgenom selfupdate
 | 
			
		||||
````
 | 
			
		||||
 | 
			
		||||
Обновление плагинов:
 | 
			
		||||
 | 
			
		||||
```sh
 | 
			
		||||
zinit update --parallel
 | 
			
		||||
zgenom update
 | 
			
		||||
```
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										27
									
								
								compinit.zsh
									
									
									
									
									
								
							
							
						
						
									
										27
									
								
								compinit.zsh
									
									
									
									
									
								
							@@ -1,27 +0,0 @@
 | 
			
		||||
typeset -i _compinit_updated_at=$(date +'%j' -r $ZINIT[ZCOMPDUMP_PATH] 2>/dev/null || stat -f '%Sm' -t '%j' $ZINIT[ZCOMPDUMP_PATH] 2>/dev/null)
 | 
			
		||||
if [ $(date +'%j') != $_compinit_updated_at ]; then
 | 
			
		||||
	ZINIT[COMPINIT_OPTS]="-i"
 | 
			
		||||
else
 | 
			
		||||
	ZINIT[COMPINIT_OPTS]="-C -i"
 | 
			
		||||
fi
 | 
			
		||||
unset _compinit_updated_at
 | 
			
		||||
 | 
			
		||||
zinit wait lucid for \
 | 
			
		||||
	atinit"zpcompinit; zpcdreplay" \
 | 
			
		||||
		zdharma/fast-syntax-highlighting \
 | 
			
		||||
	atload"!_zsh_autosuggest_start" \
 | 
			
		||||
		zsh-users/zsh-autosuggestions \
 | 
			
		||||
	blockf \
 | 
			
		||||
		zsh-users/zsh-completions
 | 
			
		||||
 | 
			
		||||
zmodload -i zsh/complist
 | 
			
		||||
 | 
			
		||||
zstyle ':completion:*:processes'          command 'ps -ax'
 | 
			
		||||
zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#)*=0=01;32'
 | 
			
		||||
zstyle ':completion:*:*:kill:*'           menu yes select
 | 
			
		||||
zstyle ':completion:*:kill:*'             force-list always
 | 
			
		||||
 | 
			
		||||
zstyle ':completion:*:processes-names'    command 'ps -e -o comm='
 | 
			
		||||
zstyle ':completion:*:*:killall:*'        menu yes select
 | 
			
		||||
zstyle ':completion:*:killall:*'          force-list always
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										37
									
								
								env.zsh
									
									
									
									
									
								
							
							
						
						
									
										37
									
								
								env.zsh
									
									
									
									
									
								
							@@ -1,37 +0,0 @@
 | 
			
		||||
export XDG_CONFIG_HOME=$HOME/.config
 | 
			
		||||
export XDG_CACHE_HOME=$HOME/.cache
 | 
			
		||||
export XDG_DATA_HOME=$HOME/.local/share
 | 
			
		||||
 | 
			
		||||
declare -A ZINIT
 | 
			
		||||
ZINIT[HOME_DIR]=$XDG_CACHE_HOME/zsh/zinit
 | 
			
		||||
ZINIT[PLUGINS_DIR]=$XDG_CACHE_HOME/zsh/plugins
 | 
			
		||||
ZINIT[SNIPPETS_DIR]=$XDG_CACHE_HOME/zsh/snippets
 | 
			
		||||
ZINIT[ZCOMPDUMP_PATH]=$XDG_CACHE_HOME/zsh/zcompdump
 | 
			
		||||
 | 
			
		||||
ZPFX=$XDG_CACHE_HOME/zsh/polaris
 | 
			
		||||
 | 
			
		||||
export PATH=$HOME/bin:$HOME/.local/bin:$PATH
 | 
			
		||||
# Удалить дубликаты в PATH
 | 
			
		||||
typeset -U PATH
 | 
			
		||||
 | 
			
		||||
export GNUPGHOME=$HOME/.config/gnupg
 | 
			
		||||
export SVDIR=$HOME/sv
 | 
			
		||||
 | 
			
		||||
# Настройка uncrustify
 | 
			
		||||
UNCRUSTIFY_CONFIG="${XDG_CONFIG_HOME}/uncrustify/default.cfg"
 | 
			
		||||
[ -e "${UNCRUSTIFY_CONFIG}" ] && export UNCRUSTIFY_CONFIG
 | 
			
		||||
 | 
			
		||||
# Настройка Intel Studio
 | 
			
		||||
if [ ! -z ${ENABLE_INTEL_STUDIO+x} ]; then
 | 
			
		||||
	#export COMPILERVARS_ARCHITECTURE=intel64
 | 
			
		||||
	#export COMPILERVARS_PLATFORM=linux
 | 
			
		||||
	#/opt/intel/bin/iccvars.sh
 | 
			
		||||
	INTEL_VARS=( /opt/intel/advisor/advixe-vars.sh
 | 
			
		||||
	             /opt/intel/inspector/inspxe-vars.sh
 | 
			
		||||
	             /opt/intel/vtune_profiler/vtune-vars.sh )
 | 
			
		||||
 | 
			
		||||
	for f in ${INTEL_VARS[*]}; do
 | 
			
		||||
		[ -e "$f" ] && source "$f" > /dev/null
 | 
			
		||||
	done
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										16
									
								
								options.zsh
									
									
									
									
									
								
							
							
						
						
									
										16
									
								
								options.zsh
									
									
									
									
									
								
							@@ -1,16 +0,0 @@
 | 
			
		||||
# https://github.com/wting/autojump
 | 
			
		||||
# apt-get install autojump
 | 
			
		||||
[[ -s /usr/share/autojump/autojump.sh ]] && source /usr/share/autojump/autojump.sh
 | 
			
		||||
 | 
			
		||||
autoload -Uz allopt zed zmv zcalc colors
 | 
			
		||||
colors
 | 
			
		||||
 | 
			
		||||
autoload -Uz edit-command-line
 | 
			
		||||
zle -N edit-command-line
 | 
			
		||||
#bindkey -M vicmd v edit-command-line
 | 
			
		||||
 | 
			
		||||
autoload -Uz select-word-style
 | 
			
		||||
select-word-style shell
 | 
			
		||||
 | 
			
		||||
autoload -Uz url-quote-magic
 | 
			
		||||
zle -N self-insert url-quote-magic
 | 
			
		||||
							
								
								
									
										70
									
								
								plugins.zsh
									
									
									
									
									
								
							
							
						
						
									
										70
									
								
								plugins.zsh
									
									
									
									
									
								
							@@ -1,70 +0,0 @@
 | 
			
		||||
# Менеджер плагинов zinit
 | 
			
		||||
if [ ! -d $ZINIT[HOME_DIR] ]; then
 | 
			
		||||
	git clone https://github.com/zdharma/zinit $ZINIT[HOME_DIR]
 | 
			
		||||
	zcompile $ZINIT[HOME_DIR]/zinit.zsh
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
source $ZINIT[HOME_DIR]/zinit.zsh
 | 
			
		||||
autoload -Uz _zinit
 | 
			
		||||
(( ${+_comps} )) && _comps[zinit]=_zinit
 | 
			
		||||
 | 
			
		||||
# Плагины
 | 
			
		||||
zinit load willghatch/zsh-saneopt
 | 
			
		||||
zinit load mafredri/zsh-async
 | 
			
		||||
zinit load zsh-users/zsh-history-substring-search
 | 
			
		||||
 | 
			
		||||
zinit load rupa/z
 | 
			
		||||
if [[ "$DISPLAY" != '' ]] && command -v xdotool > /dev/null 2>&1 &&  command -v wmctrl > /dev/null 2>&1; then
 | 
			
		||||
	zinit load marzocchi/zsh-notify
 | 
			
		||||
	zstyle ':notify:*' expire-time 5000
 | 
			
		||||
	zstyle ':notify:*' command-complete-timeout 20
 | 
			
		||||
	zstyle ':notify:*' enable-on-ssh yes
 | 
			
		||||
fi
 | 
			
		||||
if command -v peco > /dev/null 2>&1; then
 | 
			
		||||
	zinit load jimeh/zsh-peco-history
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
zinit snippet OMZP::command-not-found
 | 
			
		||||
zinit snippet OMZP::common-aliases
 | 
			
		||||
zinit snippet OMZP::debian
 | 
			
		||||
if command -v fzf > /dev/null 2>&1; then
 | 
			
		||||
	export DISABLE_FZF_KEY_BINDINGS=true
 | 
			
		||||
	zinit snippet OMZP::fzf
 | 
			
		||||
	# fzf
 | 
			
		||||
	if [ -e /usr/share/doc/fzf/examples/key-bindings.zsh ]; then
 | 
			
		||||
		.  /usr/share/doc/fzf/examples/key-bindings.zsh
 | 
			
		||||
	fi
 | 
			
		||||
	if [ -e /usr/share/doc/fzf/examples/completion.zsh ]; then
 | 
			
		||||
		. /usr/share/doc/fzf/examples/completion.zsh
 | 
			
		||||
	fi
 | 
			
		||||
fi
 | 
			
		||||
if command -v git > /dev/null 2>&1; then
 | 
			
		||||
	zinit snippet OMZP::git
 | 
			
		||||
	zinit load paulirish/git-open
 | 
			
		||||
	zinit lucid wait'2' for \
 | 
			
		||||
	    as"program" pick"$ZPFX/bin/git-*" \
 | 
			
		||||
	    src"etc/git-extras-completion.zsh" make"PREFIX=$ZPFX" tj/git-extras \
 | 
			
		||||
	    as"program" make"PREFIX=$ZPFX install" Fakerr/git-recall \
 | 
			
		||||
	    as"program" load davidosomething/git-my
 | 
			
		||||
fi
 | 
			
		||||
if command -v psql > /dev/null 2>&1; then
 | 
			
		||||
	zinit snippet OMZP::postgres
 | 
			
		||||
fi
 | 
			
		||||
if command -v sudo > /dev/null 2>&1; then
 | 
			
		||||
	zinit snippet OMZP::sudo
 | 
			
		||||
fi
 | 
			
		||||
if command -v systemctl > /dev/null 2>&1; then
 | 
			
		||||
	zinit snippet OMZP::systemd
 | 
			
		||||
fi
 | 
			
		||||
if command -v vim > /dev/null 2>&1; then
 | 
			
		||||
	zinit snippet OMZP::vim-interaction
 | 
			
		||||
fi
 | 
			
		||||
zinit snippet OMZP::web-search
 | 
			
		||||
 | 
			
		||||
zinit load djui/alias-tips
 | 
			
		||||
 | 
			
		||||
zstyle ':prezto:module:tmux:auto-start' local 'no'
 | 
			
		||||
zstyle ':prezto:module:tmux:auto-start' remote 'yes'
 | 
			
		||||
zstyle ':prezto:module:tmux:session' name "$(hostname)"
 | 
			
		||||
zinit snippet PZTM::tmux
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user