diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..e4b56e4 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,16 @@ +root = true + +[*] +charset = utf-8 +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true + +[[shell]] +indent_style = tab +indent_size = 4 +shell_variant = bash +switch_case_indent = true +space_redirects = true +keep_padding = true +function_next_line = true diff --git a/.zshrc b/.zshrc index dfd820c..b02c7a9 100644 --- a/.zshrc +++ b/.zshrc @@ -15,7 +15,6 @@ stages=( 45-plugins 55-agents 62-scripts - 65-vpy 68-aliases 72-widgets 78-keybindings @@ -35,7 +34,7 @@ for S in "${stages[@]}"; do done done -unset stages S N F +unset stages S mkdir -p "$ZDOTDIR/apps.d" find "$ZDOTDIR/apps.d" -name "*.zsh" -print0 | sort -z | while IFS= read -r -d $'\0' app; do source "$app"; done diff --git a/15-options.zsh b/15-options.zsh index 5afa31b..16c0dad 100644 --- a/15-options.zsh +++ b/15-options.zsh @@ -27,4 +27,3 @@ fi # Подсветка вывода основных команд if [[ -r /etc/grc.zsh ]]; then source /etc/grc.zsh; fi - diff --git a/25-history.zsh b/25-history.zsh index d68d352..4d30a86 100644 --- a/25-history.zsh +++ b/25-history.zsh @@ -21,4 +21,3 @@ setopt HIST_SAVE_NO_DUPS # Don't write duplicate entries in the history setopt HIST_REDUCE_BLANKS # Remove superfluous blanks before recording entry. setopt HIST_VERIFY # Don't execute immediately upon history expansion. setopt HIST_BEEP # Beep when accessing nonexistent history. - diff --git a/45-plugins.zsh b/45-plugins.zsh index 34b6362..6568576 100644 --- a/45-plugins.zsh +++ b/45-plugins.zsh @@ -51,12 +51,12 @@ fi if command -v fzf > /dev/null 2>&1; then FZF_DEFAULT_OPTS='--height 60% --layout=reverse --border' - if command -v fdfind >/dev/null 2>&1; then + if command -v fdfind > /dev/null 2>&1; then FZF_DEFAULT_COMMAND="fdfind --type f" FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND" FZF_ALT_C_COMMAND="fdfind --type d" fi - FZF_VERSION="$(fzf --version | sed -r 's/([0-9]+\.[0-9]+).*/\1/' )" + 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" @@ -100,4 +100,3 @@ fi if command -v kitty > /dev/null 2>&1; then zinit light redxtech/zsh-kitty fi - diff --git a/78-keybindings.zsh b/78-keybindings.zsh index 33451b4..712bbff 100644 --- a/78-keybindings.zsh +++ b/78-keybindings.zsh @@ -3,4 +3,3 @@ # [Esc] [Esc] bindkey '\e\e' send-break - diff --git a/95-finish.zsh b/95-finish.zsh index 407975d..3723b0d 100644 --- a/95-finish.zsh +++ b/95-finish.zsh @@ -1,3 +1,2 @@ # shellcheck shell=bash # vim: ft=sh - diff --git a/apps.d/bat.zsh b/apps.d/bat.zsh index a9d2686..c4142a9 100644 --- a/apps.d/bat.zsh +++ b/apps.d/bat.zsh @@ -1,8 +1,7 @@ # shellcheck shell=bash # vim: ft=sh -if command -v bat >/dev/null; then - export PAGER=bat - export MANPAGER="sh -c 'col -bx | bat -l man -p'" -fi +! command -v bat > /dev/null && return +export PAGER=bat +export MANPAGER="sh -c 'col -bx | bat -l man -p'" diff --git a/apps.d/eget.zsh b/apps.d/eget.zsh index bd010cc..8e3dc00 100644 --- a/apps.d/eget.zsh +++ b/apps.d/eget.zsh @@ -1,11 +1,12 @@ # shellcheck shell=bash # vim: ft=sh -if command -v eget >/dev/null; then +! command -v dotdrop > /dev/null && return +if command -v eget > /dev/null; then EGET_CONFIG="$XDG_CONFIG_HOME/eget/eget.toml" [ -r "$XDG_CONFIG_HOME/eget/eget.toml" ] && export EGET_CONFIG [[ -z ${EGET_TARGET_DIR+set} ]] && EGET_TARGET_DIR="${XDG_CACHE_HOME}/eget" export EGET_TARGET_DIR - mkdir -p "${EGET_TARGET_DIR}" >/dev/null + mkdir -p "${EGET_TARGET_DIR}" > /dev/null export PATH="${EGET_TARGET_DIR}:${PATH}" fi diff --git a/apps.d/oneapi.zsh b/apps.d/oneapi.zsh index 16a36b2..704a7a6 100644 --- a/apps.d/oneapi.zsh +++ b/apps.d/oneapi.zsh @@ -4,12 +4,11 @@ if [[ -n ${ENABLE_INTEL_STUDIO+set} ]]; then #export COMPILERVARS_ARCHITECTURE=intel64 #export COMPILERVARS_PLATFORM=linux - INTEL_VARS=( /opt/intel/oneapi/advisor/latest/advixe-vars.sh - /opt/intel/oneapi/compiler/latest/env/vars.sh - /opt/intel/oneapi/vtune/latest/vtune-vars.sh ) + INTEL_VARS=(/opt/intel/oneapi/advisor/latest/advixe-vars.sh + /opt/intel/oneapi/compiler/latest/env/vars.sh + /opt/intel/oneapi/vtune/latest/vtune-vars.sh) for f in "${INTEL_VARS[@]}"; do - if [ -r "$f" ]; then source "$f" >/dev/null; fi + if [ -r "$f" ]; then source "$f" > /dev/null; fi done fi - diff --git a/apps.d/uncrustify.zsh b/apps.d/uncrustify.zsh index 7ec83e5..e71e355 100644 --- a/apps.d/uncrustify.zsh +++ b/apps.d/uncrustify.zsh @@ -1,8 +1,7 @@ # shellcheck shell=bash # vim: ft=sh -if command -v uncrustify >/dev/null; then - UNCRUSTIFY_CONFIG="${XDG_CONFIG_HOME}/uncrustify/uncrustify.cfg" - [ -r "${UNCRUSTIFY_CONFIG}" ] && export UNCRUSTIFY_CONFIG -fi +! command -v uncrustify > /dev/null && return +UNCRUSTIFY_CONFIG="${XDG_CONFIG_HOME}/uncrustify/uncrustify.cfg" +[ -r "${UNCRUSTIFY_CONFIG}" ] && export UNCRUSTIFY_CONFIG diff --git a/fixes.zsh b/fixes.zsh index f8b1c25..1075d6e 100644 --- a/fixes.zsh +++ b/fixes.zsh @@ -2,7 +2,8 @@ # Установка файла описания терминала kitty на системы, # где отсутствует пакет kitty-terminfo -fix-kitty-terminal-support() { +fix-kitty-terminal-support() +{ mkdir -p $HOME/.terminfo/x curl -fsSL https://github.com/kovidgoyal/kitty/raw/master/terminfo/x/xterm-kitty > $HOME/.terminfo/x/xterm-kitty } @@ -11,12 +12,13 @@ fix-kitty-terminal-support() { # Необходимо закрыть все экземпляры mc для текущего пользователя # При вызове функции с параметром -f текущие настройки клавиш # для работы mc в терминале kitty будут перезаписаны -fix-mc-kitty-support() { +fix-mc-kitty-support() +{ local cfg="${HOME}/.config/mc/ini" [[ "$1" == "-f" ]] && sed -i '/\[terminal:xterm-kitty\]/,/^$/{d}' "${cfg}" if [ -w "${cfg}" ]; then - if ! grep -qF "[terminal:xterm-kitty]" "${cfg}" ; then + if ! grep -qF "[terminal:xterm-kitty]" "${cfg}"; then echo >> "${cfg}" echo "[terminal:xterm-kitty]" >> "${cfg}" echo "copy=xterm" >> "${cfg}" @@ -25,8 +27,8 @@ fix-mc-kitty-support() { } # Новые версии плагинов для поиска используют функционал fzf версии 0.54.1. -fix-update-fzf() { +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 } -