diff options
| author | Skladnayazebra <skladnayazebra@gmail.com> | 2025-10-16 15:25:29 +0200 |
|---|---|---|
| committer | Skladnayazebra <skladnayazebra@gmail.com> | 2025-10-16 15:30:41 +0200 |
| commit | 6c4932fcb70fb7647f71d4dffe23cc0a1238f916 (patch) | |
| tree | 26d613fc69488251033ec2293fbdfaad3e4edaeb | |
| parent | bf7f20d9eafbbb428cb37c74b654a0fe67a48264 (diff) | |
cleanup utils; remove git tag from prompt; add git tag alias; move all zsh config to .config/zsh
| -rw-r--r-- | .gitignore | 4 | ||||
| -rw-r--r-- | zsh/index.zsh | 28 | ||||
| -rw-r--r-- | zsh/prompt.zsh | 14 | ||||
| -rw-r--r-- | zsh/utils.zsh | 80 |
4 files changed, 34 insertions, 92 deletions
@@ -1,5 +1,7 @@ /* +!.gitignore !nvim !zsh !tmux -!.gitignore +!Code - OSS/User/settings.json + diff --git a/zsh/index.zsh b/zsh/index.zsh new file mode 100644 index 0000000..bf47ad4 --- /dev/null +++ b/zsh/index.zsh @@ -0,0 +1,28 @@ +# Lines configured by zsh-newuser-install +HISTFILE=~/.histfile +HISTSIZE=1000 +SAVEHIST=1000 +bindkey -e +bindkey -r "^F" +# End of lines configured by zsh-newuser-install +# +# The following lines were added by compinstall +zstyle :compinstall filename '/home/aleksei/.zshrc' +autoload -Uz compinit +compinit +zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}' +zstyle ':completion:*' menu select + +source ~/.config/zsh/prompt.zsh +source ~/.config/zsh/keybinds.zsh +source ~/.config/zsh/utils.zsh + +source /usr/share/nvm/init-nvm.sh +source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh + +alias n='nvim' +alias tg='git describe --tags HEAD' + +eval $(ssh-agent -s) >> /dev/null +# Set up fzf key bindings and fuzzy completion +source <(fzf --zsh) diff --git a/zsh/prompt.zsh b/zsh/prompt.zsh index 774f5f0..e041644 100644 --- a/zsh/prompt.zsh +++ b/zsh/prompt.zsh @@ -13,8 +13,8 @@ GIT_INFO="" zstyle ':vcs_info:git*' formats " %b %c%u%m%a" zstyle ':vcs_info:*' enable git zstyle ':vcs_info:*' check-for-changes true -zstyle ':vcs_info:*' stagedstr ' %K{green} ✚ %k' -zstyle ':vcs_info:*' unstagedstr ' %K{red} ● %k' +zstyle ':vcs_info:*' stagedstr '%K{green} ✚ %k' +zstyle ':vcs_info:*' unstagedstr '%K{red} ● %k' PS_GIT_TAGS="" PS_NODE="" @@ -41,13 +41,5 @@ precmd() { vcs_info PS_NODE="$(get_pkg_manager)" - git_tag=$(git describe --tags HEAD 2>/dev/null) - - if [[ $git_tag ]]; then - PS_GIT_TAGS="%K{black} $git_tag %k" - else - PS_GIT_TAGS="" - fi - - PROMPT="%B$PS_ERR$PS_DIR$PS_GIT$PS_GIT_TAGS$PS_NODE %# %b" + PROMPT="%B$PS_ERR$PS_DIR$PS_GIT$PS_NODE %# %b" } diff --git a/zsh/utils.zsh b/zsh/utils.zsh index 111a2fb..9075ce0 100644 --- a/zsh/utils.zsh +++ b/zsh/utils.zsh @@ -39,22 +39,6 @@ lsproj() { done } -lsproj2() { - ls | while read line; - do { - fill_count=$((32 - ${#line})) - filler=$(repeat $fill_count printf "·") - is_git_repo=$(git -C $line rev-parse --abbrev-ref HEAD 2> /dev/null) - if [[ $is_git_repo ]] { - project_dir="%B%F{white}%K{green} $line %k%f%b" - branch=" %F{blue} $(git -C $line rev-parse --abbrev-ref HEAD)%f" - # tag=$(git -C $line describe --tags HEAD 2> /dev/null) - print -P "|$project_dir\n|$branch\n|" - } - } - done -} - lsproj_watch() { while true; do { @@ -66,67 +50,3 @@ lsproj_watch() { done; } -# TEMP - -chkt() { - ls | while read line; - do { - fill_count=$((32 - ${#line})) - filler=$(for i in {1..$fill_count}; do printf "·"; done) - is_git_repo=$(git -C $line rev-parse --abbrev-ref HEAD 2> /dev/null) - if [[ $is_git_repo ]] { - print "%B%F{white}%K{green} $line %k%f%b" - git -C $line branch - } - } - done -} - -fore() { - while read proj; - do { - echo $proj - git -C $proj branch -d feature/update-arf-toolkit 2> /dev/null && echo "OK" - } - done -} - - -multiupd() { - echo $1 - start_path=$(pwd) - while read proj; - do { - cd $start_path/$proj - print -P "%K{green}%F{white}%B update to $1 in $start_path/$proj %b%f%k" - - if [[ -f yarn.lock ]]; then - yarn add $1 -E -W 2> >(grep -v warning 1>&2) - git add yarn.lock - elif [[ -f pnpm-lock.yaml ]]; then - pnpm i $1 -E - git add pnpm-lock.yaml - elif [[ -f package-lock.json ]]; then - npm i $1 -E - git add package-lock.json - fi - git add package.json - } - done - - cd $start_path -} - -createbr() { - start_path=$(pwd) - while read proj; - do { - cd $start_path/$proj - print -P "%K{green}%F{white}%B $start_path/$proj %b%f%k" - git co -b feature/update-arf-toolkit - git ci -m "@arf/toolkit 0.16.5" - git push - bb 2> /dev/null || echo "PR is not open: $proj" - } - done -} |
