guest@dotshare [~/groups/shells/zsh] $ ls Oxide-Zsh/ | cat

Oxide Zsh (scrot)

dikiaap Feb 11, 2018 (shells/zsh)

.zshrc(raw, dl)

SCROT

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# Themes.
ZSH_THEME="oxide"

# Case-sensitive completion.
CASE_SENSITIVE="true"

# Disable bi-weekly auto-update checks.
DISABLE_AUTO_UPDATE="true"

# Disable auto-setting terminal title.
DISABLE_AUTO_TITLE="true"

# Disable marking untracked files under VCS as dirty.
DISABLE_UNTRACKED_FILES_DIRTY="true"

# History.
HIST_STAMPS="yyyy-mm-dd"

# Plugins.
plugins=(
    archive
    extract
    git
)

# Environment variables.
source ~/.exports

# Oh My Zsh.
source ~/.oh-my-zsh/oh-my-zsh.sh

# User config.
source ~/.zsh/setopt.zsh

# Aliases.
source ~/.aliases
source ~/.aliases_private

# Functions.
source ~/.functions
source ~/.functions_private

# Tracks your most used directories, based on frecency with z.
source ~/.zsh/plugins/z/z.sh

# dircolors.
if [ -x "$(command -v dircolors)" ]; then
    eval "$(dircolors -b ~/.dircolors)"
fi

# fzf key bindings.
if [ -x "$(command -v fzf)" ]; then
    source ~/.fzf/shell/key-bindings.zsh
fi

# Manage SSH with Keychain.
if [ -x "$(command -v keychain)" ]; then
    eval "$(keychain --eval --quiet id_rsa_github id_rsa_gitlab)"
fi

# Base16 Shell.
if [ -f ~/.local/bin/base16-oxide ]; then
    source ~/.local/bin/base16-oxide
fi

CLICK TO VIEW

x

oxide.zsh-theme(raw, dl)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# Oxide theme for Zsh
#
# Author: Diki Ananta <diki1aap@gmail.com>
# Repository: https://github.com/dikiaap/dotfiles
# License: MIT

# Prompt:
# %F => Color codes
# %f => Reset color
# %~ => Current path
# %(x.true.false) => Specifies a ternary expression
#   ! => True if the shell is running with root privileges
#   ? => True if the exit status of the last command was success
#
# Git:
# %a => Current action (rebase/merge)
# %b => Current branch
# %c => Staged changes
# %u => Unstaged changes
#
# Terminal:
# \n => Newline/Line Feed (LF)

setopt PROMPT_SUBST

autoload -U add-zsh-hook
autoload -Uz vcs_info

# Use True color (24-bit) if available.
if [[ "${terminfo[colors]}" -ge 256 ]]; then
    oxide_turquoise="%F{73}"
    oxide_orange="%F{179}"
    oxide_red="%F{167}"
    oxide_limegreen="%F{107}"
else
    oxide_turquoise="%F{cyan}"
    oxide_orange="%F{yellow}"
    oxide_red="%F{red}"
    oxide_limegreen="%F{green}"
fi

# Reset color.
oxide_reset_color="%f"

# VCS style formats.
FMT_UNSTAGED="%{$oxide_reset_color%} %{$oxide_orange%}●"
FMT_STAGED="%{$oxide_reset_color%} %{$oxide_limegreen%}✚"
FMT_ACTION="(%{$oxide_limegreen%}%a%{$oxide_reset_color%})"
FMT_VCS_STATUS="on %{$oxide_turquoise%} %b%u%c%{$oxide_reset_color%}"

zstyle ':vcs_info:*' enable git svn
zstyle ':vcs_info:*' check-for-changes true
zstyle ':vcs_info:*' unstagedstr    "${FMT_UNSTAGED}"
zstyle ':vcs_info:*' stagedstr      "${FMT_STAGED}"
zstyle ':vcs_info:*' actionformats  "${FMT_VCS_STATUS} ${FMT_ACTION}"
zstyle ':vcs_info:*' formats        "${FMT_VCS_STATUS}"
zstyle ':vcs_info:*' nvcsformats    ""
zstyle ':vcs_info:git*+set-message:*' hooks git-untracked

# Check for untracked files.
+vi-git-untracked() {
    if [[ $(git rev-parse --is-inside-work-tree 2> /dev/null) == 'true' ]] && \
            git status --porcelain | grep --max-count=1 '^??' &> /dev/null; then
        hook_com[staged]+="%{$oxide_reset_color%} %{$oxide_red%}●"
    fi
}

# Executed before each prompt.
add-zsh-hook precmd vcs_info

