Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: sorin-ionescu/prezto
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: wumbabum/prezto
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Able to merge. These branches can be automatically merged.
  • 2 commits
  • 3 files changed
  • 2 contributors

Commits on Apr 11, 2024

  1. Add jtoney prompt theme

    wumbabum committed Apr 11, 2024
    Copy the full SHA
    ad85076 View commit details
  2. Merge pull request #1 from wumbabum/Add-jtoney-prompt-theme

    Add jtoney prompt theme
    wumbabum authored Apr 11, 2024
    Copy the full SHA
    61c5a2b View commit details
Showing with 101 additions and 1 deletion.
  1. +84 −0 modules/prompt/functions/prompt_jtoney_setup
  2. +8 −1 runcoms/zpreztorc
  3. +9 −0 runcoms/zshrc
84 changes: 84 additions & 0 deletions modules/prompt/functions/prompt_jtoney_setup
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
#
# A single line theme with Git information on the left.
#
# Authors:
# Kyle West <kswest@gmail.com>
# Sorin Ionescu <sorin.ionescu@gmail.com>
# Joseph Toney <wumbabum@gmail.com>
#
# Features:
# - Indicates dirty Git repository.
# - Indicates vi modes.
#
# Screenshots:
# http://i.imgur.com/dCwhynn.png
#

#
# 16 Terminal Colors
# -- ---------------
# 0 black
# 1 red
# 2 green
# 3 yellow
# 4 blue
# 5 magenta
# 6 cyan
# 7 white
# 8 bright black
# 9 bright red
# 10 bright green
# 11 bright yellow
# 12 bright blue
# 13 bright magenta
# 14 bright cyan
# 15 bright white
#

function prompt_jtoney_precmd {
setopt LOCAL_OPTIONS
unsetopt XTRACE KSH_ARRAYS

_prompt_pwd=$(prompt-pwd)

# Get Git repository information.
if (( $+functions[git-info] )); then
git-info
fi
}

function prompt_jtoney_setup {
setopt LOCAL_OPTIONS
unsetopt XTRACE KSH_ARRAYS
prompt_opts=(cr percent sp subst)

# Load required functions.
autoload -Uz add-zsh-hook

# Add hook for calling git-info before each command.
add-zsh-hook precmd prompt_jtoney_precmd

# Tell prezto we can manage this prompt
zstyle ':prezto:module:prompt' managed 'yes'

# Set editor-info parameters.
zstyle ':prezto:module:editor:info:completing' format '%B%F{red}...%f%b'
zstyle ':prezto:module:editor:info:keymap:primary' format "%B%F{green}❯%f%b"
zstyle ':prezto:module:editor:info:keymap:alternate' format "%B%F{magenta}❮%f%b"

# Set git-info parameters.
zstyle ':prezto:module:git:info' verbose 'no'
zstyle ':prezto:module:git:info:branch' format '%F{5}(%F{magenta}%b%f%F{5})'
zstyle ':prezto:module:git:info:dirty' format '%B%F{red}!%f%b'
zstyle ':prezto:module:git:info:indexed' format ' '
zstyle ':prezto:module:git:info:unindexed' format ' '
zstyle ':prezto:module:git:info:untracked' format ' '
zstyle ':prezto:module:git:info:keys' format 'prompt' '%b%D '

# Define prompts.
PROMPT='%F{12}${_prompt_pwd}%(!. %B%F{1}#%f%b.)%f ${git_info:+${(e)git_info[prompt]}}${editor_info[keymap]} '
RPROMPT=''
}

prompt_jtoney_setup "$@"
# vim: ft=zsh
9 changes: 8 additions & 1 deletion runcoms/zpreztorc
Original file line number Diff line number Diff line change
@@ -37,7 +37,12 @@ zstyle ':prezto:load' pmodule \
'directory' \
'spectrum' \
'utility' \
'ssh' \
'git' \
'completion' \
'homebrew' \
'osx' \
'syntax-highlighting' \
'history-substring-search' \
'prompt'

@@ -78,6 +83,8 @@ zstyle ':prezto:module:editor' key-bindings 'emacs'

# Ignore submodules when they are 'dirty', 'untracked', 'all', or 'none'.
# zstyle ':prezto:module:git:status:ignore' submodules 'all'
zstyle ':prezto:module:git:log:context' format 'medium'
zstyle ':prezto:module:git:info:branch' format ' %%B%F{2}%b%f%%b'

#
# GNU Utility
@@ -145,7 +152,7 @@ zstyle ':prezto:module:editor' key-bindings 'emacs'
# Set the prompt theme to load.
# Setting it to 'random' loads a random theme.
# Auto set to 'off' on dumb terminals.
zstyle ':prezto:module:prompt' theme 'sorin'
zstyle ':prezto:module:prompt' theme 'jtoney'

# Set the working directory prompt display length.
# By default, it is set to 'short'. Set it to 'long' (without '~' expansion)
9 changes: 9 additions & 0 deletions runcoms/zshrc
Original file line number Diff line number Diff line change
@@ -11,3 +11,12 @@ if [[ -s "${ZDOTDIR:-$HOME}/.zprezto/init.zsh" ]]; then
fi

# Customize to your needs...

plugins=(git asdf)

# path additions
. "$HOME/.asdf/asdf.sh"

alias cdcb="cd ~/Work/Citybase"

cdcb