Skip to content

Commit

Permalink
use zsh globbing instead of subshell pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
baodrate committed Mar 16, 2023
1 parent 0ee5f6c commit e120015
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions init.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ _prompt_mnml_buffer-empty() {
if (( MNML_LAST_ERR )) print -Pn '%F{${MNML_ERR_COLOR}}${MNML_LAST_ERR} '
print -Pn '%(1j.%F{244}%j%f& .)%F{244}%n%f@%F{244}%m%f:'
print -Pn %F{244}${${(%):-%~}//\//%f\/%F{244}}
local -i a_files=$(command ls -Aq | command wc -l)
local -i v_files=$(command ls -q | command wc -l)
local -i h_files=$(( a_files - v_files ))
print -Pn " %f[%F{244}${v_files}%f"
if (( h_files )) print -Pn " (%F{244}${h_files}%f)"
local -a a_files=(*(DN))
local -a v_files=(*(N^D))
local -a h_files=(${a_files:|v_files})
print -Pn " %f[%F{244}${#v_files}%f"
if (( #h_files )) print -Pn " (%F{244}${#h_files}%f)"
print ]
# display magic enter
if (( ${#dirstack} )) print -P %F{244}${${dirstack/${HOME}/\~}//\//%f\/%F{244}}%f
Expand Down

0 comments on commit e120015

Please sign in to comment.