diff options
| author | Christoph Schlosser <christoph@linux.com> | 2025-06-17 22:42:10 +0200 |
|---|---|---|
| committer | Christoph Schlosser <christoph@linux.com> | 2025-06-17 22:42:10 +0200 |
| commit | 2202078d321f4c80d7ef5e5c12692674e299ed38 (patch) | |
| tree | d6ccc55524880a6e9f8125a17f4f86c058cc21d0 /conf.d | |
| parent | d84113b411575d24c4a1c9da0485eaeb63f25725 (diff) | |
| download | c-star-2202078d321f4c80d7ef5e5c12692674e299ed38.tar.gz | |
Initial minimalistic version
Diffstat (limited to 'conf.d')
| -rw-r--r-- | conf.d/c_star.fish | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/conf.d/c_star.fish b/conf.d/c_star.fish new file mode 100644 index 0000000..1bcedb1 --- /dev/null +++ b/conf.d/c_star.fish @@ -0,0 +1,33 @@ +set -q c_star_prompt_symbol || set -g c_star_prompt_symbol ">" +set -q c_star_date_format || set -g c_star_date_format "%Y-%m-%dT%H:%M:%S%z" + +function c_star_datetime --on-event fish_prompt --on-event fish_postexec --on-variable c_star_date_format + set -g c_star_datetime (date "+$c_star_date_format") +end + +function c_star_git --on-variable PWD + set -g c_star_git "$(fish_git_prompt)" +end + +function c_star_user --on-event fish_prompt + set -g c_star_user "$(whoami)" +end + +function c_star_host --on-event fish_prompt + if test -n "$SSH_CONNECTION" + set -g c_star_host "@$(hostname)" + end +end + +function c_star_user_marker --on-event fish_prompt + switch (whoami) + case "root" + set -g c_star_user_marker "$(set_color red)#$(set_color normal)" + case '*' + set -g c_star_user_marker "\$" + end +end + +function c_star_pwd --on-variable PWD --on-event fish_prompt + set -g c_star_pwd "$(prompt_pwd)" +end
\ No newline at end of file |