geometry-zsh / geometry

geometry is a minimal, fully customizable and composable zsh prompt theme
ISC License
921 stars 94 forks source link

Mnml rebase - function oriented prompt #229

Closed jedahan closed 5 years ago

jedahan commented 5 years ago

Inspired by #226 and https://github.com/subnixr/minimal

This is a first draft rewrite on top of mnml, and I'd love some testing, writing functions, general feedback and feel.

the good

the bad

the ugly

jedahan commented 5 years ago

before

--------------------------------------------------------------------------------
 Language             Files        Lines        Blank      Comment         Code
--------------------------------------------------------------------------------
 Z Shell                 20         1375          253          244          878
 Markdown                17          913          308            0          605
 Bourne Shell             1          117           20            9           88
--------------------------------------------------------------------------------
 Total                   38         2405          581          253         1571
--------------------------------------------------------------------------------

after

--------------------------------------------------------------------------------
 Language             Files        Lines        Blank      Comment         Code
--------------------------------------------------------------------------------
 Z Shell                 19         1221          218          241          762
 Markdown                 6          626          211            0          415
 Bourne Shell             1          117           20            9           88
--------------------------------------------------------------------------------
 Total                   26         1964          449          250         1265
--------------------------------------------------------------------------------
jedahan commented 5 years ago

3 is active in this fork

Now that its easier to modify the left and right prompt, it would be nice to port #216 to be generic in geometry.zsh, looking at $PROMPT as a whole, not just the path plugin which was kinda hard-coded before.

jedahan commented 5 years ago

3 no longer applies, yay!

jedahan commented 5 years ago

Okay @desyncr @justmendes I feel like this PR is in good shape for testing :)

jedahan commented 5 years ago

Went from 676 lines of zsh to 477 Went from 512 lines of markdown to 283

▲ loc --exclude lib/zsh-async                                   geometry master 9d ⬢  ⚙
--------------------------------------------------------------------------------
 Language             Files        Lines        Blank      Comment         Code
--------------------------------------------------------------------------------
 Z Shell                 19          967          188          103          676
 Markdown                16          766          254            0          512
--------------------------------------------------------------------------------
 Total                   35         1733          442          103         1188
--------------------------------------------------------------------------------
▲ gco mnml                                                      geometry master 9d ⬢  ⚙
Switched to branch 'mnml'
Your branch is up to date with 'origin/mnml'.
▲ loc --exclude lib/zsh-async                                     geometry mnml 3m ⬢  ⚙
--------------------------------------------------------------------------------
 Language             Files        Lines        Blank      Comment         Code
--------------------------------------------------------------------------------
 Z Shell                 18          686          137           72          477
 Markdown                 4          431          148            0          283
--------------------------------------------------------------------------------
 Total                   22         1117          285           72          760
--------------------------------------------------------------------------------
▲                                                                 geometry mnml 3m ⬢  ⚙
jedahan commented 5 years ago
 ▲ loc --exclude lib/zsh-async                         code/geometry/geometry mnml 2m ⬢
--------------------------------------------------------------------------------
 Language             Files        Lines        Blank      Comment         Code
--------------------------------------------------------------------------------
 Z Shell                 18          627          136           66          425
 Markdown                 4          430          149            0          281
--------------------------------------------------------------------------------
 Total                   22         1057          285           66          706
--------------------------------------------------------------------------------
jedahan commented 5 years ago

Less than half the lines of code!

▲ loc --exclude lib/zsh-async                       code/geometry/geometry mnml 24s ⬢  ⚙
--------------------------------------------------------------------------------
 Language             Files        Lines        Blank      Comment         Code
--------------------------------------------------------------------------------
 Z Shell                 16          508          127           50          331
 Markdown                 4          430          149            0          281
--------------------------------------------------------------------------------
 Total                   20          938          276           50          612
frm commented 5 years ago

👏 let me know when you think this is stable enough for a lengthy review.

jedahan commented 5 years ago

I think this is in a stable enough state - most of my recent changes are cosmetic / can be made in future PRs.

I have only tested on alacritty, running tmux, on macOS 10.13. The least tested functions are hg, kube, virtualenv and ruby

jedahan commented 5 years ago

I rebased all the commits to make this easier to review in #233