From 28a673a4673b627ca5932a96ee0ddc67f9abd156 Mon Sep 17 00:00:00 2001 From: Alexander Kiryukhin Date: Wed, 13 Jul 2022 17:01:06 +0300 Subject: Актуальные dotfile MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- zsh/zshrc | 170 +++++++++++++++++++++++++++++++++++++++----------------------- 1 file changed, 106 insertions(+), 64 deletions(-) (limited to 'zsh/zshrc') diff --git a/zsh/zshrc b/zsh/zshrc index 6a516da..baa164f 100644 --- a/zsh/zshrc +++ b/zsh/zshrc @@ -1,66 +1,108 @@ -export PATH=$HOME/.bin:/usr/local/bin:$HOME/go/bin:$PATH -# Path to your oh-my-zsh installation. -export ZSH="$HOME/.oh-my-zsh" -export EDITOR="/usr/local/bin/micro" - -ZSH_THEME="robbyrussell" - -# Uncomment the following line to use case-sensitive completion. -# CASE_SENSITIVE="true" -# HYPHEN_INSENSITIVE="true" - -# Uncomment one of the following lines to change the auto-update behavior -# zstyle ':omz:update' mode disabled # disable automatic updates -# zstyle ':omz:update' mode auto # update automatically without asking -# zstyle ':omz:update' mode reminder # just remind me to update when it's time - -# Uncomment the following line to change how often to auto-update (in days). -# zstyle ':omz:update' frequency 13 - -COMPLETION_WAITING_DOTS="true" - -DISABLE_UNTRACKED_FILES_DIRTY="true" -# HIST_STAMPS="mm/dd/yyyy" - -ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE="fg=yellow,underline" - -plugins=(git zsh-autosuggestions fzf golang) - -source $ZSH/oh-my-zsh.sh - -# export LANG=en_US.UTF-8 - -# Preferred editor for local and remote sessions - if [[ -n $SSH_CONNECTION ]]; then - export EDITOR='vim' - else - export EDITOR='a' - fi - -# export ARCHFLAGS="-arch x86_64" - -[ -f ~/.zshrc.local ] && source ~/.zshrc.local -[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh - -### Added by Zinit's installer -if [[ ! -f $HOME/.local/share/zinit/zinit.git/zinit.zsh ]]; then - print -P "%F{33} %F{220}Installing %F{33}ZDHARMA-CONTINUUM%F{220} Initiative Plugin Manager (%F{33}zdharma-continuum/zinit%F{220})…%f" - command mkdir -p "$HOME/.local/share/zinit" && command chmod g-rwX "$HOME/.local/share/zinit" - command git clone https://github.com/zdharma-continuum/zinit "$HOME/.local/share/zinit/zinit.git" && \ - print -P "%F{33} %F{34}Installation successful.%f%b" || \ - print -P "%F{160} The clone has failed.%f%b" +# 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 "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then + source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" fi -source "$HOME/.local/share/zinit/zinit.git/zinit.zsh" -autoload -Uz _zinit -(( ${+_comps} )) && _comps[zinit]=_zinit - -# Load a few important annexes, without Turbo -# (this is currently required for annexes) -zinit light-mode for \ - zdharma-continuum/zinit-annex-as-monitor \ - zdharma-continuum/zinit-annex-bin-gem-node \ - zdharma-continuum/zinit-annex-patch-dl \ - zdharma-continuum/zinit-annex-rust - -### End of Zinit's installer chunk +# Exports +export PATH=$HOME/.bin:/usr/local/bin:$HOME/go/bin:$PATH +export EDITOR="nvim" + +# Aliases +[[ ! -f `which exa` ]] || alias ls="exa" +alias ll="ls -la" +alias cp="cp -i" # Confirm before overwriting something +alias df='df -h' # Human-readable sizes +alias free='free -m' # Show sizes in MB +alias gitu='git add . && git commit && git push' + +## Options section +setopt correct # Auto correct mistakes +setopt extendedglob # Extended globbing. Allows using regular expressions with * +setopt nocaseglob # Case insensitive globbing +setopt rcexpandparam # Array expension with parameters +setopt nocheckjobs # Don't warn about running processes when exiting +setopt numericglobsort # Sort filenames numerically when it makes sense +setopt nobeep # No beep +setopt appendhistory # Immediately append history instead of overwriting +setopt histignorealldups # If a new command is a duplicate, remove the older one +setopt autocd # if only directory path is entered, cd there. +setopt inc_append_history # save commands are added to the history immediately, otherwise only when shell exits. +setopt histignorespace # Don't save commands that start with space + +zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' # Case insensitive tab completion +zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}" # Colored completion (different colors for dirs/files/etc) +zstyle ':completion:*' rehash true # automatically find new executables in path +# Speed up completions +zstyle ':completion:*' accept-exact '*(N)' +zstyle ':completion:*' use-cache on +zstyle ':completion:*' cache-path ~/.zsh/cache +HISTFILE=~/.zsh_history +HISTSIZE=10000 +SAVEHIST=10000 +#export EDITOR=/usr/bin/nano +#export VISUAL=/usr/bin/nano +WORDCHARS=${WORDCHARS//\/[&.;]} # Don't consider certain characters part of the word + +autoload -U compinit colors zcalc +compinit -d +colors + +# Color man pages +export LESS_TERMCAP_mb=$'\E[01;32m' +export LESS_TERMCAP_md=$'\E[01;32m' +export LESS_TERMCAP_me=$'\E[0m' +export LESS_TERMCAP_se=$'\E[0m' +export LESS_TERMCAP_so=$'\E[01;47;34m' +export LESS_TERMCAP_ue=$'\E[0m' +export LESS_TERMCAP_us=$'\E[01;36m' +export LESS=-R + + +## Plugins section: Enable fish style features +# Use syntax highlighting +#source ${HOME}/.zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh +# Use history substring search +#source ${HOME}/.zsh/plugins/zsh-history-substring-search/zsh-history-substring-search.zsh +# bind UP and DOWN arrow keys to history substring search +zmodload zsh/terminfo +bindkey "$terminfo[kcuu1]" history-substring-search-up +bindkey "$terminfo[kcud1]" history-substring-search-down +bindkey '^[[A' history-substring-search-up +bindkey '^[[B' history-substring-search-down + +bindkey -e +bindkey '^[[7~' beginning-of-line # Home key +bindkey '^[[H' beginning-of-line # Home key +if [[ "${terminfo[khome]}" != "" ]]; then + bindkey "${terminfo[khome]}" beginning-of-line # [Home] - Go to beginning of line +fi +bindkey '^[[8~' end-of-line # End key +bindkey '^[[F' end-of-line # End key +if [[ "${terminfo[kend]}" != "" ]]; then + bindkey "${terminfo[kend]}" end-of-line # [End] - Go to end of line +fi +bindkey '^[[2~' overwrite-mode # Insert key +bindkey '^[[3~' delete-char # Delete key +bindkey '^[[C' forward-char # Right key +bindkey '^[[D' backward-char # Left key +bindkey '^[[5~' history-beginning-search-backward # Page up key +bindkey '^[[6~' history-beginning-search-forward # Page down key + +# Navigate words with ctrl+arrow keys +bindkey '^[Oc' forward-word # +bindkey '^[Od' backward-word # +bindkey '^[[1;5D' backward-word # +bindkey '^[[1;5C' forward-word # +bindkey '^H' backward-kill-word # delete previous word with ctrl+backspace +bindkey '^[[Z' undo # Shift+tab undo last action + + +source ~/.config/zsh/p10k.zsh +source ~/.config/zsh/p10k/powerlevel10k.zsh-theme +source ~/.config/zsh/antigen.zsh + +antigen bundle zsh-users/zsh-syntax-highlighting +antigen bundle zsh-users/zsh-history-substring-search +antigen apply -- cgit v1.2.3