host theme directly (thanks, MIT license)
This commit is contained in:
parent
65ce9b90d7
commit
413de3d11b
2 changed files with 60 additions and 10 deletions
12
nix/home.nix
12
nix/home.nix
|
|
@ -3,13 +3,6 @@
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
let
|
let
|
||||||
typewritten-theme = pkgs.fetchFromGitHub {
|
|
||||||
owner = "reobin";
|
|
||||||
repo = "typewritten";
|
|
||||||
rev = "0eebac711e98ee759942ed82f8c20e92912e2cc7";
|
|
||||||
sha256 = "0ncc1zjimapw9p64lnk91828ik4y5gxcn0awjcw0l8fzv6vi0ax5";
|
|
||||||
};
|
|
||||||
|
|
||||||
git-plan = pkgs.rustPlatform.buildRustPackage rec {
|
git-plan = pkgs.rustPlatform.buildRustPackage rec {
|
||||||
name = "git-plan";
|
name = "git-plan";
|
||||||
version = "1";
|
version = "1";
|
||||||
|
|
@ -130,7 +123,6 @@ in {
|
||||||
"vi-mode"
|
"vi-mode"
|
||||||
"git"
|
"git"
|
||||||
"z"
|
"z"
|
||||||
"tmuxinator"
|
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
@ -332,7 +324,7 @@ in {
|
||||||
source = ./tmux/tmux.conf;
|
source = ./tmux/tmux.conf;
|
||||||
};
|
};
|
||||||
|
|
||||||
home.file.".oh-my-zsh/custom/themes" = {
|
home.file.".oh-my-zsh/custom/themes/typewritten.zsh-theme" = {
|
||||||
source = typewritten-theme;
|
source = ./zsh/typewritten.zsh-theme;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
58
nix/zsh/typewritten.zsh-theme
Normal file
58
nix/zsh/typewritten.zsh-theme
Normal file
|
|
@ -0,0 +1,58 @@
|
||||||
|
# ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____
|
||||||
|
# ||t |||y |||p |||e |||w |||r |||i |||t |||t |||e |||n ||
|
||||||
|
# ||__|||__|||__|||__|||__|||__|||__|||__|||__|||__|||__||
|
||||||
|
# |/__\|/__\|/__\|/__\|/__\|/__\|/__\|/__\|/__\|/__\|/__\|
|
||||||
|
#
|
||||||
|
# A minimal, informative zsh prompt theme
|
||||||
|
#
|
||||||
|
# Adapted from https://github.com/reobin/typewritten/commit/0eebac711e98ee759942ed82f8c20e92912e2cc7
|
||||||
|
|
||||||
|
# git status variables
|
||||||
|
ZSH_THEME_GIT_PROMPT_PREFIX=" %{$reset_color%}%{$fg[magenta]%}"
|
||||||
|
ZSH_THEME_GIT_PROMPT_SUFFIX=""
|
||||||
|
ZSH_THEME_GIT_PROMPT_DIRTY=""
|
||||||
|
ZSH_THEME_GIT_PROMPT_CLEAN=""
|
||||||
|
ZSH_THEME_GIT_PROMPT_ADDED="%{$fg_bold[cyan]%} +"
|
||||||
|
ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg_bold[yellow]%} !"
|
||||||
|
ZSH_THEME_GIT_PROMPT_DELETED="%{$fg_bold[red]%} —"
|
||||||
|
ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg_bold[green]%} »"
|
||||||
|
ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg_bold[white]%} #"
|
||||||
|
ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg_bold[blue]%} ?"
|
||||||
|
ZSH_THEME_GIT_PROMPT_STASHED="%{$fg_bold[yellow]%} $"
|
||||||
|
ZSH_THEME_GIT_PROMPT_BEHIND="%{$fg_bold[blue]%} •|"
|
||||||
|
ZSH_THEME_GIT_PROMPT_AHEAD="%{$fg_bold[blue]%} |•"
|
||||||
|
|
||||||
|
# git status display
|
||||||
|
local git_info='$(git_prompt_info)$(git_prompt_status)%{$reset_color%}'
|
||||||
|
|
||||||
|
# current user and hostname
|
||||||
|
local user_host='%{$fg[yellow]%}%n%{$reset_color%}@%{$fg[yellow]%}%m %{$reset_color%}'
|
||||||
|
|
||||||
|
# default: blue, if return code other than 0: red
|
||||||
|
local prompt='%(?,%{$fg[blue]%}> ,%{$fg[red]%}> )'
|
||||||
|
|
||||||
|
# current directory display
|
||||||
|
local directory_path='%{$fg[magenta]%}%~'
|
||||||
|
|
||||||
|
# last command return code
|
||||||
|
local return_code='%(?,,%{$fg[red]%} RC=%?%{$reset_color%})'
|
||||||
|
|
||||||
|
# left prompt definition (multiline)
|
||||||
|
PROMPT="${user_host} ${directory_path}
|
||||||
|
${prompt}"
|
||||||
|
|
||||||
|
# right prompt definition
|
||||||
|
RPROMPT="${git_info}"
|
||||||
|
RPROMPT+="${return_code}"
|
||||||
|
|
||||||
|
# prompt cursor fix when exiting vim
|
||||||
|
local cursor="\e[3 q"
|
||||||
|
if [ "$TYPEWRITTEN_CURSOR" = "block" ]; then
|
||||||
|
cursor="\e[1 q"
|
||||||
|
elif [ "$TYPEWRITTEN_CURSOR" = "beam" ]; then
|
||||||
|
cursor="\e[5 q"
|
||||||
|
fi
|
||||||
|
_fix_cursor() {
|
||||||
|
echo -ne "${cursor}"
|
||||||
|
}
|
||||||
|
precmd_functions+=(_fix_cursor)
|
||||||
Loading…
Add table
Add a link
Reference in a new issue