zinit icon indicating copy to clipboard operation
zinit copied to clipboard

[maint]: improve readability of Zinit source code

Open vladdoster opened this issue 2 years ago • 3 comments

Summary

Inconsistent line length & wrapping, making it hard to read, grok, and edit Zinit.

Examples:

  1. zinit-install.zsh#L4
  2. zinit-install.zsh#L995
  3. zinit-install.zsh#L1848

Proposed fix

Add the following Vim Modeline to all Zinit source code:

vim: ft=zsh et ts=2 sw=2

vladdoster avatar Apr 29 '22 07:04 vladdoster

Given the overall line length, I'd consider ts=2 sw=2

pschmitt avatar Apr 29 '22 11:04 pschmitt

@pschmitt agreed.

Ive attempted formatting bits here and there, but is really tedious. Additionally, we need to find a way to enforce Zsh formatting. Do you know of any formatting tools for Zsh? To seriously consider shfmt would require changing all the conditional blocks to the more traditional bash syntax.

Edit: updated vim mode-line from 4 -> 2

vladdoster avatar Apr 30 '22 10:04 vladdoster

Progress

PR File
#318 share/git-process-output.zsh
#319 share/rpm2cpio.zsh
#325 share/single-line.zsh
_zinit
zinit-additional.zsh
zinit-autoload.zsh
zinit-install.zshsh
zinit.zsh

vladdoster avatar Jul 01 '22 09:07 vladdoster