generated from welpo/tabi-start
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
79 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,5 +6,7 @@ | |
"MD025": false, | ||
"MD026": false, | ||
"MD031": false, | ||
"MD033": false | ||
"MD033": false, | ||
"MD034": false, | ||
"MD051": false | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
+++ | ||
title = "axis7818.zsh-theme" | ||
description = "My custom ZSH theme" | ||
weight = 1 | ||
template = "page.html" | ||
|
||
[taxonomies] | ||
tags = ["software"] | ||
|
||
[extra] | ||
local_image = "img/axis7818.zsh-theme.png" | ||
add_src_to_code_block = true | ||
+++ | ||
|
||
 | ||
|
||
I built this ZSH Theme from scratch. It took a while to strike a balance between useful information and spacious layout without taking up too much space in the terminal. This theme shows the current directory and git repo information. The prompt line is separate from that information to make it easier to use a narrower window without dealing with word wrap. It also shows failed exit codes and injects an extra newline between commands to visually | ||
|
||
# axis7818.zsh-theme | ||
|
||
{{ add_src_to_code_block(src="https://github.com/axis7818/dotfiles/blob/master/zsh/custom/themes/axis7818.zsh-theme") }} | ||
```zsh | ||
export VIRTUAL_ENV_DISABLE_PROMPT=1 | ||
function virtualenv_info { | ||
[ $VIRTUAL_ENV ] && echo `basename $VIRTUAL_ENV`' ' | ||
} | ||
|
||
function git_info() { | ||
check_git=$(command git rev-parse --is-inside-work-tree 2> /dev/null) || return 0 | ||
echo "$(git_prompt_info)$(git_prompt_status)$FG[default]" | ||
} | ||
|
||
local user_color='blue'; [ $UID -eq 0 ] && user_color='red' | ||
local wd_color='green' | ||
local date_time="%{$fg[default]%}%*%{$reset_color%} $FG[default]]" | ||
local user="%{$fg_bold[$user_color]%}%n" | ||
local post_wd="$reset_color$FG[default]" | ||
|
||
local prompt_line="%{$fg_bold[magenta]%}%(!.#.❱)%{$reset_color%} " | ||
|
||
local return_status="%{$fg_bold[red]%}%(?..%? | ||
)%{$reset_color%}" | ||
|
||
local pwd="%{$fg[$wd_color]%}%~" | ||
|
||
# Set Prompt | ||
PROMPT='${return_status} | ||
$FG[default]${pwd}${post_wd} %{$fg_bold[yellow]%}$(virtualenv_info)$(git_info) | ||
${prompt_line}' | ||
PROMPT2="%{$fg[red]%}\ %{$reset_color%}" | ||
RPROMPT='' | ||
|
||
# Git Fields | ||
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[magenta]%}" | ||
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" | ||
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg_bold[yellow]%}∼%{$reset_color%}" | ||
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg_bold[green]%}✓%{$reset_color%}" | ||
ZSH_THEME_GIT_PROMPT_ADDED="%{$fg_bold[green]%}+%{$reset_color%}" | ||
ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg_bold[blue]%}✱%{$reset_color%}" | ||
ZSH_THEME_GIT_PROMPT_DELETED="%{$fg_bold[red]%}✗%{$reset_color%}" | ||
ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg_bold[magenta]%}➦%{$reset_color%}" | ||
ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg_bold[yellow]%}✂%{$reset_color%}" | ||
ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg_bold[cyan]%}?%{$reset_color%}" | ||
``` | ||
|
||
# Usage | ||
|
||
I recommend using [ohmyzsh](https://github.com/ohmyzsh/ohmyzsh?tab=readme-ov-file#getting-started) to set up zsh on your machine. | ||
|
||
After ohmyzsh is set up, create a file at `~/.oh-my-zsh/custom/themes/axis7818.zsh-theme`, and past the [axis7818.zsh-theme](#axis7818-zsh-theme) contents into it. | ||
|
||
Finally, set your theme by updating your `.zshrc` file: | ||
|
||
```zsh | ||
ZSH_THEME="axis7818" | ||
``` |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.