From d2718febf82e7fd90491e53ee5c4c40799a9592d Mon Sep 17 00:00:00 2001 From: Smaug123 Date: Fri, 23 Feb 2024 22:44:39 +0000 Subject: [PATCH] Rem oh-my-zsh --- home-manager/.zshrc | 23 +++++++++++++++++++++++ home-manager/home.nix | 6 +----- 2 files changed, 24 insertions(+), 5 deletions(-) create mode 100644 home-manager/.zshrc diff --git a/home-manager/.zshrc b/home-manager/.zshrc new file mode 100644 index 0000000..c52a59a --- /dev/null +++ b/home-manager/.zshrc @@ -0,0 +1,23 @@ +prompt_custom() { + local cyan='%F{cyan}' + local red='%F{red}' + local blue='%F{blue}' + local reset_color='%f' + + local git_info=$(git symbolic-ref --short HEAD 2> /dev/null || git describe --tags --exact-match 2> /dev/null || git rev-parse --short HEAD 2> /dev/null) + if [[ -n "$git_info" ]]; then + # escape the percent character, which is the only zsh prompt metacharacter + git_info=$git_info:s/%/%%/ + git_info=" ${blue}git:${reset_color}${red}(${git_info})${reset_color}" + else + git_info="" + fi + + # %1 is the name of cwd + PROMPT="${cyan}%1~${reset_color}${git_info} > " +} + +# Full path to cwd, with `~` for any initial home component, in light green, +RPROMPT='%F{155}%~%f' + +precmd_functions+=(prompt_custom) diff --git a/home-manager/home.nix b/home-manager/home.nix index 25dc658..b039a36 100644 --- a/home-manager/home.nix +++ b/home-manager/home.nix @@ -43,11 +43,6 @@ history = { expireDuplicatesFirst = true; }; - oh-my-zsh = { - enable = true; - plugins = ["git" "macos" "dircycle" "timer"]; - theme = "robbyrussell"; - }; sessionVariables = { EDITOR = "vim"; LC_ALL = "en_US.UTF-8"; @@ -63,6 +58,7 @@ sessionVariables = { RIPGREP_CONFIG_PATH = "/Users/${username}/.config/ripgrep/config"; }; + initExtra = builtins.readFile ./.zshrc; }; programs.fzf = {