Skip to content
/ puck Public

puck is a opinionated and minimal zsh prompt with git support

License

Notifications You must be signed in to change notification settings

p1xelHer0/puck

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🐢 puck

puck is a zsh prompt

Work in progress 🧐

It'll look something like this:

~/Dev/Repo/Private/puck :git branch info here:
λ Typing commands goes here!

Q: Why would you do this in OCaml instead of just using zsh or oh-my-zsh?

A: Because I can?

A: OCaml is fun and building a simple program that outputs a string is good for learning more OCaml! I was inspired by gbt.

Project setup

Project setup inspired by spin and modern-ocaml. Thanks to tmattio and Khady 🥳

Installation

Right now the only way to use puck is to build from source:

  • puck uses esy to install and manage dependencies

  • esy is installed using npm or yarn

npm i -g esy
git clone https://github.com/p1xelHer0/puck.git
cd puck
esy

This will install the OCaml compiler and required dependencies, it might take some minutes. After the initial installation this will be much faster. esy uses dune behind the scenes, the de facto build system for OCaml.

Build the puck executable and source the puck.zsh file to enable the prompt. See Build for more information.

esy build

# read the contents of ./puck.zsh

# in your .zshrc
source /path/to/puck/puck.zsh

Note: if you don't want to use esy for some reason then you can use dune itself. If you have this opinion you problably know how to do it yourself 😘. I'm might look into getting this working with both dune and esy in the future with proper documentation.

This project is built with and tested using esy with these versions:

  • macOS Mojave Version 10.14.6
  • esy@0.6.4 installed with yarn@1.22.4
  • zsh 5.3 (x86_64-apple-darwin18.0)

Build, test, formatting and more with puck

Build

esy build

This will build puck with the name main.exe, the puck executable will be put in the ./_build/ folder. The complete path is:

./_build/default/bin/main.exe

Testing

esy test

This will run all unit tests. puck uses alcotest for testing.

All unit tests can be found in the ./test folder. The test runner executable is found under ./test/support/test_runner.ml, test suits should be added there.

Formatting

esy format

This will format all ml and mli files in the repository. puck uses ocamlformat for formatting. The formatted changes will be shown in the output.

About

puck is a opinionated and minimal zsh prompt with git support

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published