# Oxide prompt style.
PROMPT=$'\n%{$oxide_limegreen%}%~%{$oxide_reset_color%} ${vcs_info_msg_0_}\n%(?.%{%F{white}%}.%{$oxide_red%})%(!.#.❯)%{$oxide_reset_color%} '
 

x

base16-oxide.sh(raw, dl)

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
#!/usr/bin/env sh
# Base16 Shell (https://github.com/chriskempson/base16-shell)
# Oxide scheme by Diki Ananta (https://github.com/dikiaap/dotfiles)

color00="21/21/21"  # Black
color01="e5/73/73"  # Red
color02="a6/bc/69"  # Green
color03="fa/c8/63"  # Yellow
color04="66/99/cc"  # Blue
color05="c5/94/c5"  # Magenta
color06="5f/b3/b3"  # Cyan
color07="c0/c5/ce"  # White
color08="5c/5c/5c"  # Bright Black
color09=$color01    # Bright Red
color10=$color02    # Bright Green
color11=$color03    # Bright Yellow
color12=$color04    # Bright Blue
color13=$color05    # Bright Magenta
color14=$color06    # Bright Cyan
color15="f3/f4/f5"  # Bright White
color_foreground=$color07 # White
color_background=$color00 # Black

if [ -n "$TMUX" ]; then
    # Tell tmux to pass the escape sequences through
    put_template() { printf '\033Ptmux;\033\033]4;%d;rgb:%s\033\033\\\033'\\'' "$@"; }
    put_template_var() { printf '\033Ptmux;\033\033]%d;rgb:%s\033\033\\\033'\\'' "$@"; }
    put_template_custom() { printf '\033Ptmux;\033\033]%s%s\033\033\\\033'\\'' "$@"; }
elif [ "${TERM%%[-.]*}" = "screen" ]; then
    # GNU screen (screen, screen-256color, and screen-256color-bce)
    put_template() { printf '\033P\033]4;%d;rgb:%s\007\033'\\'' "$@"; }
    put_template_var() { printf '\033P\033]%d;rgb:%s\007\033'\\'' "$@"; }
    put_template_custom() { printf '\033P\033]%s%s\007\033'\\'' "$@"; }
elif [ "${TERM%%-*}" = "linux" ]; then
    put_template() { [ "$1" -lt 16 ] && printf "\e]P%x%s" "$1" "$(echo "$2" | sed 's/\///g')"; }
    put_template_var() { true; }
    put_template_custom() { true; }
else
    put_template() { printf '\033]4;%d;rgb:%s\033'\\'' "$@"; }
    put_template_var() { printf '\033]%d;rgb:%s\033'\\'' "$@"; }
    put_template_custom() { printf '\033]%s%s\033'\\'' "$@"; }
fi

# 16 color palette
put_template 0  $color00
put_template 1  $color01
put_template 2  $color02
put_template 3  $color03
put_template 4  $color04
put_template 5  $color05
put_template 6  $color06
put_template 7  $color07
put_template 8  $color08
put_template 9  $color09
put_template 10 $color10
put_template 11 $color11
put_template 12 $color12
put_template 13 $color13
put_template 14 $color14
put_template 15 $color15

# Foreground / Background / Cursor color
if [ -n "$ITERM_SESSION_ID" ]; then
    # iTerm2 proprietary escape codes
    put_template_custom Pg c0c5ce # Foreground
    put_template_custom Ph 212121 # Background
    put_template_custom Pi c0c5ce # Bold color
    put_template_custom Pj 424242 # Selection color
    put_template_custom Pk c0c5ce # Selected text color
    put_template_custom Pl c0c5ce # Cursor
    put_template_custom Pm 212121 # Cursor text
else
    put_template_var 10 $color_foreground
    if [ "$BASE16_SHELL_SET_BACKGROUND" != false ]; then
        put_template_var 11 $color_background
        if [ "${TERM%%-*}" = "rxvt" ]; then
            put_template_var 708 $color_background # Internal border (rxvt)
        fi
    fi
    put_template_custom 12 ";7" # Cursor (reverse video)
fi

# Clean up
unset -f put_template
unset -f put_template_var
unset -f put_template_custom
unset color00
unset color01
unset color02
unset color03
unset color04
unset color05
unset color06
unset color07
unset color08
unset color09
unset color10
unset color11
unset color12
unset color13
unset color14
unset color15
unset color_foreground
unset color_background
 

x

Notes

I use Oh My Zsh for managing my Zsh. It doesn’t require much configuration and let’s focus to development!
I also use Base16 Shell for syntax highlighting.

More config at dikiaap/dotfiles on GitHub.