ZSH Terminal "DIY prompt", uses https://github.com/icyphox/nicy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import strformat, times, os, osproc, nicypkg/functions | |
export functions | |
when isMainModule: | |
let | |
prompt = returnCondition(ok = "👍", ng = "👎") & " " | |
nl = "\n" | |
gitBranch = color(gitBranch(), "yellow") | |
cwd = color(tilde(getCwd()), "cyan") | |
dirty = color("×", "red") | |
clean = color("•", "green") | |
git = gitBranch & gitStatus(dirty, clean) | |
ni = execCmdEx("nim --version").output[21 .. 25] | |
py = execCmdEx("python --version").output[7 .. ^4] | |
echo fmt"{user()}@x {virtualenv()}{cwd} {getClockStr()[0..^4]} Py{py} Nim{ni} {git}{nl}{prompt}" |
Author
juancarlospaco
commented
Oct 30, 2019
•
- https://github.com/icyphox/nicy#quick-start
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment