Last active
April 7, 2021 16:10
-
-
Save juancarlospaco/a641fb8a71e81c11ab567672ecc307ff to your computer and use it in GitHub Desktop.
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