promptoglyph is a set of tools for shell prompts. It currently has two parts:
-
promptoglyph-path
, which prints a fish-like shortening of your current directory. -
promptoglyph-vcs
, which uses glyphs to give you a quick overview of your Git repository status. Unlike existing solutions such as the vcs_info plugin for Zsh or oh-my-git,promptoglyph-vcs
stops running after a user-specified amount of time so that fetching the status of your repo doesn't make your prompt laggy.
Together, you can use them to build a prompt like this:
More to follow.
It was originally called promptd
because it is a prompt that gives the
current directory and is written in D.
But someone made the valid point that the name implies a daemon,
so I went with promptoglyph.
Cheesy, but according to a cursory Google search, unique.
Linux builds can be found at the releases page. They haven't been tested extensively across many distros, but Probably Work™ since they only depend on vanilla C libraries (pthread, libm, librt, libc).
Alternatively, building form source is simple.
Grab a D compiler and run make release
.
That's all.
There are no dependencies.
promptoglyph will be added as a Dub package soon-ish.
Just invoke the programs with the desired options (see their --help
info)
in your prompt expression.
In Zsh (for the prompt shown in the demo):
setopt PROMPT_SUBST
setopt PROMPT_PERCENT
PROMPT='%B$(promptoglyph-path) $(promptoglyph-vcs --zsh) %%%b '
In Bash,
PS1="\$(promptoglyph-path) \$(promptoglyph-vcs --bash) % "
I was using Zsh with oh-my-zsh, but it seemed to be really slow in some cases and someone on Reddit raised some concerns about it. I could try the fork, but I figured it wouldn't hurt to slim down my Zsh config to things I actually use. After doing that, all that remained was the need for a decent prompt. I'm allergic to writing a shell script more than five lines long, and some of my goals (like hard time limits) seemed easier in a "real" programming language instead of a Zsh script. So, I started this project.
-
Support for additional VCSes, starting with SVN and Mercurial
-
Additional Git info (such as the name of a branch being merged)
-
Colorized path output
zlib (Use it for whatever but don't claim you wrote it.)
See LICENSE.md