{"id":26845003,"url":"https://github.com/codic12/nzsh","last_synced_at":"2026-03-07T20:04:50.577Z","repository":{"id":128971537,"uuid":"276699873","full_name":"codic12/nzsh","owner":"codic12","description":"Simple, minimal, and sleek ZSH prompt. Written in Nim, forked from Nicy.","archived":false,"fork":false,"pushed_at":"2020-07-04T03:57:47.000Z","size":3214,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-11T12:49:49.092Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Nim","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codic12.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-07-02T16:50:08.000Z","updated_at":"2024-09-12T13:20:03.000Z","dependencies_parsed_at":"2023-06-15T04:30:22.458Z","dependency_job_id":null,"html_url":"https://github.com/codic12/nzsh","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/codic12/nzsh","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codic12%2Fnzsh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codic12%2Fnzsh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codic12%2Fnzsh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codic12%2Fnzsh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codic12","download_url":"https://codeload.github.com/codic12/nzsh/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codic12%2Fnzsh/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30229590,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-07T19:01:10.287Z","status":"ssl_error","status_checked_at":"2026-03-07T18:59:58.103Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-03-30T19:34:09.699Z","updated_at":"2026-03-07T20:04:50.557Z","avatar_url":"https://github.com/codic12.png","language":"Nim","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e                                                              \n    \u003cimg src=\"https://i.imgur.com/IIpE5ei.png\" width=\"280\"\u003e                            \n\u003c/h1\u003e\n\n# Slick, elegant, fast, and minimal ZSH prompt in Nim.\n\n### Features\n- Written in Nim 👑\n- Fast, since Nim compiles to C\n- Sane yet pretty defaults.\n- An API for creating your own prompts, with a ton of features!\n- Fun, I guess.\n\n## Installation\n**Note**: Frameworks like Oh My Zsh may cause conflicts, *especially if you are using a theme with one of them*.\n\n```console\n$ nimble install nzsh\n```\n\nDon’t know what that is? New to Nim? Check out the Nim [docs](https://nim-lang.org/documentation.html). Just [grab a copy](https://nim-lang.org/install.html) of Nim and Nimble and just run it! Or grab a binary from the releases page.\n\n## Quick start\nAdd this to your `~/.zshrc`. If you installed via `nimble`, set `PROMPT` to `$(\"~/.nimble/bin/nzsh\")`. If you grabbed a binarym, point it to that pat.\n\n```zsh\nautoload -Uz add-zsh-hook\n_nzsh_prompt() {\n\tPROMPT=$(\"/path/to/nzsh\")\n}\nadd-zsh-hook precmd _nzsh_prompt\n```\nMake sure to disable all other themes.\n\n## Configuration\nIf you want to configure `nzsh` as it is, you’ll have to edit the `src/nzsh.nim` file and recompile. Messy, I know.\n\n### Build your own prompt\nAlternatively, you can just as easily write your own prompt in Nim using `nzsh`’s built-in API. Check out the examples/ folder for some examples.\n\nOnce you’re done, compile it and add a similar function to your `.zshrc` as above, replacing `PROMPT` with the path to your own binary.\n\n\n### API\n\n**`zeroWidth(s: string): string`**  \nReturns the given string wrapped in zsh zero-width codes. Useful for prompt alignment and cursor positioning.  \nAll procs below return strings wrapped by this.\n\n**`foreground(s, color: string): string`**  \nReturns the given string, colorized.  \nPossible colors are `\"black\"`, `\"red\"`, `\"green\"` `\"blue\"`, `\"cyan\"`, `\"yellow\"`, `\"magenta\"`, `\"white\"`.\n\n**`background(s, color: string): string`**  \nReturns the given string with its background colorized.  \nSame possible colors as above.\n\n**`bold(s: string): string`**  \nMakes the given string bold.\n\n**`underline(s: string): string`**  \nAdds an underline to the given string.\n\n**`italics(s: string): string`**  \nItalicizes the given text. **May not work on all terminals!**\n\n**`reverse(s: string): string`**  \nSwaps the foreground/background colors for the given string.\n\n**`reset(s: string): string`**  \nResets all attributes. Useful for disabling all styling.\n\n**`color(s: string, fg: string = \"\", bg: string = \"\",  b: bool = false, u: bool = false, r = false): string`**  \nConvenience proc that sets all attributes to a given string.  \n`fg`: foreground, `bg`: background, `b`: bold, `u`: underline, `r`: reverse\n\n**`horizontalRule(c: char): string`**  \nReturns a string of characters `c`, having the length of the current terminal width. Useful for positioning right-side prompts.\n\n**`tilde(path: string): string`**  \nIf `path` starts with `/home/user`, it is replaced by a `~/`.\n\n**`getCwd(): string`**  \nReturns the full path of the current working directory, or returns the string `[not found]` if current path doesn’t exist. (eg: `rm -rf ../curpath`)\n\n**`virtualenv(): string`**  \nReturns the current virtualenv name if in one.\n\n**`gitBranch(): string`**  \nReturns the current git branch, if in a git directory.\n\n**`gitStatus(dirty, clean: string): string`**  \nReturns either `dirty` or `clean` if in a git repository. For example, return `•` if clean and `×` if dirty.\n\n**`user(): string`**  \nReturns the current username.\n\n**`host(): string`**  \nReturns the current hostname.\n\n**`returnCondition*(ok: string, ng: string, delimiter = \".\"): string`**  \nReturns `ok` string or `ng` string.\nif the return code is `0` then `ok` else `ng`.\n\n**`returnCondition*(ok: proc(): string, ng: proc(): string, delimiter = \".\"): string`**  \nReturns result of `ok` proc or `ng` proc.\nif the return code is `0` then this proc calls `ok` proc else this proc calls `ng` proc.\n\n**`echoc*(s: cstring) {.importc: \"printf\", header: \"\u003cstdio.h\u003e\".}`**  \nFast, pure C alternative to `echo`. Uses `cstring`.\n\n## Contributing\nBad code? New feature in mind? Open an issue. Better still, learn [Nim](https://nim-lang.org/documentation.html) and shoot a PR :sparkles:\n\n## License\nMIT © [Anirudh Oppiliappan](https://icyphox.sh), [Codic](https://codic12.github.io)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodic12%2Fnzsh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodic12%2Fnzsh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodic12%2Fnzsh/lists"}